8.1-2_Inheriting Object Flashcards

1
Q

What is the only class that doesn’t have a parent class?

A

java.lang.Object

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

What happens when you doesn’t extend a specific class?

A

The compiler automatically adds the syntax ‘extends java.lang.Object’ to the class definition.

public class Zoo { } 
public class Zoo extends java.lang.Object { }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What implies that all classes inherit from java.lang.Object?

A

The result is that every class gains access to any accessible methods in the Object class.

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

What about inheritance with primitives?

A

primitive types such as int and boolean do not inherit from Object, since they are not classes.
-> Instead use the Wrapper classes for that

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