• 2021-04-14
    以下程序的输出结果为。
    abstractclassShape{
    abstractvoiddisplay();
    }
    classCircleextendsShape{
    voiddisplay(){
    System.out.println("Circle");
    }
    }
    classRectangleextendsShape{
    voiddisplay(){
    System.out.println("Rectangle");
    }
    }
    classTriangleextendsShape{
    voiddisplay(){
    System.out.println("Triangle");
    }
    }
    publicclassAbstractClassDemo{
    publicstaticvoidmain(Stringargs[]){
    (newCircle()).display();
    (newRectangle()).display();
    (newTriangle()).display();
    }
    }

  • Circle Rectangle Triangle

    内容

    • 0

      以下哪个是Java ArrayList 类的方法? A: add B: println C: import D: System

    • 1

      以下代码段的输出结果为1. int x = 0, y = 4, z = 5;2. if (x > 2) {3. if (y < 5) {4. System. out .println ( "message one" );5. }6. else {7. System.out.println( "message two");8. }9. }10. else if (z > 5) {11. System.out.println("message three");12. }13. else {14. System.out.println( "message four");15. } A: message one B: message two C: message three D: message four

    • 2

      【单选题】对于下面代码,正确的Java源程序文件名是( )。 class A { void method1() { System. out .println( "Method1 in class A" ); } } public class B { void method2() { System. out .println( "Method2 in class B" ); } public sta

    • 3

      以下程序的输出结果是()。 publicclassT{ publicstaticvoidmain(Stringargs[]){ try{ System.out.print(“同一个世界,同一个梦想”); }finally{ System.out.println(“最终实现”); } } }

    • 4

      (2-6)写出下面程序的运行结果。 publicclassDemo{ publicstaticvoidmain(Stringargs[]){ booleana=false; booleanb=true; booleanc=(a&&b)&&(!b); booleanresult=(a&b)&(!b); System.out.println(result); System.out.println(c); } }