Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

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
Avatar of CPColin
CPColin
Flag of United States of America image

There's no difference; the two terms mean the same thing.
ASKER CERTIFIED SOLUTION
Avatar of dpearson
dpearson

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gudii9

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
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gudii9

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