ssd3:Practical Quiz 1 iCarnegie Information

这篇博客介绍了一个使用Java编写的iCarnegieInfo应用程序,该程序处理用户输入并展示公司信息。通过异常处理确保输入正确性和数据类型安全,同时应用了单例模式来限制类的实例化,仅允许创建一个ICarnegieInfo对象。
摘要由CSDN通过智能技术生成

iCarnegie Information

import  java.io.*;
import  java.util.*;

public class ICarnegieInfoApplication  {

 private static BufferedReader  stdIn =
  new  BufferedReader(new  InputStreamReader(System.in));
 private static PrintWriter  stdOut =
  new  PrintWriter(System.out, true);
 private static PrintWriter  stdErr =
  new  PrintWriter(System.err, true);

 public static void main(String[]  args) throws IOException  {

  ICarnegieInfo companyInfo = ICarnegieInfo.getInstance();

  int  choice = getChoice();

  while (choice != 0)  {

   if (choice == 1)  {
    stdOut.println(companyInfo.getName());
   } else if (choice == 2)  {
    stdOut.println(companyInfo.getAddress());
   } else if (choice == 3)  {
    stdOut.println(companyInfo.getTelephone());
   } else if

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值