what is the difference between static block and static
method

Answer Posted / ravikiran

static block is used to initialize the variables during the
JVM startup.
static methods are getting called with out creation of any
instance.

Is This Answer Correct ?    34 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What state is a thread in when it is executing?

705


Explain importance of inheritance in java?

759


What is comparable and comparator interface? List their differences

795


What’s the difference between unit, integration and functional testing?

807


What is namespace in java?

736






How do you write methodology?

721


What is a file pointer?

691


What does || mean in vectors?

676


What are disadvantages of java?

723


How do weakhashmap works?

818


What is the purpose of lambda expressions?

773


What is currentthread()?

743


What is jar?

811


Can we use string in switch case in java?

771


What is the properties class in java programming?

712