M
Q. What should be the execution order, if a class has a method, static block, instance block, and constructor, as shown below?
public class First_C { public void myMethod() { System.out.println("Method"); } { System.out.println(" Instance Block"); } public void First_C() { System.out.println("Constructor "); } static { System.out.println("static block"); } public static void main(String[] args) { First_C c = new First_C(); c.First_C(); c.myMethod(); } }
No solution found for this question.
Add Solution and get +2 points.
You must be Logged in to update hint/solution
Be the first to start discuss.
Q. How many methods does a thread class provides for sleeping a thread?
Q. In Java, which data type is used to store numbers with decimal points?
Q. In Java, the word true is ...............
Q. What is the result of the expression true && false in Java?
Discusssion
Login to discuss.