Multiple Choice
Consider the following code snippet:
Public class Employee
{
Private String empName;
) . .
}
Which of the following statements is correct?
A) The empName variable can be accessed by any user of an Employee object.
B) The empName variable can be accessed only by methods of the Employee class.
C) The empName variable can be accessed only by methods of another class.
D) The empName variable cannot be accessed at all because it is private.
Correct Answer:

Verified
Correct Answer:
Verified
Q36: Which of the following statements about classes
Q37: When an object is created from a
Q38: You have created a Fruit class and
Q39: Insert the missing code in the following
Q40: A constructor is invoked when _ to
Q42: Consider the following code snippet:<br>Public class Vehicle<br>{<br>Private
Q43: You have created an Employee class. You
Q44: Consider the following code snippet:<br>Public class Vehicle<br>{<br>Private
Q45: Consider the following code snippet:<br>Public class Vehicle<br>{<br>Private
Q46: Consider the following code snippet:<br>Public class Coin<br>{<br>Private