坐等答案,這個(gè)類(lèi)有什么問(wèn)題??
有人在線嗎??
package base;
import java.util.InputMismatchException;
import java.util.Scanner;
public class clerkNew {
?String [] clerk01=new String [9];//定義一個(gè)數(shù)組clerk00,用于存放某個(gè)職員信息
?String [] clerk00={"序號(hào)","姓名","證件號(hào)碼","聯(lián)系電話","職位","崗位","入職日期","離職日期","備注"};//定義一個(gè)數(shù)組clerk00,用于存放某個(gè)職員信息
?
?public void clerkInput(){
? System.out.println("添加新職員信息請(qǐng)選擇1;其他請(qǐng)選擇2");//提示是否選擇添加新職員
? Scanner functionNum0=new Scanner(System.in);
? try{
?? int funtionNum=functionNum0.nextInt();
? }catch(InputMismatchException e){
?? System.out.println("輸入代碼錯(cuò)誤,請(qǐng)重新輸入:");
? }catch(Exception e ){
?? System.out.println("系統(tǒng)異常,請(qǐng)聯(lián)系工作人員");
? }finally{
?? System.out.println("系統(tǒng)繼續(xù)進(jìn)行:");
?? int funtionNum=functionNum0.nextInt();
? }
?
? if(funtionNum==1){
??? for(int i=0;i<9;i++){
???? System.out.println("請(qǐng)輸入新職員的"+clerk00[i]);
???? Scanner input =new Scanner(System.in);
???? clerk01[i]=input.next();
??? }
?? }if(funtionNum==2){
??? System.out.println("歡迎光臨東風(fēng)日產(chǎn)派工系統(tǒng)?。?!");
?? } else{
??? System.out.println("輸入代碼錯(cuò)誤請(qǐng)重新輸入!請(qǐng)輸入正確的功能代碼:1或者2");
?? }
??
?
? }
?public void clerkPrint(){
? System.out.println("是否顯示新職員信息:是 1 否2");
? Scanner printNum0=new Scanner(System.in);
? int printNum=printNum0.nextInt();
? if(printNum==1){
? ?? System.out.print("新職員的信息如下:");
?? for(int i=0;i<9;i++){
??? System.out.print(clerk01[i]+"? ");
?? }
? }else{
?? System.out.println("返回添加新職員界面?。?!");
? }
?
?
?}
?
?
?public static void main(String[] args) {
? clerkNew clN=new clerkNew();
? clN.clerkInput();
? clN.clerkPrint();
}
2015-10-28
這一段代碼改為?
if(funtionNum==1){
??? for(int i=0;i<9;i++){
???? System.out.println("請(qǐng)輸入新職員的"+clerk00[i]);
???? Scanner input =new Scanner(System.in);
???? clerk01[i]=input.next();
??? }
?? } else if(funtionNum==2){
??? System.out.println("歡迎光臨東風(fēng)日產(chǎn)派工系統(tǒng)?。?!");
?? } else{
??? System.out.println("輸入代碼錯(cuò)誤請(qǐng)重新輸入!請(qǐng)輸入正確的功能代碼:1或者2");
?? }