Correct Answers.
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 state int objectcounter;
public void updateDimes(int dimes) {. . .}
private boolean update counter(int counter) {. . .}
} correct answers DIME_VALUE and updateDimes
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() {...}
} correct answers WHEEL_COUNT and updatePrice
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) {...}
} correct answers ObjectCounter and updateCounter
Given the following class definition, which of the following are NOT 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() {...}
} correct answers RpmRating and designCode
Which of the following are considered members of a class? correct answers All instance
variables and methods.
Which of the following statements about objects is correct? correct answers Every object has its
own set of data and a set of methods to manipulate the data.
The process of hiding object data and providing methods for data access is called____. correct
answers Encapsulation
The public constructors and methods of a class form the public ____ of the class. correct answers
Interface