package com.cnsuning.util;
public class Shape {
public Shape() {
// TODO Auto-generated constructor stub
System.out.println("before shape draw");
draw();
System.out.println("after shape draw");
}
public static void main(String[] args) {
// TODO Auto-generated method stub
}
public void draw(){
System.out.println("Shape draw");
}
}
package com.cnsuning.util;
public class Circle extends Shape{
public Circle() {
super();
}
public static void main(String[] args) {
// TODO Auto-generated method stub
}
public void draw(){
System.out.println("circle draw");
}
}
package com.cnsuning.src;
import com.cnsuning.util.Circle;
public class Main {
public Main() {
// TODO Auto-generated constructor stub
}
public static void main(String[] args) {
Circle c = new Circle();
}
}