码家

Web Platform, Cloud and Mobile Application Development

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

1.Customer classs

class  Customer{

        private int customerId;

        private long telephoneNo;

        public void setCustomerId(int id){

              cutomerId=id;

        }

        public void setTelephoneNo(long teleNo){

              telephoneNo=teleNo;

        }

        public int getCustomerId(){

              return customerId;

        }

        public long getTelephoneNo(){

              return telephoneNo;

        }

}

2.

class Retail{

      public static void main(String args[]){

            Customer custObi = new Customer();

            custObi.setCustomerId(1001);

            custObi.setTelephoneNo(920186131L);

            System.out.println("Customer Id:"+custObj.getCustomerId());

            System.out.println("Telephone No:"+custObj.getTelephoneNo());

      }

}

posted on 2011-05-21 15:17  海山  阅读(340)  评论(0)    收藏  举报