Quiz 1 (Midterm) Flashcards

1
Q

Any class can contain an unlimited number of methods.

-True
-False

A

T

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

An application’s main() method must have a void return type.

-True
-False

A

T

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

A method’s identifier must be more than one word, must have embedded spaces, and can be a Java keyword.

-True
-False

A

F

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

Parentheses in a method declaration contain parameters that are “dropped into” the method.

-True
-False

A

T

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

When a value is returned from a method, you are required to use the value when the method is called.

-True
-False

A

F

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

You can overload methods correctly by providing different parameter lists for methods with the same name.

-True
-False

A

T

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

A block can exist entirely within another block or entirely outside and separate from another block, and sometimes blocks can overlap.

-True
-False

A

F

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

Any string value that is input into a program can be used in arithmetic operations.

-True
-False

A

F

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

When using the prewritten equals() method, a true or false comparison between two Strings is returned, but you do not know how the code looks behind the scenes.

-True
-False

A

T

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

The terms “literal string” and “string literal” are entirely different in Java programming.

-True
-False

A

F

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

Assigning ____ to a field means that no other classes can access the field’s values.

-private access
-user rights
-key access
-protected access

A

private access

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

Methods used with object instantiations are called ____ methods.

-internal
-instance
-static
-accessor

A

instance

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

Methods that retrieve values are called ____ methods.

-static
-accessor
-class
-mutator

A

accessor

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

After an object has been instantiated, its methods can be accessed using the object’s _____, a dot, and a method call.

-operator
-identifier
-class
-output

A

identifier

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

When an application is run, the method that must be executed first must be named ____.

-main()
-void()
-first()
-final()

A

main()

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

____ involves using one term to indicate diverse meanings, or writing multiple methods with the same name but with different parameter lists.

-Nesting
-Signing
-Overloading
-Referencing

A

Overloading

17
Q

Due to automatic type promotion, when a method with a double parameter is passed an integer, the integer will be promoted to a(n) ____.

-integer
-short
-double
-boolean

A

double

(not sure)

18
Q

The String class ____ method evaluates the contents of two String objects to determine if they are equivalent.

-replace()
-toString()
-equals()
-charAt()

A

equals()

19
Q

The ____ method returns the length of a String.

-size()
-length()
-getSize()
-getLength()

A

length()

20
Q

The ____ method converts any object to a String.

-convertString()
-replace()
-substring()
-toString()

A

toString()

21
Q

The local variable is known only within the boundaries of a method

-True
-False

A

T