java.lang.NoClassDefFoundError: numbertobinary/ShowBits
Im kinda new to Java so bare with me please
i got this error ^ and i dont understand why. here is part of the code, i took the unnessisary stuff out. I hope you can help
class ShowBits {
int numbits;
ShowBits(int n){
numbits = n;
}
void show(long val) {
long mask = 1;
//left shift a 1 into the proper position
}
}
// DEMO
class ShowBitsDemo {
public static void main(String args[]) {
ShowBits b = new ShowBits(8);
ShowBits i = new ShowBits(32);
ShowBits li= new ShowBits(64);
System.out.println("123 in binary: ");
b.show(123);
}
}
i been working on this for like 2 hours now and i realy dont want to waste any more time on it but what can i do.
thanks in advance
[809 byte] By [
Brad84ia] at [2007-11-27 2:23:41]

You got more code, but the error still comes up with the previous code, I sould add that im using NetBeans IDE
the error is: java.lang.NoClassDefFoundError: numbertobinary/ShowBits
Exception in thread "main"
__
class ShowBits {
int numbits;
ShowBits(int n){
numbits = n;
}
void show(long val) {
long mask = 1;
//left shift a 1 into the proper position
mask <<=numbits-1;
int spacer= 0;
for (;mask !=0; mask >>>= 1) {
if ((val & mask) !=0) System.out.println("1");
else System.out.println("0");
spacer++;
if ((spacer % 8) == 0) {
System.out.println(" ");
spacer =0;
}
}
System.out.println();
}
}
// DEMO
class ShowBitsDemo {
public static void main(String args[]) {
ShowBits b = new ShowBits(8);
ShowBits i = new ShowBits(32);
ShowBits li= new ShowBits(64);
System.out.println("123 in binary: ");
b.show(123);
}
}
Message was edited by:
Brad84i
null