Exam 7: Object-Oriented Programming, Part 2: User-Defined Classes

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

What is the purpose of class constructors?

(Multiple Choice)
4.8/5
(39)

Accessor methods are void methods.

(True/False)
4.9/5
(39)

Which access modifier can be referenced by methods of the same class only?

(Multiple Choice)
4.8/5
(37)

The body of a method must be surrounded by curly braces.

(True/False)
4.8/5
(31)

price is an instance variable of a class. Inside the method public void change( int price ), how do we refer to the instance variable price and not the parameter price?

(Short Answer)
4.9/5
(36)

The reference __________ refers to the object reference with which this method has been called.

(Short Answer)
4.7/5
(35)

The enum objects are instantiated as __________ objects.

(Short Answer)
4.8/5
(45)

The __________ method is called automatically when an object reference is used as a String.

(Multiple Choice)
4.7/5
(34)

It is possible to create user-defined classes in Java.

(True/False)
4.7/5
(31)

When you define a static variable for your class, it is better to define its accessor and mutator methods as class methods.

(True/False)
4.8/5
(33)

A parameter to a mutator method with the same name as the instance variable being changed hides the instance variable.

(True/False)
4.8/5
(46)

Mutator methods can be void methods or can return the reference this.

(True/False)
4.9/5
(32)

An instance method can reference which of the following?

(Multiple Choice)
4.8/5
(41)

static methods can reference non-static variables.

(True/False)
4.8/5
(38)

A method parameter or local variable that has the same name as an instance variable will __________ that instance variable.

(Short Answer)
4.9/5
(37)

Suppose Angelica ran a program with multiple constructors and got a compiler error. How could she improve her program to avoid the error?

(Essay)
4.8/5
(42)

What will happen if you do not put curly braces around a method body?

(Multiple Choice)
4.8/5
(31)

How should slashes and asterisks be used in a Javadoc comment?

(Multiple Choice)
4.8/5
(32)

A package statement uses the keyword __________.

(Short Answer)
4.8/5
(38)

Which of the following is an advantage of providing multiple constructors?

(Multiple Choice)
4.8/5
(39)
Showing 41 - 60 of 78
close modal

Filters

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