Exam 6: A First Look at Classes

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

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

(Multiple Choice)
4.9/5
(38)

The following package is automatically imported into all Java programs.

(Multiple Choice)
4.8/5
(40)

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

(Multiple Choice)
4.8/5
(47)

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

(True/False)
4.9/5
(43)

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

(True/False)
4.9/5
(37)

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.println("Final order amount = $" + FinalAmount); } }

(Multiple Choice)
4.8/5
(39)

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 int getOrderAmount() { Return orderAmount; } Public int getOrderDisc() { Return orderDisc; } } Public class CustomerOrder { Public static void main(String[] args) { Int ordNum = 1234; Double ordAmount = 580.00; Double discountPer = .1; Order order; Double finalAmount = order.getOrderAmount()- Order.getOrderAmount()* order.getOrderDisc(); System.out.println("Final order amount = $" + FinalAmount); } }

(Multiple Choice)
4.7/5
(38)

You should not define a class field that is dependent upon the values of other class fields...

(Multiple Choice)
4.9/5
(41)

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

(True/False)
4.9/5
(33)

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

(Multiple Choice)
4.9/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.7/5
(32)

A class specifies the ________ and ________ that a particular type of object has.

(Multiple Choice)
4.8/5
(37)

The scope of a public instance field is

(Multiple Choice)
5.0/5
(25)

A class's responsibilities include

(Multiple Choice)
4.8/5
(39)

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

(Multiple Choice)
4.9/5
(30)

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

(Multiple Choice)
5.0/5
(52)

Instance methods do not have the key word static in their headers.

(True/False)
4.9/5
(45)

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

(Multiple Choice)
4.8/5
(33)

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

(Multiple Choice)
4.9/5
(42)

In your textbook the general layout of a UML diagram is a box that is divided into three sections.The top section has the _______;the middle section holds _______;the bottom section holds _______.

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

Filters

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