What will be the output of the program?


			  		

Loading

Choose the correct option.

What will be the output of the program?

import java.util.*; 
public class NewTreeSet2 extends NewTreeSet { //line 2
public static void main(String [] args) {
NewTreeSet2 t = new NewTreeSet2();
t.count();
}
}
protected class NewTreeSet { //line 8
void count() {
for (int x = 0; x < 7; x++,x++ ) {
System.out.print(" " + x);
}
}
}

 

A. 36560
B. 0 2 4 6
C. Compilation fails at line 2
D. Compilation fails at line 8

Leave a Comment