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

Explain creating threads by extending thread class ?

580


Why wait(),notify(),notifyAll() methods defined in Object class althought we are using in only threads.

2377


What is int lol?

596


In a container there are 5 components. I want to display the all the components names, how will you do that one?

607


What is data member in java?

508






Explain the protected field modifier?

598


What is final keyword?

648


Who is founder of java?

534


How does regex work?

528


How do you check if a number is a perfect square?

518


How do you get the length of a string in java?

526


Why is a string immutable?

548


What is <> used for in java?

676


Is it possible to use Semaphore/ Mutex in an Interrupt Handler?

541


What are keywords and reserved words in java?

564