Search Interview Questions
| More than 3000 questions in repository.|
There are more than 900 unanswered questions.
Click here and help us by providing the answer.
Have a video suggestion.
Click Correct / Improve and please let us know.
|Interview Questions and Answers|
|Ans. In first case we are trying to initialize Inner class object using the instance of Outer Class whereas in second case we are trying to initialize the Inner class object directly using the Outer class name.|
In second case , Inner class is "static inner class" as we cannot access "non static inner class" using Classname alone.
In first case, the inner class could be either "static inner class" or "non static inner class".
|Help us improve. Please let us know the company, where you were asked this question :|
|Like Discuss Correct / Improve  inner classes  inner class   static inner class   new operator|
|Why do we need Inner classes ? Cant we just work with outer classes wherever we implement Inner classes ?|
|What are the different types of inner classes ?|
|What is the difference between inner class and sub class ?|
|Which access specifier can be used with Class ?|
|Difference between nested and inner classes ?|
|Which of the following cannot be marked static ?|
|Explain use of nested or inner classes ?|
|What is the benefit of inner / nested classes ?|
|Explain Static nested Classes ?|