[JAVA] string naar double met JDK1.1

Pagina: 1
Acties:

  • DeoDupke
  • Registratie: Maart 2002
  • Laatst online: 26-03-2024
op school gebruiken we JDK1.1 en die kent geen string.ToDouble of ParseDouble.

Hoe kan ik nou toch een string omzetten naar een double?
(typecasten werkt ook niet)
hij zegt gewoon can't convert string to double bij compileren

No worries m8


Verwijderd

Double(String)
Constructs a newly allocated Double object that represents the floating- point value of type double represented by the string.
komt uit http://java.sun.com/products/jdk/1.1/docs/api/java.lang.Double.html#_top_


En waarom gebruiken jullie nog 1.1?!
Da's wel e-x-t-r-e-e-m oud...

  • DeoDupke
  • Registratie: Maart 2002
  • Laatst online: 26-03-2024
Ik krijg

Method Double(java.lang.String) not found in JApplet1


getal = Double(textField1.getText()) ;
dit is toch de bedoeling of niet?

No worries m8


  • Dash2in1
  • Registratie: November 2001
  • Laatst online: 31-08 22:49
new

  • .oisyn
  • Registratie: September 2000
  • Laatst online: 12:35

.oisyn

Moderator Devschuur®

Demotivational Speaker

double getal = Double.valueOf (string).doubleValue ();

Give a man a game and he'll have fun for a day. Teach a man to make games and he'll never have fun again.