what is the difference between static block and static
method

Answer Posted / anu

static block is execute first after the remaining blocks will executes.
static metods can executes using classname.staicmethodname

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is it called a string?

768


What is formatted output in java?

735


What are the 3 types of loops in java?

746


What if I write static public void instead of public static void in java?

842


How do you compare two strings lexicographically?

741


What is matcher in java?

741


what is interface in java? Explain

744


What is finalize() function in java?

766


What do you know about the garbage collector in java?

833


What is empty list in java?

840


Define jit compiler?

858


Which of the classes will have more memory allocated?

751


Explain creating threads by extending thread class ?

784


What is == and === in javascript?

778


How can we make a class virtual?

854