[Bluej-discuss] Compiler barfs when imported class not specifically named in method call

Gordon Royle gordon at csse.uwa.edu.au
Thu Oct 25 09:27:46 BST 2007


On 25/10/2007, at 3:37 PM, Hedley Finger wrote:

>
>
>          assertEquals(double[], double[], double);
>
> causes a compiler error but not with
>
>          AssertArray.assertEquals(double[], double[], double);
>

I don't know the classes you are talking about, but it would appear  
that "assertEquals(double[], double[], double)" is a static method  
(aka class method) and therefore must be called with the name of the  
class as its "target".

If you just use "assertEquals(...)" then the method would need to be  
a non-static method (aka instance method).


--
Associate Professor Gordon Royle
Department of Computer Science & Software Engineering
University of Western Australia
http://people.csse.uwa.edu.au/gordon







More information about the bluej-discuss mailing list