Skip to content

Commit 4e2cfbe

Browse files
author
Ram swaroop
committed
content changes
1 parent 42743e8 commit 4e2cfbe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

_posts/2015-08-20-nested-classes.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ These are just "regular" inner classes which are not method-local, anonymous or
3535
Suppose you have an inner class like this:
3636

3737
{% highlight java linenos %}
38-
public class MyOuter {
38+
class MyOuter {
3939
class MyInner { }
4040
}
4141
{% endhighlight %}
@@ -67,7 +67,7 @@ only at runtime, when there's already an instance of the outer class to tie the
6767
Now with the basics done, let's see an inner class performing some actions:
6868

6969
{% highlight java linenos %}
70-
public class MyOuter {
70+
class MyOuter {
7171
private int x = 7;
7272

7373
// inner class definition
@@ -93,7 +93,7 @@ instance of the outer class__.
9393
#### Instantiating an Inner Class from Within the Outer Class
9494

9595
{% highlight java linenos %}
96-
public class MyOuter {
96+
class MyOuter {
9797
private int x = 7;
9898

9999
public void makeInner() {
@@ -152,7 +152,7 @@ since `this` always refers to the currently executing object. But when the inner
152152
to the outer class instance that the inner instance is tied to, it can access the outer class `this` like:
153153

154154
{% highlight java linenos %}
155-
public class MyOuter {
155+
class MyOuter {
156156
private int x = 7;
157157

158158
public void makeInner() {

0 commit comments

Comments
 (0)