Exam 6: A First Look at Classes
Exam 1: Introduction to Computers and Java53 Questions
Exam 2: Java Fundamentals52 Questions
Exam 3: Decision Structures58 Questions
Exam 4: Loops and Files56 Questions
Exam 5: Methods56 Questions
Exam 6: A First Look at Classes58 Questions
Exam 7: Arrays and the Arraylist Class63 Questions
Exam 8: A Second Look at Classes and Objects52 Questions
Exam 9: Text Processing and More About Wrapper Classes62 Questions
Exam 10: Inheritance64 Questions
Exam 11: Exceptions and Advanced File Io59 Questions
Exam 12: Java-Fx: Gui Programming and Basic Controls42 Questions
Exam 13: Java-Fx: Advanced Controls40 Questions
Exam 14: Java-Fx: Graphics, Effects, and Media40 Questions
Exam 15: Recursion23 Questions
Exam 16: Databases40 Questions
Select questions type
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)
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 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)
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)
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)
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
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)