Exam 6: A First Look at Classes

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

The public access specifier for a field indicates that the field may not be accessed by statements outside the class.

Free
(True/False)
4.8/5
(34)
Correct Answer:
Verified

False

The scope of a public instance field is __________.

Free
(Multiple Choice)
4.8/5
(33)
Correct Answer:
Verified

D

An object can store data.

Free
(True/False)
4.8/5
(33)
Correct Answer:
Verified

True

The __________ package is automatically imported into all Java programs.

(Multiple Choice)
4.9/5
(33)

Methods that operate on an object's fields are called __________.

(Multiple Choice)
4.8/5
(46)

The following statement is an example of __________. import java.util.*;

(Multiple Choice)
4.9/5
(34)

Which symbol indicates that a member is public in a UML diagram?

(Multiple Choice)
4.8/5
(31)

When a local variable in an instance method has the same name as an instance field, the instance field hides the local variable.

(True/False)
4.8/5
(39)

A method that stores a value in a class's field or in some other way changes the value of a field is known as a mutator method.

(True/False)
4.8/5
(36)

Two or more methods in a class may have the same name as long as __________.

(Multiple Choice)
4.9/5
(36)

Which of the following statements will create a reference, str, to the String "Hello, World"?

(Multiple Choice)
4.9/5
(44)

The term "no-arg constructor" is applied to any constructor that does not accept arguments.

(True/False)
4.8/5
(41)

After the header, the body of the method appears inside a set of __________.

(Multiple Choice)
4.9/5
(38)

When you work with a __________, you are using a storage location that holds a piece of data.

(Multiple Choice)
4.9/5
(37)

A UML diagram does not contain __________.

(Multiple Choice)
4.7/5
(40)

What does the following UML diagram entry mean? + setHeight(h : double) : void

(Multiple Choice)
4.9/5
(36)

To indicate the data type of a variable in a UML diagram, you enter __________.

(Multiple Choice)
4.9/5
(34)

For the following code, which statement is not true? public class Sphere { Private double radius; Public double x; Private double y; Private double z; }

(Multiple Choice)
4.9/5
(40)

Java allows you to create objects of the __________ class in the same way you would create primitive variables.

(Multiple Choice)
4.9/5
(38)

A constructor __________.

(Multiple Choice)
4.8/5
(37)
Showing 1 - 20 of 58
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)