baldy1324
October 2nd, 2006, 09:19 PM
i am writing a program in java to do the fibonacci sequence.
here is the code:class main
{
public static void main(String[] args)
{
int n = 350;
double first = 0;
double second = 1;
System.out.print(first);
System.out.print(" ");
System.out.print(second);
System.out.print(" ");
while (n>0)
{
double third = first + second;
first = second;
second = third;
System.out.print(third);
System.out.print(" ");
n--;
}
}
}
when i compile it with javac there are no errors
when i run java to run/interpert it it gives the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: main/class
any ideas?
here is the code:class main
{
public static void main(String[] args)
{
int n = 350;
double first = 0;
double second = 1;
System.out.print(first);
System.out.print(" ");
System.out.print(second);
System.out.print(" ");
while (n>0)
{
double third = first + second;
first = second;
second = third;
System.out.print(third);
System.out.print(" ");
n--;
}
}
}
when i compile it with javac there are no errors
when i run java to run/interpert it it gives the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: main/class
any ideas?