[795] in java-interest

home help back first fref pref prev next nref lref last post

Re: using acos

daemon@ATHENA.MIT.EDU (Gerald Brose)
Thu Jul 20 06:26:13 1995

Date: Thu, 20 Jul 95 11:21 MET DST
From: brose@inf.fu-berlin.de (Gerald Brose)
To: colinj@isc.anglia.ac.uk, java-interest@java.Eng.Sun.COM

> Hi,
> I am try to use this function from the java.lang.Math class
> In my code I reference it like this
> Import java.lang.Math;
> 
> Then call the function like this
> th2=acos(costh2);
> 
> However the compiler doe not like this
> errors below
> coltest1.java:47: Method acos(double) not found in class coltest1.
>            th2=acos(costh2);
> 
> 

You have to specify the target of the call even though you have imported Math. Call
"Math.acos(...)". That's because you don't *inherit* Math by importing it and therefore 
there's no method 'acos' in your class.

Regards, Gerald.
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post