Pre-Finals Flashcards

(34 cards)

1
Q

Data type that contains a fixed set of constants. Best used when all
possibilities of the values of the class are known.

A

Enumeration (enum)

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

Common examples of enums

A

Compass directions
o Months of the year
o Cards in a deck

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

Enumeration list value

A

Enum constants

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

Returns the name of the calling constant object

A

toString()

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

Returns an integer that represents the constant’s position in the list of constants; the first position is 0

A

ordinal()

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

Returns a negative integer if the calling object’s ordinal value is less than that of the argument, 0 if they are the same, and a positive integer if the calling object’s ordinal value is greater than that of the argument

A

compareTo()

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

Returns true if its argument is equal to the calling object’s value

A

equals()

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

Accepts a string parameter and returns an enumeration constant

A

valueOf()

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

Returns an array of the enumerated constants

A

values()

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

used to describe a data type that allows only appropriate behaviors.

A

Type-safe

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

create a class within another class and store them

A

Nested Class

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

access to all static methods of the top-level class

A

Static member class

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

requires an instance; it has access to all data and methods of the top-level class.

A

Non-static member class

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

defined within a method body

A

Local class

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

special case of a local class that has no identifier

A

Anonymous class

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

Sequence of characters that represent a string or multiple strings.

A

Regular expression (regex)

14
Q

This method determines what the string should match against and specifies multiple values.

15
Q

this package has classes to help form and use regular expressions.

A

java.util.regex.package

16
Q

allows for the method matches to check if equal and returns true accordingly.

17
Q

used in regular expressions for character variability.

A

Square brackets “[]”

18
Q

wildcard operator that represents any single character in regular expression

19
Q

Symbol in regular expressions that indicates the number of times a specified character appears in a matching string.

A

Repetition Operator

20
Q

0 or more occurrences

21
Q

0 or 1 occurrence

22
1 or more occurrences
+
23
x occurrences
{x}
24
x or more occurrences
{x,}
24
Between x & y occurrence
{x,y}
25
stores the format of a regular expression
Pattern class
26
compiles the given regular expression into a pattern.
Compile method
27
stores a possible match between a pattern and a string.
Matcher class
28
scans the input sequence looking for the next subsequence that matches the pattern
find()
29
Splits the string around matches of the given regular expression.
split()
30
Used to replace all the occurrences of the defined regular expression found in the string with another string.
replaceAll()