题目内容

public class Father {String name, address, tel;int age;public Father(String name, int age) {this.name = name;this.age = age;}void out() {System.out.print("姓名:" + name);System.out.print("年龄:" + age);}void outOther() {System.out.print("家庭住址:" + address);System.out.print("电话:" + tel);}}class Son extends Father {String school;public Son(String name, int age) {super(name, age);}void out() {super.out();super.outOther();System.out.println("学校:" + school);}public static void main(String args[]) {Son son = new Son("Tom",22);son.address = "武清区";son.school = "天狮学院";son.tel = "123456";son.out();}}

查看答案
更多问题

public class MyClass {int a[] = { 1, 2, 3, 4, 5,6 };void out() {for (int j = 0; j < a.length; j++)System.out.print(a[j] + "");}public static void main(String[] args) {MyClass my = new MyClass();my.out();}}

public class Test{public static void main(String[] args) {int i,s=0;int a[]= {10,20,30,40,50,60,70,80,90};for(i=0;i

public class Animal {Animal(){System.out.print("Animal");} }public class Cat extends Animal{Cat(){System.out.print("Cat");}}public class TestDog {public static void main(String[] args) {Cat a=new Cat();}}

public class Triangle {public static void main(String[] args) {int x = 5, y = 6, z = 4;if (x + y > z && x + z > y && z + y > x)System.out.println("三角形");elseSystem.out.println("不是三角形");}}

答案查题题库