Exception in thread "main" java.lang.NoClassDefFoundError
- by Manu
package pack;
public class sample{
public static void main(String input[])
{
NumberFormat numberFormat = new DecimalFormat("#,##0.00##");
System.out.println(numberFormat.format(44533125.00));
}
}
the code is working fine in the current dir.. (c:/myprogram/).
after that i copy the sample.class file and paste it in other dir(d:/myprogram).
i got error while running, like
" Exception in thread "main" java.lang.NoClassDefFoundError: sample (wrong name: pack/sample)"
In java .class file can run anywhere right? but why i am not able to run?