Posted 08 November 2012 - 11:07 PM
So i have started learning java at my school. For most people this is their first language but I already know C so my knowledge in that is helping but I think sometimes it is limiting as well. In C there is so many times where pointers are used but how would I do the same in java? I did some research but all I could find is that referencing is only used in passing objects between methods. I would like to change the value of 3 int variables initialized in method A but instead of making them global (which I've been told is bad programming) I would like to just pass their locations in memory so I can change the variables in method B. What would be the correct way of doing something like this in java?