Created
March 19, 2017 13:13
-
-
Save fermopili/362cddd520d4902183663b5a2d6852fc to your computer and use it in GitHub Desktop.
com.javarush.task.task15.task1524
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Порядок загрузки переменных | |
*/ | |
public class Solution | |
{ static | |
{ | |
init(); | |
} | |
static | |
{ | |
System.out.println("Static block"); | |
} | |
{ | |
System.out.println("non-static block"); | |
printAllFields(this); | |
} | |
public Solution() | |
{ | |
System.out.println("Solution constructor"); | |
printAllFields(this); | |
} | |
public int i = 6; | |
public String name = "First name"; | |
public static void init() | |
{ | |
System.out.println("static void init()"); | |
} | |
public static void main(String[] args) | |
{ | |
System.out.println("public static void main"); | |
Solution s = new Solution(); | |
} | |
public static void printAllFields(Solution obj) | |
{ | |
System.out.println("static void printAllFields"); | |
System.out.println(obj.i); | |
System.out.println(obj.name); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment