what is the difference between static block and static
method

Answer Posted / khasim

static block will be called at the time of loading the
class.it can be called once.developer can not be called
expecitly
static method will called at the time of loading the
class.here we can call expecitly by using there classname

Is This Answer Correct ?    16 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a newline character in java?

563


Explain about collection interface in java?

542


What is core java called?

522


How do you add an element to a hashset in java?

490


How do you initialize an arraylist in java?

509






can I implement my own start() method? : Java thread

548


What is the protected method modifier?

561


What is the use of list in java?

518


How can an exception be thrown manually by a programmer?

507


What are void pointers?

710


What are the common uses of "this" keyword in java ?

569


What is array in java?

533


What is the constructor?

577


What is object-oriented paradigm?

611


How to instantiate member inner class?

623