Results 1 to 7 of 7
Thread: New to Java
- 02-29-2012, 07:55 PM #1
Member
- Join Date
- Feb 2012
- Posts
- 11
- Rep Power
- 0
New to Java
Hello everyone, I'm starting to learn Java (only had 1 class till now but I already got some programs to work on) so bare with me.
My question is :
long i =Integer.parseInt(args[0]);
When I have this,
1. What does long mean ?
2. What's the whole Integer.parseInt(args[0]) part for ?
When I compile the program, I gotta write it like this {"5"} or else it won't work.
I have a function apart that does the factorial of a number so that's what the program is about.
Any help ?
Cheers!
- 02-29-2012, 08:22 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
Re: New to Java
A long is like an int but it takes eight bytes so it can store much larger numbers. That args[0] mumbo jumbo converts a String (the first command line argument args[0]) to an int. You'll learn all about it in the next lessons.
kid regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 02-29-2012, 08:28 PM #3
Member
- Join Date
- Feb 2012
- Posts
- 11
- Rep Power
- 0
Re: New to Java
Thanks Jos.
I've understood the long part.
About the args[0] what will it convert to an int in this case ?
What's the purpose of using it in this case ?
Cheers!
- 02-29-2012, 08:33 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
- 02-29-2012, 08:38 PM #5
Member
- Join Date
- Feb 2012
- Posts
- 11
- Rep Power
- 0
- 02-29-2012, 08:44 PM #6
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
Re: New to Java
When people rob a bank they get a penalty; when banks rob people they get a bonus.
- 02-29-2012, 08:47 PM #7
Member
- Join Date
- Feb 2012
- Posts
- 11
- Rep Power
- 0


1Likes
LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks