Quantcast
Channel: User Federico klez Culloca - Stack Overflow
Viewing all articles
Browse latest Browse all 502

Answer by Federico klez Culloca for Why is the double colon operator needed in Java?

$
0
0

Because variables and methods do not share the same namespace in Java, so you can have variables and methods with the same name.

This is valid in Java:

class Test {    private static int c;    private static int c() { return 0; }}

Now what would Test.c refer to here if we didn't have the :: operator?


Viewing all articles
Browse latest Browse all 502

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>