manish ghildiyal wrote:Hi Arjun,
What I mean to say is that variable a which you pass as argument (to modify method)
in main method is copied when modfiy method is invoked...so variable which is actually modified inside modify method is not the variable a of main method, its just
a copy of it...so inside modify method you are not incrementing variable a of main method but rather a copy of it which is local to modiy method.
So variable a of main method reamains unincremented.
Manish
manish ghildiyal wrote:..additionally
in your first case you are passing a primitive and not a reference...so when copying of
argument happens then you get two different entities which are in no way connected.So
modifying one doesn't impact other in any way.
Manish
Maneesh Godbole wrote:
Arjun Narsipur wrote:
How do I know which of the key words ought ot be in caps and which in small?
All java keywords are lower case.
By convention, class names should be capitalized. Check out http://www.oracle.com/technetwork/java/codeconv-138413.html
I believe, modern text editors like JEdit (also) have the ability to colorize these to provide you visual clues. (e.g. the keyword "private" shows up in red color) IDEs such as Eclipse certainly do.
Ivan Jozsef Balazs wrote:Java is case sensitive: public != Public.