Java Objects Flashcards

1
Q

When creating a new object that includes a parent class here is the the syntax for that new object?

A

Car swift = new Swift();

you can see the parent class Car is to the left while the sub class swift is to the right of it.

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

Each class inherits the object class and how does this affect the classes?

A

It gives each class access to the object methods like toString and other useful methods and the equals method is also useful. It is good to implement the equals method and the toString method and need to use @override

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

what does the split method to on Strings?

A

It returns an array of strings that are split depending on the indicator.

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

One considerstation when setting variables and their values

A

Need to understand what type will be returned and then set it to the left side

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