What is the result?

Given:
And given the commands:

javac Test.JavaJava Test Hello
What is the result?

Given:
And given the commands:

javac Test.JavaJava Test Hello
What is the result?

A.
Success

B.
Failure

C.
Compilation fails.

D.
An exception is thrown at runtime



Leave a Reply 1

Your email address will not be published. Required fields are marked *


renko

renko

And given the commands:
javac Test.Java
Java Test Hello

Answer: B
package q080;

public class Test {
public static void main(String[] args) {
if (args[0].equals(“Hello”) ? false : true) {
System.out.println(“Succes”);
} else {
System.out.println(“Failure”);
}
}
}
/*Output:
Failure
*/