Exam 6: A First Look at Classes

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

A method that gets a value from a class's field but does not change it is known as a mutator method.

(True/False)
4.8/5
(34)

It is common practice in object-oriented programming to make all of a class's:

(Multiple Choice)
4.9/5
(37)

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

(True/False)
4.8/5
(40)

The following package is automatically imported into all Java programs.

(Multiple Choice)
4.9/5
(31)

When an object is passed as an argument to a method, what is passed into the method's parameter variable?

(Multiple Choice)
4.8/5
(38)

When an object is created, the attributes associated with the object are called:

(Multiple Choice)
4.8/5
(30)

In UML diagrams, this symbol indicates that a member is public.

(Multiple Choice)
4.7/5
(32)

An access specifier indicates how the class may be accessed.

(True/False)
4.7/5
(37)

When you are working with a ________, you are using a storage location that holds a piece of data.

(Multiple Choice)
4.9/5
(33)

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
(35)

In the cookie cutter metaphor, think of the ________ as a cookie cutter and ________ as the cookies.

(Multiple Choice)
4.9/5
(40)

Given the following code, what will be the value of finalAmount when it is displayed? Public class Order { Private int orderNum; Private double orderAmount; Private double orderDiscount; Public Order(int orderNumber, double orderAmt, Double orderDisc) { OrderNum = orderNumber; OrderAmount = orderAmt; OrderDiscount = orderDisc; } Public double finalOrderTotal() { Return orderAmount - orderAmount * OrderDiscount; } } Public class CustomerOrder { Public static void main(String[] args) { Order order; Int orderNumber = 1234; Double orderAmt = 580.00; Double orderDisc = .1; Order = new Order(orderNumber, orderAmt, orderDisc); Double finalAmount = order.finalOrderTotal(); System.out.printf("Final order amount = $%,.2f\n", FinalAmount); } }

(Multiple Choice)
4.8/5
(35)

What is stored by a reference variable?

(Multiple Choice)
4.9/5
(35)

The term "default constructor" is applied to the first constructor written by the author of a class.

(True/False)
4.7/5
(33)

Data hiding, which means that critical data stored inside the object is protected from code outside the object, is accomplished in Java by:

(Multiple Choice)
4.9/5
(35)

Most programming languages that are in use today are:

(Multiple Choice)
4.8/5
(34)

A constructor:

(Multiple Choice)
4.8/5
(42)

Instance methods should be declared static.

(True/False)
4.8/5
(37)
Showing 41 - 58 of 58
close modal

Filters

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