What is the result?

Given the code in a file Traveler.java: What is the result?

Given the code in a file Traveler.java: What is the result?

A.
Happy Journey! Duke

B.
Happy Journey! Java

C.
An exception is thrown at runtime

D.
The program fails to execute due to a runtime error



Leave a Reply 1

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


renko

renko

Code question:
Given this code in a file Traveler.java:
class Tours {
public static void main (String [] args) {
System.out.print(“Happy Journey! ” + args[1]);
}
}
public class Traveler {
public static void main (String[] args) {
Tours.main(args);
}
}
And the commands:
javac Traveler.java
java Traveler Java Duke
What is the result?

Happy Journey! DukeBUILD SUCCESSFUL (total time: 0 seconds)