what is the difference between static block and static
method

Answer Posted / uday

static block is called when we create an object for that class,so it automatically excutes......
for static methods, we can call this methods by class names not by object....

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Implement a stack with push (), pop() and min() in O(1) time.

721


What class allows you to read objects directly from a stream in java programming?

623


Tell us something about an iterator.

640


What are the methods to rectify ambiguities in the interfaces in JAVA?

709


Explain reverse a linked list recursive java solution?

647






What is the lifetime and scope of a variable?

635


How can we make string upper case or lower case?

689


How large is a boolean?

658


What do you understand by access specifiers in Java?

674


Why set is used in java?

664


Is it possible to instantiate the abstract class?

631


What is intern method in java?

686


What are class members by default?

749


Define jre i.e. Java runtime environment?

666


What is method overloading in java ?

645