Olly
Originally posted by ankur rathi:
You should have got a compile time error because of this.![]()
Originally posted by ankur rathi:
Opps... You got compile time error only. The error confused me.![]()
It should be:
found: java.lang.Double
expected or required: double
![]()
Joanne
Originally posted by Joanne Neal:
The compiler parsed the left hand side of the statement first and found a Double, therefore it expects the right hand side of the statement to also be a Double, but it's not - it's a double. Therefore the error is correct, it was expecting a Double but found a double.
Originally posted by Joanne Neal:
The compiler parsed the left hand side of the statement first and found a Double, therefore it expects the right hand side of the statement to also be a Double, but it's not - it's a double. Therefore the error is correct, it was expecting a Double but found a double.
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Originally posted by Raghavan Muthu:
It is wrong! The assignment always happens from Right to Left
Joanne
Originally posted by Andre Brito:
[QB]But when I'm expecting Double, I can get an double, right?
An the inverse is correct: if I have an pimitive variable double, I can get an object Double, without casting.
So, I don't understand why the topic's creator go wrong.
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Originally posted by Joanne Neal:
That's right, but I never mentioned assignment. I was talking about compiler parsing and because the compiler parsed the left hand side of the statement first and found a Double, it then expected to find a Double on the right hand side. It's the right hand side of the statement that the compiler is complaining about.
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Olly
Olly
Originally posted by Olivier Legat:
...I just want to input a number with decimal points (gods knows whether that's a double or a Double) using a BufferedReader, how do I do that?
I've tried doing this but I get a data type error:
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Olly
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Originally posted by Olivier Legat:
..When I want to you a "try" and "catch" it keeps jumping to the error message.
Do I have to get rid of the "try" and put 'throws IOException' next to the method instead?That's my last opinion but it seems really unprofessional
![]()
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Originally posted by Raghavan Muthu:
No need. Either way should be fine. Try with the code what you have posted first. It should work fine!![]()
Olly
Originally posted by Balasubramanian Chandrasekaran:
.. i think oliver should have executed the piece of code which he posted here from some IDE.
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Originally posted by Olivier Legat:
...(snip)...
Could someone just tell me what to write to input "x", it would be very much appreciated.
...(snip)...
"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."
"I'm not back." - Bill Harding, Twister
"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."
Hey cool! They got a blimp! But I have a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|