单项选择题
A.Compilation fails.
B. “odd” will always be output.
C. “even” will always be output.
D. “odd” will be output for odd values of x, and “even” for even values.
E. “even” will be output for add values of x, and “odd” for even values.
单项选择题 class Super { public int getLenght() { return 4; } } public class Sub extends Super { public long getLenght() { return 5; } public static void main(String[] args) { Super sooper = new Super(); Sub sub = new Sub(); System.out.println( sooper.getLenght() + “,” + sub.getLenght() ); } } What is the output?()
多项选择题 Whichthreestatementsaretrue?()
多项选择题 1.classTestA{ 2.TestBb; 3.TestA(){ 4.b=newTestB(this); 5.} 6.} 7.classTestB{ 8.TestAa; 9.TestB(TestAa){ 10.this.a=a; 11.} 12.} 13.classTestAll{ 14.publicstaticvoidmain(Stringargs[]){ 15.newTestAll().makeThings(); 16.//...codecontinueson 17.} 18.voidmakeThings(){ 19.TestAtest=newTestA(); 20.} 21.} Whichtwostatementsaretrueafterline15,beforemaincompletes?()