Search Interview Questions | ![]() ![]() Click here and help us by providing the answer. ![]() Click Correct / Improve and please let us know. |
|
| ||||
Interview Questions and Answers | ||||
| ||||
Ans. Inner Class is a class that is nested within another class whereas sub class is a class that extends or inherit another class. Inner class can only be accessed using reference of outer class ( Class name , if inner class is static or object reference, if inner class is non static ) whereas Sub class is accessed directly. In terms of memory, inner class is stored just like another class having it's own body whereas sub class carries the body of parent class as well as it's own fields in memory. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
![]() | ||||
![]() a. Methods , Variables and Initialization Blocks. b. Methods , Variables , Initialization Blocks and Outer Classes and nested Classes. c. Methods , Variables , Initialization Blocks and Outer Classes. d. Methods , Variables , Initialization Blocks and nested Classes | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() public class OuterClass{ class InnerClass{ } } | ||||