Exam 6: A First Look at Classes
Exam 1: Introduction to Computers and Java51 Questions
Exam 2: Java Fundamentals61 Questions
Exam 3: Decision Structures64 Questions
Exam 4: Loops and Files57 Questions
Exam 5: Methods60 Questions
Exam 6: A First Look at Classes58 Questions
Exam 7: Arrays and the Arraylist Class64 Questions
Exam 8: A Second Look at Classes and Objects50 Questions
Exam 9: Text Processing and More About Wrapper Classes60 Questions
Exam 10: Inheritance70 Questions
Exam 11: Exceptions and Advanced File IO56 Questions
Exam 12: A First Look at GUI Applications60 Questions
Exam 13: Advanced GUI Applications58 Questions
Exam 14: Applets and More54 Questions
Exam 15: Creating GUI Applications With Javafx and Scene Builder40 Questions
Exam 16: Recursion42 Questions
Exam 17: Databases48 Questions
Select questions type
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)
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)
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)
Showing 41 - 58 of 58
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)