what is the difference between static block and static
method

Answer Posted / mahendra pratap singh

Static blocks execute first n than static method.It means
static block have high priority compare to static method

Is This Answer Correct ?    21 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a two-pass assembler?

779


How many bytes is a url?

741


What's the difference between comparison done by equals method and == operator?

722


Is vector synchronized in java?

716


Is alive method in java?

704


How do you override a variable in java?

711


What are the types of strings?

763


What is the do while loop syntax?

749


If goto and const is reserve words than why it is not work in java?

1731


What is internal iteration in java se 8?

827


What is super constructor?

728


What is the purpose of using break in each case of switch statement?

760


enlist some features of jdk.

729


I want to persist data of objects for later use. What’s the best approach to do so?

683


What is an example of character?

772