Intro to Java Programming Chapter 2

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

1/20

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 9:17 PM on 6/10/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

21 Terms

1
New cards

The "building blocks" that Java programmers use to write computer programs are called _______.

A. windows

B. objects

C. internal data

D. entities

objects

2
New cards

In Java, objects within the same class share common ___________ ?

A. behavior

B. data

C. instructions

D. comments

behavior

3
New cards

What is a storage location in the computer's memory called that has a type, name, and contents?

A. identifier

B. literal

C. label

D. variable

variable

4
New cards

The camel case naming convention uses _________ at intervals in the middle of the variable name.

A. uppercase letters

B. digits

C. dollar signs

D. the underscore character

uppercase letters

5
New cards

By convention among Java programmers, variables begin with a(n) _____________.

A. uppercase letter

B. digit

C. lowercase letter

D. dollar sign

lowercase letter

6
New cards

By convention among Java programmers, class names begin with a(n) _____________.

A. lowercase letter

B. dollar sign

C. digit

D. uppercase letter

uppercase letter

7
New cards

What is the name of the type that denotes floating-point numbers that can have fractional parts?

A. double

B. floatingPoint

C. int

D. integer

double

8
New cards

What is the name of the type that denotes whole numbers?

A. double

B. int

C. whole

D. integer

int

9
New cards

In Java, a comment on a line begins with which characters?

A. ''

B. //

C. ()

D. " "

//

10
New cards

What term is used to refer to text in a program that is an explanation for human readers of the code?

A. methods

B. comments

C. constants

D. [ and ]

comments

11
New cards

What is the purpose of the assignment operator?

A. to check for inequality

B. to check for identity

C. to check for equality

D. to change the value of a variable

to change the value of a variable

12
New cards

The type of an object is given by its ______ ?

A. variable

B. method

C. reference

D. class

class

13
New cards

Which is not a method of the String class?

A. length

B. toUpperCase

C. toLowerCase

D. println

println

14
New cards

Input to a method, enclosed in parentheses after the method name, is known as ______________.

A. implicit parameters

B. interfaces

C. arguments

D. return values

arguments

15
New cards

The value calculated by a method is called its _____ value.

A. implicit

B. explicit

C. argument

D. return

return

16
New cards

Which operator constructs object instances?

A. new

B. instanceof

C. void

D. construct

new

17
New cards

What terminology describes a method that returns information about an object and does not change the object's internal data?

A. mutator

B. accessor

C. void

D. public

accessor

18
New cards

What terminology describes a method of an object that modifies that object's internal data?

A. public

B. void

C. mutator

D. accessor

mutator

19
New cards

What do object variables store?

A. objects

B. classes

C. object references

D. numbers

object references

20
New cards

What is the purpose of a test program?

A. The test program confirms that the Java compiler is correct.

B. The test program verifies that methods have been implemented correctly.

C. The test program checks the syntax of each object's methods.

D. The test program enforces that the types between arguments match correctly.

The test program verifies that methods have been implemented correctly.

21
New cards

Assume the class Circle has an accessor called getRadius and a mutator called setRadius. What is the output of the following code?

Circle c1 = new Circle(3);

Circle c2 = c1;

c1.setRadius(4);

System.out.println(c2.getRadius());

A. 4

B. 3

C. 6

D. 8

4