Exam 6: A First Look at Classes

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

Shadowing is the term used to describe where the field name is hidden by the name of a local or parameter variable.

(True/False)
4.7/5
(39)

One or more objects may be created from a(n) __________.

(Multiple Choice)
4.8/5
(36)

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

(Multiple Choice)
4.9/5
(38)

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.8/5
(36)

Which of the following is not involved in identifying the classes to be used when developing an object-oriented application?

(Multiple Choice)
4.9/5
(32)

The java.lang package is automatically imported into all Java programs.

(True/False)
4.9/5
(32)

A reference variable stores a(n) __________.

(Multiple Choice)
4.8/5
(39)

A constructor is a method that is automatically called when an object is created.

(True/False)
4.8/5
(37)

Class objects normally have __________ that perform useful operations on their data, but primitive variables do not.

(Multiple Choice)
4.9/5
(41)

Which symbol indicates that a member is private a UML diagram?

(Multiple Choice)
5.0/5
(47)

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

(True/False)
4.7/5
(40)

The scope of a private instance field is __________.

(Multiple Choice)
4.9/5
(41)

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

(Multiple Choice)
4.7/5
(34)

A constructor __________.

(Multiple Choice)
4.8/5
(31)

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

Select all that apply. Which of the following are classes from the Java API?

(Multiple Choice)
4.8/5
(38)

A class is not an object. It is a description of an object.

(True/False)
4.9/5
(41)

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

(Multiple Choice)
4.8/5
(38)

You should not define a class that is dependent on the values of other class fields __________.

(Multiple Choice)
4.8/5
(46)

__________ refers to combining data and code into a single object.

(Multiple Choice)
4.8/5
(35)
Showing 21 - 40 of 58
close modal

Filters

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