Re: operator * cannot be applied
From: George Hester (hesterloli_at_hotmail.com)
Date: 04/04/04
- Next message: George Hester: "Java doesn't work right here?"
- Previous message: Knute Johnson: "Re: How to trace an OutOfMemoryError?"
- In reply to: Chris Smith: "Re: operator * cannot be applied"
- Next in thread: Mark Haase: "Re: operator * cannot be applied"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 04 Apr 2004 19:06:05 GMT
Thanks Chris. Actually I knew that. I used "Cast" to see if anyone would clarify it for me. I knew I used the expression incorrectly but I didn't know why. Thanks again.
George Hester
__________________________________
"Chris Smith" wrote in message news:MPG.1ad85d78e3424af69899c6@news.pop4.net...
> George Hester wrote:
> > NumberFormat nf = NumberFormat.getInstance();
> > double poundValue = nf.parse(amount).doubleValue();
> > String rate = getInitParameter("RATE");
> > double dblrate = nf.parse(rate).doubleValue();
> > poundValue *= dblrate;
> >
> > That casted the string rate to a double dblrate.
>
> Just to be picky about terminology; that did not cast the String to a
> double. Casting a String to a double is, in fact, impossible and always
> results in a compiler error. What it did was convert a String to a
> double.
>
> The word "cast" -- at least in Java, and in a number of other languages
> -- refers to a specific piece of language syntax -- namely:
>
> ( type ) expr
>
> Hopefully, that will save you some confusion in the future.
>
> --
> www.designacourse.com
> The Easiest Way to Train Anyone... Anywhere.
>
> Chris Smith - Lead Software Developer/Technical Trainer
> MindIQ Corporation
- Next message: George Hester: "Java doesn't work right here?"
- Previous message: Knute Johnson: "Re: How to trace an OutOfMemoryError?"
- In reply to: Chris Smith: "Re: operator * cannot be applied"
- Next in thread: Mark Haase: "Re: operator * cannot be applied"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|