Give:
What is the result?
A. 1525
B. 13
C. Compilation fails
D. An exception is thrown at runtime
E. The program fails to execute due to runtime error
Give:
What is the result?
A. 1525
B. 13
C. Compilation fails
D. An exception is thrown at runtime
E. The program fails to execute due to runtime error
The correct answer is A. 1525
Try it yourself:
class Alpha{
public String[] main = new String[2];
Alpha(String[]main){
for(int ii = 0; ii < main.length; ii++){
this.main[ii] = main[ii] + 5;
}
}
public void main(){
System.out.print(main[0] + main[1]);
}
}
public class Test{
public static void main(String[] args){
Alpha main = new Alpha(args);
main.main();
}
}