What is the purpose of nested class in java?



What is the purpose of nested class in java?..

Answer / Naina Gupta

Nested classes are used to group related classes together. They can be either static or non-static (inner). Static nested classes are also known as 'static member classes'. Inner classes, on the other hand, are associated with an instance of the outer class and have access to its private members.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

Can we catch more than one exception in single catch block?

1 Answers  


What modifiers are used for interface declaration?

7 Answers  


What is replaceall in java?

1 Answers  


Why should we use singleton pattern instead of static class?

1 Answers  


What is JVM and is it platform independent?

1 Answers  


What is the differnence between String Buffer and String builder despite having knowledge that String builder is faster than String Buffer and last one is threadsafe.please tell another important difference.

3 Answers   IBM,


take an array with -ve and +ve value both.find out the nearest value of 0(zero).if two values are same like(-2 and +2)then extract +2 is nearest of 0(zero).

1 Answers  


What are File and RandomAccessFile classes?

2 Answers  


Explain garbage collection in java?

1 Answers  


Program to find greatest prime number in n numbers?

3 Answers   Huawei,


What is main string [] args?

1 Answers  


what is inner class?

6 Answers   HCL,


Categories