Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

the parameter 'param' should not be assigned

807606Feb 13 2007 — edited Feb 13 2007
Hello

I have a warning on this code :
class ClassA {
...
   methodA () {
      ObjectA a = new ObjectA();
      methodB(a);
   }

   methodB (ObjectA pa) {
      pa = null;
   }
}
On the ligne "pa=null" the compiler say "the parameter pa should not be assigned" ... why ? ObjectA is not a primitive type !

Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 13 2007
Added on Feb 13 2007
3 comments
282 views