Help pls :Exception in thread "main" java.lang.NumberFormatException:
Hi,
The Double.parseDouble method does not seem to be working and I keep getting this error msg...can someone pls tell me what i'm doing wrong....
Exception in thread "main" java.lang.NumberFormatException: For input string: "0.0113974371229202620.06577017114914425 0.88952095260741530.93902610142076840.00.15490196078431373"
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1224)
at java.lang.Double.parseDouble(Double.java:482)
at data.newLineToRead(data.java:16)
at data.data(data.java:34)
at train.main(train.java:86)
Thanks a lot
import java.io.*;
import java.util.*;
publicclass data{
privatestatic parameter par;
privatestaticdouble[][] x=newdouble[par.n()][par.D()];
publicstaticdouble[] t=newdouble[par.n()];
publicstaticvoid newLineToRead(String LineToRead,int n){
int d=0;
//System.out.println(LineToRead);
for(int i=0;i<=LineToRead.length();i++){
StringTokenizer str =new StringTokenizer (LineToRead,"/t");
while (str.hasMoreTokens()){
x[n][d++] = Double.parseDouble(str.nextToken());
d++;
}
LineToRead="";
}
t[n]=Double.parseDouble(LineToRead);
x[n][par.d()]=1.0;
}
publicstaticvoid data()throws IOException{
DataInputStream in=null;
try{
in=new DataInputStream(new FileInputStream(par.f()));
for(int n=0;n<par.n();n++){
String LineToRead=in.readLine();
if(LineToRead.length()==0){
System.out.println("Remove empty lines");
}
else{
newLineToRead(LineToRead,n);
}
}
}finally{if(in!=null){in.close();}}
}
publicstaticdouble x(int n,int d){return x[n][d];}
publicstaticdouble
>

