Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie error

Status
Not open for further replies.

chals1

Technical User
Sep 3, 2003
73
0
0
ES
There is an error on my first java program.Something like:
" 58: illegal start of expression... "
that refers to next piece of code:

public double getMódulo() {
double mod = Math.sqrt(Math.pow(a,2)+Math.pow(b,2));
return mod;
}

Regards
 
"illegal start of expression..."
hmm.. big possibility that you have error in your syntax. Check all your code (line by line :D) happy debugging!

BTW, you are not trying to simply write:
public double getModulo() {
/* rest of this method's code */
}

and then compile it, without putting it in a class right?
If you do, then I think you should learn more about OOP in Java :p


Irfin
 
You probably didn't end the function before it. Like this:

public class Modulo {
public void test() {
// missing }

public double getMódulo(int a, int b) {
double mod = Math.sqrt(Math.pow(a,2)+Math.pow(b,2));
return mod;
}
}

Sean McEligot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top