-6

I'm still a student and i started learning the java programming language newly,I just wanted to ask about how to convert an argument in the function main from a string to a double,just like converting a string to an integer with Integer.pasreInt(arg)

SpringLearner
  • 13,738
  • 20
  • 78
  • 116
  • 2
    Given you know how to convert a `String` to an `int`, I might be worth expanding that knowledge by taking a punt and looking at the JavaDoc for `Double` - http://docs.oracle.com/javase/6/docs/api/java/lang/Double.html – Nick Holt Dec 18 '13 at 09:15
  • Don't be scared to make mistakes, no harm in taking a shot in the dark and exchanging the types in that statement, pass a Double arg and crossing your fingers. – ChiefTwoPencils Dec 18 '13 at 09:27

1 Answers1

3

Double.valueOf(arg) or Double.parseDouble(arg)

jmj
  • 237,923
  • 42
  • 401
  • 438
Tim B
  • 40,716
  • 16
  • 83
  • 128