World!")"?
public static void main(String[] args) {
System.out.println("Hello, World!");
}
Select one:
a. actual parameter or argument
b. formal parameter
c. method call
d. modifier
e. return type
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?
Select one:
a. private static boolean compute(int n, float x) {
b. public boolean compute(int n, float x) {
c. public static int compute(int n, float x) {
d. public static boolean compute(float n, int x) {
e. public static boolean compute(int x, float n) {
Which one of the following lines is a Java method call?
Select one:
a. import javax.swing.JOptionPane;
b. int x = 0;
c. compute();
d. return y;
e. void compute() {}
Consider the following Java method, which term best describes "public"?
, public static void main(String[] args) {
System.out.println("Hello, World!");
}
Select one:
a. actual parameter or argument
b. formal parameter
c. method call
d. modifier
e. return type
What is the output of the following Java program?
class Sum {
static int sum = 0;
static void add(int i) { sum += i; }
public static void main(String[] args) {
for (int i = 0; i < 10; i++) add(i);
System.out.println(sum);
}
}
Select one:
a. 0
b. 9
c. 10
d. 45
e. 100
Consider the following Java method, which term best describes "String[]
args"?
public static void main(String[] args) {
System.out.println("Hello, World!");
}
Select one:
a. actual parameter or argument
b. formal parameter