How can I change existing string into double. I have code like this declared as string but in reality its getting number from the database.. I was doing sting to number conversion but now i dont wanna convert it as string and get it all the way as number
private String _example1;
_example1 = new String();
public String getExample1() {
return _example1;
}
public void setExample1(String s) {
_example1 = s;
}
so i just changed the String word with double in the above code..
private Double _example1;
_example1 = new Double();
public Double getExample1() {
return _example1;
}
public void setExample1(Double s) {
_example1 = s;
}
but i am getting this error
[exec] com\sample\jack\javabean\ExampleBean.java:48: cannot resolve symbol
[exec] symbol : constructor Double ()
[exec] location: class java.lang.Double
[exec] _example1 = new Double();
[exec] ^
[exec] com\sample\jack\javabean\ExampleBean.java:134: setExample1(java.lang.Double) in com.sample.jack.javabean.ExampleBean cannot be applied to (double)
[exec] this.setExample1(cstmt.getDouble(2));
[exec] ^
Can someone tell me what I have to do to get it right.. Thank you