FoundationMistakesLearnFromIt Flashcards

1
Q

Rules for switch statementn n

A
String
char
int
byte
short
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

If neither super() or this() is declared as the first statement, the implicit default constructor will be what?

A

super();

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

What happens when u don’t define a default constructor?

A
  • The jvm will add a default constructor automatically.

- calls the no-args constructor of the super class

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

Name the constructor for the Boolean class

A

Boolean(String)
Boolean(boolean)
they give you a Boolean object.
So Boolean(String) is “true” then true.

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

Can you name the two static helper methods for the Boolean class?

A

parseBoolean(String)
valueOf(boolean)
the return type is primitive boolean not the object

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

What are the short circut operators

A

|| and &&

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