What is the result? Given: What is the result? Given: What is the result? A. Compilation fails B. The code compiles, but does not execute. C. Paildrome D. Wow E. Mom Show Hint ← Previous question Next question →
Lukas I’d say E args[0] is “Wow” and args[1] is “Mom” Reply renko Code question: public class Palindrome { public static void main(String[] args) { System.out.println(args[1]); return 0; } } Arguments: Wow Mom Output: Mom Exception in thread “main” java.lang.RuntimeException: Uncompilable source code – incompatible types: unexpected return value at Palindrome.main(Palindrome.java:5) /home/renko/.cache/netbeans/8.1/executor-snippets/run.xml:53: Java returned: 1 Reply
renko Code question: public class Palindrome { public static void main(String[] args) { System.out.println(args[1]); return 0; } } Arguments: Wow Mom Output: Mom Exception in thread “main” java.lang.RuntimeException: Uncompilable source code – incompatible types: unexpected return value at Palindrome.main(Palindrome.java:5) /home/renko/.cache/netbeans/8.1/executor-snippets/run.xml:53: Java returned: 1 Reply
B
b
tested
I’d say E
args[0] is “Wow”
and args[1] is “Mom”
Code question:
public class Palindrome {
public static void main(String[] args) {
System.out.println(args[1]);
return 0;
}
}
Arguments: Wow Mom
Output:
Mom
Exception in thread “main” java.lang.RuntimeException: Uncompilable source code – incompatible types: unexpected return value
at Palindrome.main(Palindrome.java:5)
/home/renko/.cache/netbeans/8.1/executor-snippets/run.xml:53: Java returned: 1