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

Can static methods be inherited?

740


What is the difference between the font and fontmetrics classes in java programming?

675


What is Session reduplication and how its done?

1755


What are user defined exceptions?

780


What is constructor chaining and how is it achieved in java?

763






Can list be null in java?

748


Explain about interrupt() method of thread class ?

848


What is regex java?

776


What is static data type in java?

739


What is a local class in java?

766


What are the two types of streams offered by java 8?

677


Howto get an object that will perform date & time calculations then format it for output in some different locales with different date style.can ne1 tel me the answer of this question.pls

1645


What is java virtual machine and how it is considered in context of java’s platform independent feature?

830


How will you compute size of a structure?

771


What does java final mean?

700