1/17/08 Notes

To Notes

CSC 212 -- 1/17/08

 

Review Questions

  1. What is a UML diagram?

    Ans: A diagram that shows the following information: class name; for each instance variable, the datatype and accessibility (private or public); for each method, the signature, return type and accessibility.

  2. What is the signature of a method?

    Ans: An ordered list of the datatypes of each parameter.

  3. What does it mean to say that methods are overloaded?

    Ans: It means that those methods all have the same name but different signatures.

  4. What is a primitive datatype?
    Ans: A datatype that is not defined by class. Java primitive types are byte, short, int, long, float, double, char, boolean.

  5. Use the Character class to convert the char variable x to upper case. See the Week2 Character Example. Ans:

    char c = Character.toUpperCase(x);

  6. How do you write a Java program to test a class?
    Ans: Write code to call each public method in the class, some more than once to cover all the cases defined within the method.

 

More Builtin Java Classes

 

Designing Your Own Classes

 

The Person Classes

 

The Vehicle Class

 

Project Proj3