
COP 3330 Exam #1
Multiple Choice Questions Form: A
2/13/07
1) Which of the following is NOT a primitive type in Java?
a) int b) double c) byte d) char e) none of the above
2) Which of the following defines the term "instance"?
a) one and only b) pertains to the object c) local variable
d) public method e) none of the above
3) Which of the following statements are true?
a) All classes in Java must have a main method.
b) All methods in a class must be public.
c) All instance variables in a class must be public.
d) A public class must be defined in a file with the same name as the class.
e) none of the above
4) What modifier indicates the user of a constant?
a) const b) final c) static d) int e) none of the above
5) What is the output of the following statement?
System.out.println("12+15 = "+12+15);
a) 12+15 = 27 b) 12+15 = 12+15 c) 12+15 = 1215
d) 27 = 27 e) none of the above
6) From which of the following can a Scanner object be used to read?
a) Keyboard b) text file c) .pdf file
d) both choices a and b e) both choices a and c