Question about syntax in "new BigInteger" (Java)?
-
Alright well I just have a question about what part of the code the 10 after the comma in the following line signifies: new BigInteger("1", 10); Like in strings you have two sections, the text and then the input for the variables such as %d %f... Obviously the 10 means something, I just don't know what. Full code: import java.math.BigInteger; class biginteger { public static void main( String[] args ){ int n,a; BigInteger nuke,factorial; System.out.printf("Enter the integer.\n"); try { InputStreamReader input = new InputStreamReader(System.in); BufferedReader reader = new BufferedReader(input); n = Integer.parseInt(reader.readLine()); factorial = new BigInteger("1", 10); for (a=1; a<=n; a++) { nuke = new BigInteger("" + a + "", 10); factorial = factorial.multiply(nuke); } System.out.println("The factorial of " + n + " is:\n"); System.out.println(factorial); } catch ( Exception e ) {} } }
-
Answer:
The radix is the base (10) - the decimal number system.
cid at Yahoo! Answers Visit the source
Other answers
Bookmark this link: http://java.sun.com/j2se/1.5.0/docs/api/index.html Or, look up the 1.6 page, and bookmark that. All questions of this nature can be answered on the Sun Java Documentation pages.
Try this link. It is the doc for using " new BigInteger("1", 10); " http://java.sun.com/javase/6/docs/api/java/math/BigInteger.html#BigInteger(java.lang.String,%20int) or http://java.sun.com/javase/6/docs/api/java/math/BigInteger.html#constructor_summary or http://java.sun.com/javase/6/docs/api/java/math/BigInteger.html or http://java.sun.com/javase/6/docs/api/ ------------- Book mark this page. http://java.sun.com/javase/6/docs/api/ This will help and solve most of your issues related to Java.
Related Q & A:
- How to Implement Gateway Service something similar to Oracle API gateway Using Java and Java based Open Source frameworks only?Best solution by Quora
- how to create a new syntax in java?Best solution by Stack Overflow
- How do i correct syntax error?Best solution by Yahoo! Answers
- New msn plus live question?Best solution by Yahoo! Answers
- How to correct syntax error in Yahoo mail page?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.