Pablo Napoli wrote:Hi everyone!. Just because many of you guys are helping me for preparing for my exam I want to "contribute" with all of them in my same situation. So this is one to practice:
I don't want to write the right answer so you can solve it and then compile and check your own one.
pablo what you are trying to explain in the code
What ever the program says that it's output is
1
1
Because you have created a static variable so whenever class is loaded static fields and static block are executed in the order they are specified in the class
Next object is created and make method is called twice so output is 1 for first method call and same for next call
It is good for practice purpose