Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cast problem 1

Status
Not open for further replies.

tyris

Programmer
Nov 2, 2000
311
FR
an other problem like the other one :

myRespObj.budget is a java.lang.Float

rs.getFloat("ChgeRate") is a float.

what can i do to make an "=" between them ?

i tryed
myRespObj.budget = (Float)rs.getFloat("ChgeRate")
but the result is : "cannot convert from float to java.lang.Float"


Best regards X-),
Elise
 
Elise,
since u r trying to make a conversion between an object and a primitive type, u cannot cast it.therefore, u need to do
myRespObj.budget = new Float(rs.getFloat("ChgeRate"));
this would remove ur problem.

regards,
db

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top