A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Refactoring for Software Design Smells: Managing Technical Debt
this week in the
OO, Patterns, UML and Refactoring
casting String into double
Joined: Jan 10, 2007
Aug 08, 2007 16:09:00
Can anybody help me to sort this out please.
Object p=pList.getCap(); //either this
s=pList.getCap(); //or this
//here I need to cast the Object or String (any will do) into double
//to send it as an argument to coldDrinks(int, double) method
Thanks in advance.
author and iconoclast
Joined: Jul 08, 2003
Aug 08, 2007 16:38:00
Well, the question is, what does getCap() actually return? Is it a String? If so, look at the static parseDouble() method in the
[Jess in Action]
Have you checked out
subject: casting String into double
Question about Boxing
who can tell what is the method parseInt( )?
Setting Cell Editors in J(X)Table
Having problems with an arrays assignment
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015