what is the difference between static block and static
method

Answer Posted / uday

static block is called when we create an object for that class,so it automatically excutes......
for static methods, we can call this methods by class names not by object....

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is size_t?

742


What is ternary operator? Give an example.

819


What is comparable and comparator interface? List their differences

843


How do you create a sop?

741


How can you set the applet size?

828


Can you explain the private protected field modifier?

796


What is jvm? How its run?

881


Write a program to check for a prime number in java?

805


What is google full form?

771


What is bufferedwriter?

752


What are the data types supported by java? What is autoboxing and unboxing?

775


What is anti pattern in java?

741


What is the difference between superclass and subclass?

802


How do weakhashmap works?

859


What classes of exceptions may be caught by a catch clause in java programming?

950