answersLogoWhite

0


Best Answer

All of the Java number classes have a parse[type] method, like parseInt() in Integer or parseDouble() in Double that convert Strings to primitive numbers.

String s = getInput();

int var = Integer.parseInt(s);

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

10y ago

The easiest way to convert string numbers would be to use a Java tutorial that can be found on the Java official website. Information available on the internet suggests that the Java website offers 5 easy ways to convert a number of string.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Which is the best way to convert numbers in string under java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering
Related questions

What is the best way to trap a gorilla?

Take a stick put it under a cardboard box holding the box up tie a string on the stick hide behind a tree and put a banana under the box then when he is under it pull the string and you got your gorilla


What is the best brand of string lights?

Smith & Hawken has the best string lights. You can find them at target.


What is the best string used to make bracelets?

elastic (a stretchy string)


What are the Best quality and sounding brand 6 string acoustic guitars for under 250.00?

you wont get a completely fabulous guitar for under $250, but i would recomend that you try ibanez guitars.


Is it best to start a child off on string or brass instruments?

It is best to start a child off on a string instrument. Stings are harder to play than brass instruments so, mastering a string early is the best bet.


How do you tell a vintage book or first edition?

There are several ways to tell if a book is vintage or first edition. The best way is to look at the string of numbers on the copyright page. If the sequence of numbers contains a 1, it is likely a first edition.


What rhymes with harpist that is best string plucker?

One suspects a mischievous reason for this question, but no matter. The harpist is the best string plucker, The chicken is the best clucker.


What is 36 times 10 to the 3 power plus 15 times 10 to the 2 power?

It's best to convert those numbers from scientific notation to normal notation; that makes it easy to add them. After adding them, you can convert back to scientific notation if you want. Another option is to keep the numbers in scientific notation, but to convert them so that both have the same exponent.


What is the best string for tennis?

There is no 'best string'. Even professionals use different strings because different strings suit different needs.


What is the longest factor string for 312?

The longest factor string is 2x2x2x3x13. It is always best to list your factor string from the least to greatest number.


What is the best type of thong?

G STRING!


Who has the best factory bow string?

Bowtech.