what is the difference between static block and static
method

Answer Posted / raghavendra

As soon as the class is loaded, the static block will be
executed. Where as the static method should be called
explictly.

Is This Answer Correct ?    51 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is java an open source?

711


What is indexof?

716


Why synchronization is important in java?

766


What is floating data type?

738


Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?

742


Can we use this () and super () in a method?

712


What is array length in java?

708


Can java run on google chrome?

861


What is the purpose of garbage collection in java? When is it used?

776


how to split string in java?

834


Why generics are used in java?

762


What are keyboard events?

820


How concurrent hashmap works?

846


Which of the following classes will have more memory allocated?

766


Write a function to print Fibonacci series and Tribonacci series?

932