What is non static block in java

Answer Posted / varun reddy

Non-static block is called anonymous block.the block of code which is return inside a non static block is executed on creation of object and before invoking clonstructor.
Syntax of non static block::::-------
{
statements;
}

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between sleep and wait in java?

502


Why java is call by value?

534


Is integer immutable in java?

536


What is module in project?

502


Explain the difference between abstract classes and interfaces in java?

584






Discuss about garbage collector in Java.

624


Write a program to print count of empty strings in java 8?

523


What is finalize() function in java?

543


What is protected in java?

512


Can java arraylist hold different types?

484


How does hashset works in java?

519


Does sprintf add a null terminator?

547


Does java allow overriding static methods ?

617


Can we use a switch statement with strings?

536


How do you remove all elements from an arraylist in java?

491