Example of a Class and its Instance
class Star {
}
public class TestStar {
public static void main(String[] argv) {
Star my_star;
my_star = new Star() ;
}
}
If a class is public, any other class is allowed to use it.
Previous slide
Next slide
Back to first slide
View graphic version