找不到java是什么意思_JAVA中找不到符号是什么意思

classNolowerLetterextendsException{publicvoidprint(){System.out.printf("%c",'*');}}classNoDigitextendsException{publicvoidprint(){System.out.printf("%c",'*');}}classPeopl...

class NolowerLetter extends Exception{

public void print(){

System.out.printf("%c",'*');

}

}

class NoDigit extends Exception

{public void print(){

System.out.printf("%c",'*');

}

}

class People

{void printLetter(char c)throws NoLowerLetter{

if(c'z'){

NoLowerLetter noLowerLetter=new NoLowerLetter();

throw(noLowerLetter);

}

else{

System.out.print(c);

}

}

void printDigit(char c) throws NoDigit{

if(c'9'){

NoDigit noDigit=new NoDigit();

throw(noDigit);

}

else{

System.out.print(c);

}

}

}

public class ExceptionExample{

public static void main(String args[]){

People people=new People();

for(int i=0;i<128;i++){

try{people.printLetter((char)i);}

catch(NoLowerLetter e){e.print();}

}

for(int i=0;i<128;i++){

try{people.printDiGit((char)i);}

catch(NoDigit e){e.print();}

}

}

}

展开

表情包
插入表情
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
相关推荐
©️2020 CSDN 皮肤主题: 游动-白 设计师:白松林 返回首页