BCIS 3630 EXAM 2 GADDIS REVIEW QUESTIONS

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/61

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 6:32 AM on 4/2/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

62 Terms

1
New cards

This type of method does not return a value.

a. null

b. void

c. empty

d. anonymous

b. void

2
New cards

This appears at the beginning of a method definition.

a. semicolon

b. parenthesis

c. body

d. header

d. header

3
New cards

The body of a method is enclosed in ______________.

a. curly braces { }

b. square brackets [ ]

c. parenthesis ( )

d. quotation marks " "

a. curly braces { }

4
New cards

A method header can contain ___________.

a. method modifiers

b. the method return type

c. the method name

d. a list of parameter declarations

e. all of these

f. none of these

e. all of these

5
New cards

A value that is passed into a method when it is called is known as a(n) ___________.

a. parameter

b. argument

c. signal

d. return value

b. argument

6
New cards

A variable that receives a value that is passed into a method is known as a(n) ___________.

a. parameter

b. argument

c. signal

d. return value

a. parameter

7
New cards

This statement causes a method to end and sends a value back to the statement that called the method.

a. end

b. send

c. exit

d. return

d. return

8
New cards

T/F You terminate a method header with a semicolon.

False

9
New cards

T/F When passing an argument to a method, Java will automatically perform a widening conversion (convert the argument to a higher-ranking data type), if necessary.

True

10
New cards

T/F When passing an argument to a method, Java will automatically perform a narrowing conversion (convert the argument to a lower-ranking data type), if necessary.

False

11
New cards

T/F A parameter variable's scope is the entire program that contains the method in which the parameter is declared.

False

12
New cards

T/F When code in a method changes the value of a parameter, it also changes the value of the argument that was passed into the parameter.

False

13
New cards

T/F When an object, such as a String, is passed as an argument, it is actually a reference to the object that is passed.

True

14
New cards

T/F The contents of a String object cannot be changed.

True

15
New cards

T/F When passing multiple arguments to a method, the order in which the arguments are passed is not important.

False

16
New cards

T/F No two methods in the same program can have a local variable with the same name.

False

17
New cards

T/F It is possible for one method to access a local variable that is declared in another method.

False

18
New cards

T/F You must have a return statement in a value-returning method.

True

19
New cards

This is a collection of programming statements that specify the fields and methods that a particular type of object may have.

a. class

b. method

c. parameter

d. instance

a. class

20
New cards

A class is analogous to a(n) ____________.

a. house

b. blueprint

c. drafting table

d. architect

b. blueprint

21
New cards

An object is a(n) _______________.

a. blueprint

b. primitive data type

c. variable

d. instance of a class

d. instance of a class

22
New cards

This is a class member that holds data.

a. method

b. instance

c. field

d. constructor

c. field

23
New cards

This key word causes an object to be created in memory.

a. create

b. new

c. object

d. construct

b. new

24
New cards

This is a method that gets a value from a class's field, but does not change it.

a. accessor

b. constructor

c. void

d. mutator

a. accessor

25
New cards

This is a method that stores a value in a field or in some other way changes the value of a field.

a. accessor

b. constructor

c. void

d. mutator

d. mutator

26
New cards

When the value of an item is dependent on other data, and that item is not updated when the other data is changed, what has the value become?

a. bitter

b. stale

c. asynchronous

d. moldy

b. stale

27
New cards

This is a method that is automatically called when an instance of a class is created.

a. accessor

b. constructor

c. void

d. mutator

b. constructor

28
New cards

When a local variable has the same name as a field, the local variable's name does this to the field's name.

a. shadows

b. complements

c. deletes

d. merges with

a. shadows

29
New cards

This is automatically provided for a class if you do not write one yourself.

a. accessor method

b. default instance

c. default constructor

d. variable declaration

c. default constructor

30
New cards

Two or more methods in a class may have same name, as long as this is different.

a. their return values

b. their access specifier

c. their parameter lists

d. their memory address

c. their parameter lists

31
New cards

The process of matching a method call with the correct method is known as __________.

a. matching

b. binding

c. linking

d. connecting

b. binding

32
New cards

A class's responsibilities are ____________.

a. the objects created from the class

b. things the class knows

c. actions the class performs

d. both b and c

d. both b and c

33
New cards

T/F The new operator creates an instance of a class.

True

34
New cards

T/F Each instance of a class has its own set of instance fields.

True

35
New cards

T/F When you write a constructor for a class, it still has the default constructor that Java automatically provides.

False

36
New cards

T/F A class may not have more than one constructor.

False

37
New cards

T/F To find the classes needed for an object-oriented application, you identify all of the verbs in a description of the problem domain.

False

38
New cards

In an array declaration, this indicates the number of elements that the array will have.

a. subscript

b. size declaration

c. element sum

d. reference variable

b. size declaration

39
New cards

Each element of an array is accessed by a number known as a(n) _____________.

a. subscript

b. size declaration

c. address

d. specifier

a. subscript

40
New cards

The first subscript in an array is always ___________.

a. 1

b. 0

c. -1

d. 1 less than the number of elements

b. 0

41
New cards

The last subscript in an array is always ___________.

a. 100

b. 0

c. -1

d. 1 less than the number of elements

d. 1 less than the number of elements

42
New cards

Array bounds checking happens __________.

a. when the program is compiled

b. when the program is saved

c. when the program runs

d. when the program is loaded into memory

c. when the program runs

43
New cards

This array field holds the number of elements that the array has.

a. size

b. elements

c. length

d. width

c. length

44
New cards

To insert an item at a specific location in an ArrayList object, you use this method.

a. store

b. insert

c. add

d. get

c. add

45
New cards

To delete an item from an ArrayList object, you use this method.

a. remove

b. delete

c. erase

d. get

a. remove

46
New cards

To determine the number of items stored in an ArrayList object, you use this method.

a. size

b. capacity

c. items

d. length

a. size

47
New cards

T/F Java does not allow a statement to use a subscript that is outside the range of valid subscripts for an array.

True

48
New cards

T/F an array's size declarator can be a negative integer expression.

False

49
New cards

T/F both of the following declarations are legal and equivalent:

int[] numbers;

int numbers[];

True

50
New cards

T/F the subscript of the last element in a single-dimensional array is one less than the total number of elements in the array

True

51
New cards

T/F the values in an initialization list are stored in the array in the order that they appear in the list.

True

52
New cards

T/F the java compiler does not display an error message when it processes a statement that uses an invalid subscript.

True

53
New cards

T/F when an array is passed to a method, the method has access to the original array.

True

54
New cards

T/F an ArrayList automatically expands in size to accommodate the items stored in it.

True

55
New cards

This type of method cannot access any non-static member variables in its own class.

a. instance

b. void

c. static

d. non-static

c. static

56
New cards

When an object is passed as an argument to a method, this is actually passed.

a. a copy of the object

b. the name of the object

c. a reference to the object

d. none of these; you cannot pass an object

c. a reference to the object

57
New cards

If you write this method for a class, Java will automatically call it any time you concatenate an object of the class with a string.

a. toString

b. plusString

c. stringConvert

d. concatString

a. toString

58
New cards

Making an instance of one class a field in another class is called __________.

a. nesting

b. class fielding

c. aggregation

d. concatenation

c. aggregation

59
New cards

T/F A static member method may refer to non-static member variables of the same class, but only after an instance of the class has been defined.

False

60
New cards

T/F All static member variables are initialized to -1 by default.

False

61
New cards

T/F When an object is passed as an argument to a method, the method can access the argument.

True

62
New cards

T/F A method cannot return a reference to an object.

False