EECS1030M Test 1

Wednesday January 21, 2015, 16:00-16:30
Lab 01
Version E


/**
 * This utility class provides information about a suitcase.
 * 
 * @author Franck van Breugel
 */
public class Suitcase 
{
    private Suitcase() {}
    
    /**
     * Limit of the weight of a suitcase.
     */
    public static final double LIMIT = 23.5;
    
    /**
     * Checks whether the given weight is over the limit.
     * 
     * @param weight the weight of a suitcase.
     * @pre. weight >= 0
     * @return true if the given weight is over the limit,
     * false otherwise.
     */
    public static boolean isOverLimit(double weight)
    {
	return weight > Suitcase.LIMIT;
    }
}


Multiple choice question

Question 1

Which of the following statements is correct?

A. A utility class contains no constructor.
B. A utility class contains a public constructor.
C. A utility class contains a private constructor.
D. None of the above.