Pop Quiz Feb 15
Name:____________
1._______ What type does the following expression have?
3.5 > 2
A) boolean
B) double
C) int
D) String
2._______ What does this code print?
String s = "Hungry";
System.out.println(s.charAt(1));
A) H
B) u
C) s.charAt(1)
D) Hungry
3._____ Which of the follow is an correct method header for the main method of
an application?
A) private static void Main(String[] args)
B) public static void main(String[] args)
C) public int static main(String args)
D) public void main(String[])
4. Suppose I have a Computer object named hal that I want to call the
performCalculations() method on. The performCalculations() method takes
two parameters: an int followed by a String. I want the int to be 42 and
the String to be "Sorry Dave". Write the complete statement that does
this: