#2 enum + cmsc131 review Flashcards

1
Q

enumerated types

A

specifies all possible values by listing them (use to represent small sets that you know all the values of)
(fields and methods can be added to enums)

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

enum example

A

public enum GiraffeType (NORTHERN, SOMALI, SOUTHERN, MASAI}

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

3 enumerated type methods

A

valueof()
name()
compareTo()

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

how to use an enum outside of the class where it is declared

A

Classname.EnumTypeName.ENUMVALUE

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

object oriented principles

A

abstraction (hiding details, describing in simple terms)
encapsulation (confining/grouping info inside something in a program)
makes it easier for you, b/c JavaLovesYou

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

this refers to…

A

the current object

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