Inheritance Example
class Shape {
protected int edges_num;
}
class Star extends Shape{
Star(int _edges) {
edges_num = _edges;
}
}
public class TestStar {
public static void main(String[] argv) {
Star my_star;
my_star = new Star() ;
}
}
Previous slide
Next slide
Back to first slide
View graphic version