Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class XXX {
- static YYY dependend = new YYY();
- static {
- System.out.println("3");
- }
- public static void main(String[] args) {
- System.out.println("4");
- }
- }
- class YYY {
- static {
- System.out.println("1");
- }
- YYY(){
- System.out.println("2");
- }
- }
- 1
- 2
- 3
- 4
- public class Test {
- private static Object obj = new Object();
- public static void main(String[] args) {
- System.out.println("test");
- }
- }
- public static void main(String[] args){
- ...
- }
- public static void main(String... args){
- System.out.println("Executing my application...");
- }
- class Test2 extends Object{
- public static void doSomething(){
- System.out.println("Calling Test's doSomethingElse method.");
- Test.doSomethingElse();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement