【简答题】写出如下程序的输出结果 class A{ public int getNumber(int a) { return a + 1; } } class B extends A { public int getNumber (int a) { return a + 2; } public static void main (String args[]){ A a = new B(); System.o...
【简答题】写出如下程序的输出结果。 class A { class Dog { private String name; private int age; public int step; Dog(String s,int a) { name=s; age=a; step=0; } public void run(Dog fast) { fast.step++; } } public static void...
【简答题】写出如下程序的输出结果。 class FatherClass{ public int value; public void f(){ value=100; System.out.println("FatherClass value="+value); } } class ChildClass extends FatherClass{ public int value; public void f(...
【简答题】(10-1)阅读如下程序,写出1,2语句的输出结果 public class Demo7 { public static void main(String[] args ) { Integer y = new Integer(3); Integer x = new Integer(3); System. out .println( x == y ); // 输出结果 1 System. out ....
【简答题】写出如下程序的输出结果。 abstract class Shape { public abstract double area(); public void print() { System.out.println(this.area()); } } class Circle extends Shape { private double radius; public Circle(double r...