修改數組裡的指定元素的內容
String a1111 = input.next();
boolean A = false;
if(好友!=null){
for(int i = 0;i<好友.length;i++){
if(好友[i]!=null){
if((好友[i].get好友賬號()).equals(a1111)){
System.out.println("找到你要修改的好友資訊:");
System.out.println("賬號"+好友[i].get好友賬號()+"\t等級"+好友[i].get好友等級()+"\t暱稱"+好友[i].get好友暱稱()+"\tQ齡"+好友[i].get好友Q齡()+"\t備註"+好友[i].get好友備註()+"\t分組"+好友[i].get好友分組());
System.out.println("請選擇你要修改的內容:1.備註2.分組");
int choice = input.nextInt();
if(choice == 1){
System.out.println("請輸入好友新備註:");
String f = input.next();
好友[i].set好友備註(f);
System.out.println("修改好友備註成功");
A = true;
break;
}else if(choice == 2){
System.out.println("請輸入新分組名:");
String g =input.next();
好友[i].set好友分組(g);
A = true;
System.out.println("修改分組成功");
break;
}else{
System.out.println("輸入有誤!");
break;
}
}
}
}
}
if(!A){
System.out.println("查無此人");
}
break;