FoundationMistakesLearnFromIt Flashcards
1
Q
Rules for switch statementn n
A
String char int byte short
2
Q
If neither super() or this() is declared as the first statement, the implicit default constructor will be what?
A
super();
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
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.
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
6
Q
What are the short circut operators
A
|| and &&