Section 1

Preview this deck

Enum Type (Java)

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (5)

Section 1

(5 cards)

Enum Type (Java)

Front

- A user-defined data type populated by a set of constants. - Variables of the user-defined data type may only have values equal to one of the constants in the data type definition. - public enum Day { Sun, Mon, Tues, Wed, Thur, Fri, Sat } - Day sabbath = Sun (CORRECT) - Day sabbath = Frank (INCORRECT)

Back

Literal

Front

- Fixed values represented in source code. - In variables, the fixed value is substituted by a symbol (variable name).

Back

Parts of a Variable

Front

- String greeting = "Hello World" - String is the Data Type. - greeting is the Substitution (or variable) Name. - Hello World is the Literal (String literal in this case).

Back

Data Type

Front

- An attribute of a piece of data that tells the compiler how it can be used.

Back

Constant

Front

- A name/value pair that cannot change once defined. - By convention, name is written in all caps with underscores as spaces.

Back