📄 shape.java
字号:
public class Shape
{
int i = 10;
public Shape()
{
System.out.println("create a new shape");
}
public void draw()
{
System.out.println("shape drawing");
}
public void draw(int a)
{
System.out.println("shape drawing abc");
}
}
class Circle extends Shape
{
int i = 1000;
public Circle()
{
super();//调用父类的无参数构造方法
System.out.println("create a new circle" + super.i);
System.out.println("create a new circle" + i);
}
public void draw()
{
System.out.println("circle drawing");
}
public void test()
{
System.out.println("test in Circle");
}
public static void main(String[] args)
{
Circle c = new Circle();
/*c.draw();
System.out.println("-------------");
Shape s = new Circle();
//s.draw();
s.draw(10);
s.test();*/
}
}
/* Employee e1 = new Employee();
e1.name = Unknown
e1.salary = 0
Employee e2 = new Employee("abc");
e2.name=abc
e2.salary = 0
Employee e3 = new Employee("zzz",12);
e3.name=zzz
e3.salary=12
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -