About Question enthuware.ocajp.i.v7.2.957 :
Moderators: Site Manager, fjwalraven
-
- Posts: 16
- Joined: Wed Feb 25, 2015 8:52 pm
- Contact:
About Question enthuware.ocajp.i.v7.2.957 :
Why are someInt and changeIt accessed directly by main instead of TestClass.someInt and TestClass.changeIt. Is it because main is in the TestClass class? Because it is a static method ans static methods can directly access static variables and static methods?
-
- Site Admin
- Posts: 10389
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.957 :
Yes, static as well as instance methods of the same class can access other static methods and static variables without the need for writing the classname. Instance methods can access instance fields as well without any qualifier.
-
- Posts: 32
- Joined: Fri Oct 16, 2015 4:33 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.957 :
"an" is written twice


-
- Site Admin
- Posts: 10389
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.957 :
Fixed.
thank you for your feedback!
thank you for your feedback!
Who is online
Users browsing this forum: No registered users and 1 guest