This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
when you declare an object final then it means that you can not change the reference to another object, but the objects state can be changed.
final Test o = new Test(); o= new Test(); //CANNOT BE DONE o.x=9; //CAN BE DONE
where public Test { int x =0; }
Also when you pass an argument to the method you pass a COPY OF THE REFERENCE.
so //main method excerpt Test a= new Test(); a.x=7; Test q =method(a); //Now q.x value is 45 and a.x is 45 //if b=null is uncommented then q will be null and a.x will be 45
static Test method (Test a) { Test b=a; b.x=45; //b=null; return b; }