package com.One;public class One { public int age; public String name; public void show(){ System.out.println("动物会吃东西"); } public class Dog extends One{ } public static void main(String[] args) { Dog dog = new Dog(); dog.age = 10; dog.name="小花"; dog.show(); }}
添加回答
举报
0/150
提交
取消