Messed up!!!

+2 Albo Coder · November 7, 2014

Guys I think that is kind of the opposite. The program will say 1:02:03 because it assigns 4,5,6 to the local variables whish are defined in the function header. So it is the opposite of that.
If we use this it will make the program use the global variables(the ones defined as private). So it is kinda like the unary scope resolution in C++... Correct me if I am wrong please.

Post a Reply


Oldest  Newest  Rating
+1 Alex Sweps · November 7, 2014
Would this.bacon = bacon equal the instance variable?

public int bacon;

public void method1(int bacon){
          this.bacon = bacon;  //Would the instance variable get set to the variable being passed in?

Reason im asking is im sure thats the way it works as iv been doing it in game dev but your example differs slightly so im just curious if this is another way to use it. Also im not on my box with eclipse installed so I cant just test it myself :P
0 Alex Sweps · November 8, 2014
Yeah sweet, thats what I thought but started confusing myself :P
  • 1

Java / Android Development


Very popular language used to create desktop applications, website applets, and Android apps.

Bucky Roberts Administrator