what is the difference between static block and static
method
Answer Posted / himanshu kumar upadhyay
Static block is executed when the class which contain static
block is loaded in to memory and static method is executed
when it is called. Mostly static block is used for
Initialization of static members.
Is This Answer Correct ? | 17 Yes | 2 No |
Post New Answer View All Answers
Can we pass a primitive type by reference in java? How
Is c better than java?
Is map sorted in java?
Can we use synchronized block for primitives?
What are the 2 types of java programs?
What is contractor means and methods?
How can you add and remove nodes in jtree?
How many types of gc are there in java?
What is difference between adapter class and listener?
What is the flag in java?
Is char a data type in java?
Differentiate between class and structure.
What does the append?
How does a for loop work?
What is difference between filereader and bufferedreader?