<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    少年阿賓

    那些青春的歲月

      BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
      500 Posts :: 0 Stories :: 135 Comments :: 0 Trackbacks

    package com.abin.inter.service;

    public interface UserService {
     
     public static enum UserType{
      UserBasic("Basic Information"),
      UserName("Name Of User"),
      UserSex("Sex Of User"),
      UserAge("Age Of User"),
      UserInitialize("Initialize Of User");
      
      private String info;
      private UserType(String _info){
       this.info=_info;
      }
      
      public String getObject(){
       return info;
      }
     };
     
     
     int UserSum(int one,int two,UserType userInfo);
     String Welcome(String username,UserType userInfo);
    }







    package com.abin.inter.serviceImpl;

    import com.abin.inter.service.UserService;

    public class UserServiceImpl implements UserService{
     @Override
     public int UserSum(int one, int two,UserType userInfo) {
      UserType user=UserType.UserInitialize;
      System.out.println("Enum Info:"+user.getObject());
      if(userInfo.equals(UserType.UserAge)){
       System.out.println("UserInfo:"+userInfo);
       return one+two;
      }
      return 0;
     }

     @Override
     public String Welcome(String username,UserType userInfo) {
      UserType user=UserType.UserInitialize;
      System.out.println("Enum Info:"+user);
      if(userInfo.equals(UserType.UserName)){
       System.out.println("UserInfo:"+userInfo);
       return "歡迎"+username;
      }
      return "NOT WELCOME";
     }

     @Override
     public String toString() {
      // TODO Auto-generated method stub
      return super.toString();
     }
     
     
    }








    package com.abin.inter.test;

    import com.abin.inter.service.UserService;
    import com.abin.inter.service.UserService.UserType;
    import com.abin.inter.serviceImpl.UserServiceImpl;

    import junit.framework.TestCase;

    public class TestUser extends TestCase{
     
     public void test(){
      UserService service=new UserServiceImpl();
      UserType userInfo=UserType.UserAge;
      int result=service.UserSum(10, 17, userInfo);
      System.out.println("UserSum="+result);
      UserType userInfo1=UserType.UserName;
      String result1=service.Welcome("abin", userInfo1);
      System.out.println("Welcome="+result1);
      
     }
    }





    運行結果:
    Enum Info:Initialize Of User
    UserInfo:UserAge
    UserSum=27
    Enum Info:UserInitialize
    UserInfo:UserName
    Welcome=歡迎abin
    posted on 2012-03-12 22:29 abin 閱讀(649) 評論(0)  編輯  收藏 所屬分類: java集合類
    主站蜘蛛池模板: 亚洲AV无码一区二区三区人| 亚洲a无码综合a国产av中文| 最近中文字幕免费mv视频7| 学生妹亚洲一区二区| 亚洲精品国产精品乱码不卡| 国产精品偷伦视频观看免费 | j8又粗又长又硬又爽免费视频| 国产亚洲成av片在线观看| 久久久高清免费视频| 日产久久强奸免费的看| 91在线亚洲精品专区| 国产片免费福利片永久| 久久久国产精品无码免费专区| 亚洲熟妇无码一区二区三区| 亚洲国产一二三精品无码| 在线免费观看毛片网站| 免费毛片a线观看| 亚洲国产精品无码久久98| 亚洲国产AV无码专区亚洲AV| 性盈盈影院免费视频观看在线一区| 99久久99这里只有免费的精品| 亚洲熟妇无码一区二区三区 | 亚洲AV无码专区国产乱码4SE| 成人午夜视频免费| 无码中文字幕av免费放dvd| 亚洲AV无码成人精品区日韩| 亚洲视频2020| 久久精品国产亚洲一区二区三区 | 亚洲精品自产拍在线观看动漫| 国产成人免费a在线视频色戒| 亚洲黄色免费电影| a毛片全部免费播放| 豆国产96在线|亚洲| 亚洲制服丝袜在线播放| 亚洲av最新在线网址| 亚洲 自拍 另类小说综合图区| 日韩免费a级毛片无码a∨| 99久热只有精品视频免费观看17| 国内精品免费视频精选在线观看| 男男gay做爽爽免费视频| 亚洲熟女精品中文字幕|