Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. public class XXX {
  2.  
  3. static YYY dependend = new YYY();
  4.  
  5. static {
  6. System.out.println("3");
  7. }
  8.  
  9. public static void main(String[] args) {
  10. System.out.println("4");
  11. }
  12. }
  13.  
  14. class YYY {
  15. static {
  16. System.out.println("1");
  17. }
  18. YYY(){
  19. System.out.println("2");
  20. }
  21. }
  22.  
  23. 1
  24. 2
  25. 3
  26. 4
  27.  
  28. public class Test {
  29.  
  30. private static Object obj = new Object();
  31.  
  32. public static void main(String[] args) {
  33.  
  34. System.out.println("test");
  35. }
  36.  
  37. }
  38.  
  39. public static void main(String[] args){
  40. ...
  41. }
  42.  
  43. public static void main(String... args){
  44. System.out.println("Executing my application...");
  45. }
  46.  
  47. class Test2 extends Object{
  48. public static void doSomething(){
  49. System.out.println("Calling Test's doSomethingElse method.");
  50. Test.doSomethingElse();
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement