Question 15 / 35:  And the commands:

Javac Program153.java

Java Program153 1 2

What is the result?

class Alpha1 {

public String[] main = new String[2];

Alpha1(String [] main){

for(int ii = 0; ii <= main.length;ii++){

this.main[ii]= main[ii]+5;

}

}

public void main(){

System.out.println(main[0]+main[1]);

}

}

public class Program153 {

public Program153() {

}

public static void main(String[] args) {

Alpha1 main = new Alpha1(args);

main.main();

}

}

A  1525
B  13
C  Compilation fails
D  The program fails to execute due to runtime error
E  An exception is thrown at runtime
<< First < Previous Next > Last >>
Quiz Home Page
https://www.jobilize.com/ocjp-1z0-803-oca1-7-mock-exam-part-ii-quiz-by-pankaj-amdocs-gurg

OCA(1z0-803_OCA1.7)MockExamPII

Author:

Access: Public Instant Grading

Ask
Nicole Bartels
Start Quiz
Copy and paste the following HTML code into your website or blog.
<iframe src="https://www.jobilize.com/embed/ocjp-1z0-803-oca1-7-mock-exam-part-ii-quiz-by-pankaj-amdocs-gurg" width="600" height="600" frameborder="0" marginwidth="0" marginheight="0" scrolling="yes" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>