eclipse - program won't compile java.lang.ClassNotFoundException -
hi guys total newbie. please me.
the program is:
import java.util.scanner.*; import java.lang.*; public class hextodecimalfromweb{ public static void main (string [] args) { scanner input = new scanner(system.in); printheader(); while (true) { string hex = input.next("enter hexadecimal number: "); int dec = integer.parseint(hex, 16); if (dec == sentinel) { break; } system.out.println(hex + " hex = " + integer.tostring(dec)+ "decimal"); } } private static void printheader() { system.out.println("this program converts hexadecimal decimal."); system.out. println("enter 0 stop."); } private static final int sentinel = 0; }
the error this:
java.lang.noclassdeffounderror: hextodecimalfromweb caused by: java.lang.classnotfoundexception: hextodecimalfromweb @ java.net.urlclassloader$1.run(urlclassloader.java:202)
what reason that?
i think may issue eclipse other programs won't run either.
this line broken:
integer.tostring(dec)+decimal");
add " ->
integer.tostring(dec)+"decimal");
Comments
Post a Comment