Consider the following Java declaration and assignment statement.
float x = y;
Which one of the following types is "y" NOT allowed to be? correct answers double
Which one of the following is NOT part of the signature of a Java method? correct answers
names of formal parameters
Assume "test" is a boolean variable. Which of the following expressions is equivalent to "test ==
true"? correct answers test
Which of the following keywords is useful for getting out of an infinite loop? correct answers
break
Consider the following Java statements.
int x = 3;
x = x++;
What is the value x is holding? correct answers !test
Which of the following can a class NOT be used for? correct answers a primitive type
Consider the following Java method.
Which term best describes what this method computes?
static int doSomething(int[] a)
{int b = 0;
for (int c : a) b += c;
return b;} correct answers sum
, Which one of the following values can a Java variable NOT have? correct answers an object
Consider the following Java program, which one of the following best describes "count"? correct
answers a class variable
A subclass will _____ one superclass. correct answers extend
A class that implements a listener interface does which of the following? correct answers It
handles events
Consider the following Java program. What is the superclass of "Clicker"? correct answers
JFrame
What does a Java compiler do? correct answers Translates source code in ".java" files into Java
byte code in ".class" files
Consider the following Java method, which term best describes "String[] args"? correct answers
formal parameter
Consider the following first line from a Java method definition.
public static boolean compute(int n, float x) {
Which one of the following lines could begin a method that legally overloads the above method?
correct answers public static boolean compute(float n, int x) {
Consider the following line of Java code.
System.out.println("Hello, World!");
Which one of the following does NOT describe '"Hello, World!"'? correct answers a declaration