using classes and objects Flashcards

1
Q

what is the println method

A

is a service provided by the system.out objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

how we created a scanner object

A

using the new operator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

an object variable does not contain the variable itself true or false

A

true

it holds the address of an object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

after the new operator creates an object

A

true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

if we change the string of string object will be right

true or false

A

false

string object is immutable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what is alise

A

aliasing refers to a situation where two different expressions or symbols refer to the same object./

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what is the “charAt(int index)”

A

Returns the char value at the specified index.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what is the “compareTo(String anotherString)”

A

int

Compares two strings lexicographically.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

compareToIgnoreCase(String str)

A

Compares two strings lexicographically, ignoring case differences.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

length()

A

Returns the length of this string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

toLowerCase()

A

Converts all of the characters in this String to lower case using the rules of the default locale.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

toUpperCase()

A

Converts all of the characters in this String to upper case using the rules of the default locale.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what is the explanation of compere to

A

The result is a negative integer if this String object lexicographically precedes the argument string. The result is a positive integer if this String object lexicographically follows the argument string. The result is zero if the strings are equal;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

math rondom

A

random from [0,1[

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

(int)((math.random()*10)+10 )

A

0-19

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

(int) math.random()*10

A

0
0
0

17
Q

gen.nextInt(5)

A

0-4

18
Q

Math.abs()

A

int abs1 = Math.abs(10); // abs1 = 10

int abs2 = Math.abs(-20); // abs2 = 20

19
Q

Math.ceil()

A

double ceil = Math.ceil(7.343); // ceil = 8.0

20
Q

Math.floor()

A

double floor = Math.floor(7.343); // floor = 7.0

21
Q

Math.min()

A

int min = Math.min(10, 20);

10

22
Q

Math.max()

A

int max = Math.max(10, 20);

23
Q

Math.pow()

A

double pow2 = Math.pow(2,2);
System.out.println(“pow2 = “ + pow2);

double pow8 = Math.pow(2,8);
System.out.println(“pow8 = “ + pow8);

24
Q

Math.sqrt()

A

double sqrt4 = Math.sqrt(4);
System.out.println(“sqrt4 = “ + sqrt4);

double sqrt9 = Math.sqrt(9);
System.out.println(“sqrt9 = “ + sqrt9);