gudii9
asked on
nested class vs inner class
Hi,
What are differenced between nested class vs inner class. when and how and where we use each one. please advise
What are differenced between nested class vs inner class. when and how and where we use each one. please advise
There's no difference; the two terms mean the same thing.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
To me "nested class" can mean either "static class" or "inner class".
so inner class means non static one right which is one kind of nested class right ? ( while static lass is other kind right?)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
To me "nested class" can mean either "static class" or "inner class".
So like this:
public class Outer {
public static class StaticNested { } // Note: "static" keyword here. This is a static nested class.
}
public class Outer {
public class Inner { } // Can also be considered a non-static nested class
}
above is clear