Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

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!

How to change value of Integer object ?

843844Mar 2 2008 — edited Mar 2 2008
I wrote a program:
public class Tester{
	public static void changeValue( Integer a, int b ){
		a.valueOf(b);
	}
	
	public static void main( String[] args ){
		Integer a = new Integer(15);
		Tester.changeValue(a, 20);
		System.out.println(a); // It will print to screen the value 15, but i want it is 20.
	}
}
Can you help me?????
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 30 2008
Added on Mar 2 2008
3 comments
1,477 views