We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c8b40f8 commit 45df1c9Copy full SHA for 45df1c9
1 file changed
_posts/2015-08-08-statics.md
@@ -58,14 +58,14 @@ class Frog {
58
59
### Some points to remember here
60
61
-* Static method __cannot access__ a instance(non-static) variable.
+* Static method __cannot access__ a instance(non-static) variable directly. They can access through a object reference.
62
{% highlight java %}
63
public static int getFrogSize() {
64
return frogSize; // compiler error
65
}
66
{% endhighlight %}
67
68
-* Static method __cannot access__ a instance method.
+* Static method __cannot access__ a instance method directly. They can access through a object reference.
69
70
public static int getFrogSizeSum() {
71
int size = getFrogSize(); // compiler error
@@ -131,4 +131,3 @@ class Bar extends Foo {
131
132
133
134
-
0 commit comments