public abstract class AbstractClass {
private static String version = "0.0.1";
static String getVersion() {
return version;
}
}
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
//new AbstractClass(); // you can't because the class is abstract
System.out.println("" + AbstractClass.getVersion()); // no problem you can execute a static method !
}
}
run:
0.0.1
No comments:
Post a Comment