Class and objects Flashcards

1
Q

What is an enum?

A

An enum is a data type that represents a group of constants (unchangeable variables, like final variables).

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

There is an enum class called Fruits. It has a enum constant called ‘Apple’. How to access it?

A

Fruit myVar = Fruit.MEDIUM;

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

What is a default constructor?

A

A constructor without parameters. If a class has no parameters java automatically provides a default constructor.

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