Chapter 3 Flashcards

1
Q

Does name of file must match name of class

A

Yes

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

Is java case sensitive

A

Yes

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

What is the purpose of static

A

So we can call a method without creating an object

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

What is concatenate operator in java

A

+

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

How we compare strings in java

A

string1.equals(string2)

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

Is array a class in java

A

Yes

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

What happens if we give value more than array size

A

Java sends exception

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

What are primitives

A

The data types in java which are not objects. They are always in lower case.

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

How much primitive data types in java

A

8

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

What is stored at stack

A

Local variables, primitive data types

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

What is stored at heap

A

Objects

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

How primitive data types passes

A

By value

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

How object passes

A

By reference

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

What are wrapper classes

A

Through wrapper classes, we pass data types as reference (just like objects)

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

What parseXxx do

A

It changes the datatype. e.g.
String value = “532”;
int d = Integer.parseInt(value);

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

What is boxing/unboxing

A

In jdk 5.0 or above there is new feature called boxing/unboxing. It changes the primitive data type to object and vice verse with the help of iWrapper. e.g.
Integer iWrapper = 10;