Skip to content

Commit 45df1c9

Browse files
author
Ram swaroop
committed
statics : minor corrections
1 parent c8b40f8 commit 45df1c9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

_posts/2015-08-08-statics.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ class Frog {
5858

5959
### Some points to remember here
6060

61-
* Static method __cannot access__ a instance(non-static) variable.
61+
* Static method __cannot access__ a instance(non-static) variable directly. They can access through a object reference.
6262
{% highlight java %}
6363
public static int getFrogSize() {
6464
return frogSize; // compiler error
6565
}
6666
{% endhighlight %}
6767

68-
* Static method __cannot access__ a instance method.
68+
* Static method __cannot access__ a instance method directly. They can access through a object reference.
6969
{% highlight java %}
7070
public static int getFrogSizeSum() {
7171
int size = getFrogSize(); // compiler error
@@ -131,4 +131,3 @@ class Bar extends Foo {
131131
{% endhighlight %}
132132

133133

134-

0 commit comments

Comments
 (0)