Jag har problem med "Math"-klassen i Java (1.3.1)
Jag har provat ett litet testprogram som borde funka alldeles utmärkt:
----------------------------------------
public class RandomMax
{
RandomMax()
{
double random1, random2;
random1 = Math.random();
random2 = Math.random();
System.out.println("");
System.out.println("The numbers are: " + random1 + " and " + random2);
System.out.println("Max is " + Math.max(random1, random2));
System.out.println("");
}
public static void main(String[] args)
{
new RandomMax();
}
}
----------------------------------------
Men jag får följande fel:
RandomMax.java:11: cannot resolve symbol
symbol : method random ()
location: class Math
random1 = Math.random();
^
RandomMax.java:12: cannot resolve symbol
symbol : method random ()
location: class Math
random2 = Math.random();
^
RandomMax.java:16: cannot resolve symbol
symbol : method max (double,double)
location: class Math
System.out.println("Max is " + Math.max(random1, random2));
^
3 errors
----------------------------------------
1. Vad betyder exakt "cannot resolve symbol"
2. Vad är fel???