|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
package com.atguigu.p2.ui;
import com.atguigu.p2.service.CustomerList;
import com.atguigu.p2.ui.CustomerView;
import com.atguigu.p2.service.*;
import java.util.*;
public class CustomerView {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
CustomerView test = new CustomerView();
CustomerList customers = new CustomerList(10);
boolean isFlag = true;
while(isFlag) {
test.enterMainMenu();
int a = scan.nextInt();
switch (a) {
case 1:test.addNewCustomer();
break;
case 2:test.modifyCustomer();
break;
case 3:test.deleteCustomer();
break;
case 4:test.listAllCustomers();
break;
case 5:{
System.out.println("是否确定退出?Y/N");
String exit = scan.next();
if(exit.charAt(0) == 'Y') {
isFlag = false;
}
}
break;
}
}
}
public void enterMainMenu() {
System.out.println("-------------------客户信息管理软件------------------");
System.out.println("\t\t1 添 加 客 户");
System.out.println("\t\t2 修 改 客 户");
System.out.println("\t\t3 删 除 客 户");
System.out.println("\t\t4 客 户 列 表");
System.out.println("\t\t5 退 出");
}
private void addNewCustomer() {
}
private void modifyCustomer() {
}
private void deleteCustomer() {
}
private void listAllCustomers() {
System.out.println("------------------------客户列表---------------------");
int total = customers.getTotal();
System.out.println("------------------------客户列表完成-----------------");
}
}
为什么我 倒数第二行的int total = customers.getTotal()无法正常调用别的包呀 |
|