|
-
Apr 2nd, 2009, 02:09 PM
#1
Thread Starter
New Member
2 integers
Hey i have a quick JAVA question about integers.
Code:
int blaat = 12;
int number = blaat + blaat;
The result i need is 1212 but ofcourse it gives 24. How do i get the 1212 result ?
Greetings,
Frax
-
Apr 2nd, 2009, 02:29 PM
#2
Re: 2 integers
You'll need to convert it to a string first, and then I guess since you want an int value, you will need to convert it back to an integer.
Look into parseInt and toString
-
Jul 2nd, 2009, 04:12 PM
#3
Member
Re: 2 integers
java Code:
int a = 12; //12 int b = Integer.parseInt(Integer.toString(a) + Integer.toString(a)); //1212
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|