Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
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]
It is sorta covered in the
JavaRanch Style Guide
subject: casting String into double
Setting Cell Editors in J(X)Table
Having problems with an arrays assignment
who can tell what is the method parseInt( )?
Question about Boxing
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014