What is non static block in java

Answer Posted / avneet singh bhatia

Any method which is not the part of main function or not be
declared with any static keyword is non static block in java

For example:

class Abc
{
void show()//non static method
{
System.out.println("non static block");
}
static
{
S.O.P("static");
}
}

Is This Answer Correct ?    8 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain spliterator in java8?

779


give an example for encapsulation?

764


worst case complexities of Quick sort and Merge sort.

782


Which class cannot be a subclass in java?

712


Describe what happens when an object is created in java ?

756


What does jre stand for?

800


State the difference between creating string as new () and literal.

713


What is the difference between checked exception and unchecked exception?

763


What is boolean keyword in java?

859


What are keywords and reserved words in java?

772


Define an abstract class with reference to java.

757


Which method you will use to create a new file to store some log data. Each time a new log entry is necessary, write string to the file in java ?

901


What is java developer skills?

726


What is a final class ?

808


What is the purpose of finalization in java programming?

777