@Wietlol Back to actual questions. So what's the difference between all these things. In other languages I usually just use function foobar() { //code }
private is "do not touch this, this is a dangerous method and only I know how to call it... next to which, I will not guarantee that if you call this code, your code will remain working because I will change this every update"
in PHP, you cant upgrade libraries or the language
because it will most likely break everything
in Java, we dont have this issue
because we make our public methods the way they should work and private methods are our own
Notice how copying arrays is different. int [] x = {1,2,3}; int [] y = {4,5,6}; y = x; //x and y now both refer to the same array, {1,2,3} x[0] = 9; this changes the first number of the array to 9. {9,2,3}
@moocow Welcome to the Java Chat, the room for Java enthusiasts! Please use a code snippet tool when posting code snippets. If you have an Android question, you're in the wrong place! And remember: this is not tech support! Thanks for visiting and have fun! :D