单项选择题
A. finished
B. Compilation fails.
C. An AssertionError is thrown.
D. An AssertionError is thrown and finished is output.
单项选择题 classSuper{publicintgetLenght(){return4;}}publicclassSubextendsSuper{publiclonggetLenght(){return5;}publicstaticvoidmain(String[]args){Supersooper=newSuper();Subsub=newSub();System.out.println(sooper.getLenght()+“,”+sub.getLenght());}}Whatistheoutput?()
单项选择题 public void test(int x) { int odd = x%2; if (odd) { System.out.println(“odd); } else { System.out.println(“even”); } } Which statement is true?()
单项选择题 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?()