Exam 8: Objects and Classes
Exam 1: Introduction96 Questions
Exam 2: Fundamental Data Types103 Questions
Exam 3: Decisionseasy99 Questions
Exam 4: Loops100 Questions
Exam 5: Methods94 Questions
Exam 6: Arrays and Arraylists100 Questions
Exam 7: Inputoutput and Exception Handling100 Questions
Exam 8: Objects and Classes101 Questions
Exam 9: Inheritance and Interfaces99 Questions
Exam 10: Graphical User Interfaces54 Questions
Exam 11: Advanced User Interfaces91 Questions
Exam 12: Object-Oriented Design100 Questions
Exam 13: Recursion100 Questions
Exam 14: Sorting and Searching99 Questions
Exam 15: The Java Collections Framework100 Questions
Exam 16: Basic Data Structures94 Questions
Exam 17: Tree Structures100 Questions
Exam 18: Generic Classes78 Questions
Exam 19: Streams and Binary Inputoutput82 Questions
Exam 20: Multithreading82 Questions
Exam 21: Internet Networking74 Questions
Exam 22: Relational Databases75 Questions
Exam 23: XML74 Questions
Exam 24: Web Applications74 Questions
Select questions type
The ____ operator is used to construct an object from a class.
(Multiple Choice)
4.9/5
(27)
Insert the missing code in the following code fragment. This fragment is intended to implement a method to set the value stored in an instance variable.
Public class Employee
{
Private String empID;
Private boolean hourly;
) . .
_______
{
Hourly = isHourly;
}
}
(Multiple Choice)
4.9/5
(44)
Given the following class definition, which of the following are NOT considered part of the class's public interface?
Public class CashRegister
{
Public static final double DIME_VALUE = 0.1;
Private static int objectCounter;
Public void updateDimes(int dimes) {…}
Private boolean updateCounter(int counter) {…}
}
(Multiple Choice)
4.8/5
(43)
Which of the following statements about instance methods is correct?
(Multiple Choice)
4.9/5
(40)
Consider the following code snippet:
Public class Vehicle
{
) . .
Public void setVehicleAttributes(String attributes)
{) . . }
Public String getVehicleAtrributes()
{) . . }
Public String getModelName()
{) . . }
}
Assuming that the names of the methods reflect their action, which of the following statements about these instance methods is NOT correct?
(Multiple Choice)
4.8/5
(35)
Consider the following code snippet:
Coin coin1 = new Coin("dime", 0.10);
Coin coin2 = coin1;
Which of the following statements is NOT correct?
(Multiple Choice)
4.7/5
(37)
The process of hiding object data and providing methods for data access is called ____.
(Multiple Choice)
4.9/5
(38)
Consider the following code snippet:
Public int getCoinValue(String coinName)
{ ) . . }
Which of the following statements is correct?
(Multiple Choice)
4.9/5
(43)
Given the following class definition, which of the following are considered part of the class's public interface?
Public class Motorcycle
{
Public static final int WHEEL_COUNT = 2;
Private int rpmRating;
Public void updatePrice(double increase) {…}
Private String designCode() {…}
}
(Multiple Choice)
4.8/5
(42)
Which of the following statements about classes is correct?
(Multiple Choice)
4.9/5
(35)
Which of the following statements about encapsulation is correct?
(Multiple Choice)
4.8/5
(35)
Which of the following statements about constructors is correct?
(Multiple Choice)
4.7/5
(35)
Consider the following code snippet:
Public int getSalary(String empNum)
{ ) . . }
Which of the following statements is correct?
(Multiple Choice)
4.8/5
(35)
Given the following class definition, which of the following are considered part of the class's public interface?
Public class CashRegister
{
Public static final double DIME_VALUE = 0.1;
Private static int objectCounter;
Public void updateDimes(int dimes) {. . .}
Private boolean updateCounter(int counter) {. . .}
}
(Multiple Choice)
4.9/5
(34)
Given the following class:
Public class Coin
{
Private String coinName;
Private double coinValue;
) . .
}
Consider the following code snippet that utilizes the Coin class:
Coin coin1 = new Coin("dime", 0.10);
Coin coin2 = coin1;
Coin2.setValue(0.15);
Which of the following statements is correct?
(Multiple Choice)
4.9/5
(33)
Consider the following code snippet:
Coin coin1 = null;
System.out.println("Value of coin = " + coin1.getValue());
What is wrong with this code?
(Multiple Choice)
4.8/5
(38)
Consider the following code snippet:
Public class Employee
{
Private String empID;
Private boolean hourly;
Public Employee()
{
}
) . .
}
Which statement reflects the action performed when the constructor to Employee is called?
(Multiple Choice)
4.9/5
(40)
Showing 81 - 100 of 101
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)