- 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.
- What is the signature of a method?
Ans: An ordered list of the datatypes of each parameter.
- What does it mean to say that methods are overloaded?
Ans: It means that those methods all have the same name
but different signatures.
- 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.
- Use the Character class to convert
the char variable x to upper case.
See the Week2 Character Example. Ans:
char c = Character.toUpperCase(x);
- 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.