new Double(object.toString());

But it seems weird to me that you're going from an Object to a Double. You should have a better idea what class of object you're starting with before attempting a conversion. You might have a bit of a code quality problem there.

Note that this is a conversion, not casting.

Answer from RichW on Stack Overflow
🌐
RoseIndia
roseindia.net › java › java-conversion › ObjectToDouble.shtml
Convert Object to Double
The given program helps you in converting an object type data into a double. An object contains a data 10. Firstly, we convert into a string format then we pass into the valueOf() method. And we follow similar process to double conversion.
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › lang › Double.html
Double (Java Platform SE 8 )
July 21, 2026 - Java™ Platform Standard Ed. 8 ... The Double class wraps a value of the primitive type double in an object. An object of type Double contains a single field whose type is double. In addition, this class provides several methods for converting a double to a String and a String to a double, as well as other constants and methods useful when dealing with a double.
🌐
Coderanch
coderanch.com › t › 466311 › java › converting-object-double
converting object[] to double? (Beginning Java forum at Coderanch)
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums · this forum made possible by our volunteer staff, including ... ... Dear, I have a method called (getContentObject) which returns me an Object[]. I have a piece of code like this: result = (Object[]) reply.getContentObject(); double price = Double.parseDouble((String)result[2]); actually in the last line I've tried to convert object to double but I cant.
🌐
Tutorialspoint
tutorialspoint.com › java › lang › java_lang_double.htm
Java - Double class
Python TechnologiesDatabasesComputer ... QualityManagement Tutorials View All Categories ... The Java Double class wraps a value of primitive type double in an object....
🌐
Oracle
docs.oracle.com › javase › 7 › docs › api › java › lang › Double.html
Double (Java Platform SE 7 )
Java™ Platform Standard Ed. 7 ... The Double class wraps a value of the primitive type double in an object. An object of type Double contains a single field whose type is double. In addition, this class provides several methods for converting a double to a String and a String to a double, as well as other constants and methods useful when dealing with a double.
Find elsewhere
🌐
Quora
quora.com › How-do-I-convert-Object-to-double-in-Java
How to convert Object to double in Java - Quora
Answer (1 of 5): No one has touched on this yet, so I will: Stop using collections of [code ]Object[/code] to store dissimilar types. The reasons you’re facing this problem is you’re fighting against your tools. Collections are typed so that you always know for sure what they contain.
🌐
Java67
java67.com › 2015 › 06 › how-to-convert-string-to-double-java-example.html
How to convert String to Double in Java and double to String with Example | Java67
There are three ways to convert a String to double value in Java, Double.parseDouble() method, Double.valueOf() method and by using new Double() constructor and then storing the resulting object into a primitive double field, autoboxing in Java ...
🌐
Oracle
docs.oracle.com › en › java › javase › 25 › docs › api › java.base › java › lang › Double.html
Double (Java SE 25 & JDK 25)
July 21, 2026 - The Double class is the wrapper class for values of the primitive type double. An object of type Double contains a single field whose type is double. In addition, this class provides several methods for converting a double to a String and a String to a double, as well as other constants and ...
🌐
Oracle
docs.oracle.com › en › java › javase › 22 › docs › api › java.base › java › lang › Double.html
Double (Java SE 22 & JDK 22)
July 16, 2024 - The Double class wraps a value of the primitive type double in an object. An object of type Double contains a single field whose type is double. In addition, this class provides several methods for converting a double to a String and a String to a double, as well as other constants and methods useful when dealing with a double.
🌐
Oracle
docs.oracle.com › en › java › javase › 27 › docs › api › java.base › java › lang › Double.html
Double (Java SE 27 & JDK 27)
September 14, 2026 - The Double class is the wrapper class for values of the primitive type double. An object of type Double contains a single field whose type is double. In addition, this class provides several methods for converting a double to a String and a String to a double, as well as other constants and ...
🌐
Oracle
docs.oracle.com › javase › 6 › docs › api › java › lang › Double.html
Double (Java Platform SE 6)
Otherwise, s is regarded as representing an exact decimal value in the usual "computerized scientific notation" or as an exact hexadecimal value; this exact numerical value is then conceptually converted to an "infinitely precise" binary value that is then rounded to type double by the usual round-to-nearest rule of IEEE 754 floating-point arithmetic, which includes preserving the sign of a zero value. Finally, a Double object representing this double value is returned.
🌐
Oracle
docs.oracle.com › en › java › javase › 17 › docs › api › java.base › java › lang › Double.html
Double (Java SE 17 & JDK 17)
April 21, 2026 - The Double class wraps a value of the primitive type double in an object. An object of type Double contains a single field whose type is double. In addition, this class provides several methods for converting a double to a String and a String to a double, as well as other constants and methods useful when dealing with a double.
🌐
Java Tutorial HQ
javatutorialhq.com › java tutorial › java.lang › double
Java Double Class Tutorial and Example
September 30, 2019 - An object of type Double contains a single field whose type is double. In addition, this class provides several methods for converting a double to a String and a String to a double, as well as other constants and methods useful when dealing with a double. public final class Double extends Number ...
🌐
Oracle
docs.oracle.com › en › java › javase › 24 › docs › api › java.base › java › lang › Double.html
Double (Java SE 24 & JDK 24)
July 15, 2025 - The Double class is the wrapper class for values of the primitive type double. An object of type Double contains a single field whose type is double. In addition, this class provides several methods for converting a double to a String and a String to a double, as well as other constants and ...