±Û¾´ÀÌ :Aaron Myung 1998³â 9¿ù 13ÀÏ 09:27:42
Java 1.2 in 21daysÃ¥À» »ç¼ °øºÎÇϱ⠽ÃÀãÇß½À´Ï´Ù¸¸...
class Jabberwock {
String color;
String sex;
boolean hungry;
void feedJabberwock() {
if (hungry == true) {
System.out.println("Yum -- a peasent!.");
hungry = false;
} else
System.out.println("No, thanks -- already ate.");
}
void showAttributes() {
System.out.println("This is a " + sex + " " + color + " jabberwock.");
if (hungry == true)
System.out.println("The jabberwock is hungry.");
else
System.out.println("The jabberwock is full.");
}
public static void main (String argument[]) {
Jabberwock j = new Jabberwock();
j.color = "orange";
j.sex = "male";
j.hungry = true;
System.out.println("Calling showAttributes.");
j.showAttributes ();
System.out.println("-----");
System.out.println("Feeding the Jabberwock.");
j.feedJabberwock ();
System.out.println("-----");
System.out.println("Calling showAttributes.");
j.showAttributes ();
System.out.println("----");
System.out.println("Feeding the jabberwock.");
j.feedJabberwock ();
j.feedJabberwock ();
}
}
À§ÀÇ ³»¿ëó·³ Á¦»ý°¢¿£ Ã¥ÇÏ°í ¶È°°ÀÌ Å¸ÀÔÇÑ°Í°°Àºµ¥ µµ½º»ó¿¡¼java Jabberwock À̶ó°í ŸÀÔÇصµ(Ã¥¿¡¼ ¸»ÇÑ°Íó·³)
Exception in thread"main" java.lang.NoClassDefFoundError:Jabberwock
À̶ó´Â ¸ä¼¼Áö°¡ ³ª¿Í...
¼³¸íÁ»ÇØÁÖ¼¼¿ä...±×¸®°í ÇØ°á¹æ¹ýµµ...
°í¸¿½À´Ï´Ù.