, Ranch Hand
Can anybody help me to sort this out please.
Object p=pList.getCap(); //either this
String 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.
Well, the question is, what does getCap() actually return? Is it a String? If so, look at the static parseDouble() method in the java.lang.Double class.
Space pants. Tiny ad:
The WEB SERVICES and JAX-RS Course
This thread has been viewed 607 times.
All times above are in ranch (not your local) time.
The current ranch time is
Mar 21, 2018 05:26:08.