What is non static block in java

Answer Posted / mohan

In between {....}whatever u can write that consider as
Instance block or Non static block.

Ex:
class hai{

//Instance block
{
System.out.println("hi i'm Instance block....");
}

//Static block
static{
System.out.println("hi i'm Static block....");
}

}

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is boolean false?

511


What is the meaning of variable in research?

545


Can a abstract class be defined without any abstract methods?

543


What is a heavyweight component?

530


What is the purpose of a volatile variable?

541






How do you reverse a string in java?

568


what is instanceof operator used in java?

577


I want to persist data of objects for later use. What’s the best approach to do so?

490


What is the difference between class & object?

547


Why lambda expression is used in java?

555


What is thread start?

506


What is the syntax and characteristics of a lambda expression? Explain

529


What is palindrome in java?

543


Why string is not thread safe?

521


What is the protected method modifier?

553