illigal start of type error (java).
Posted
by David
on Stack Overflow
See other posts from Stack Overflow
or by David
Published on 2010-03-15T16:34:56Z
Indexed on
2010/03/15
16:39 UTC
Read the original article
Hit count: 155
here is the relevent code snippet:
public static Rand searchCount (int[] x)
{
int a ;
int b ;
int c ;
int d ;
int f ;
int g ;
int h ;
int i ;
int j ;
Rand countA = new Rand () ;
for (int l= 0; l<x.length; l++)
{
if (x[l] = 0)
a++ ;
else if (x[l] = 1)
b++ ;
}
}
return countA ;
}
(Rand is the name of the class that this method is in)
when compiling it get this error message:
Rand.java:77: illegal start of type
return countA ;
^
what's going wrong here? what does this error message mean?
© Stack Overflow or respective owner