当前位置: 首页 > news >正文

Customer类定义

Customer类定义 

class Customer {

        String name,address,telephone;

        String getName() {

              return name;

        }

        void  setName(String name){

              this.name = name;

         }

         String getAddress(String address){

               return address;

          }

          void setAddress(String address){

                 this.address =address;

           }

          String setTelephone(){

                 return telephone;

          }

          void getTelephone(){

                 this.telephone=telephone;

          }

 

         public static void main(String [] args){

                  Customer customer1 = new customer();

                  Customer customer2 = new customer();

                 

                  customer1.setName("Zhang Feng");

                  customer1.setAddress("#130 Nan Road");

                  customer1.setTelephone("022-23503545");

 

                   customer2.setName("Jin Wei");

                   customer2.setAddress("#130 Bei Road");

                   customer2.setTelephone("022-23503546");

 

                   System.out.print("The first customer name;  ");

                   System.out.println("customer1.getName()");

                   System.out.print("The first customer addrress:  ");

                   System.out.println("customer1.getAddress()");

                   System.out.print("The first customer telephone");

                   System.out.println("customer1.getTelephone()");

 

                   System.out.print("The second customer name;  ");

                   System.out.println("customer2.getName()");

                   System.out.print("The second customer addrress:  ");

                   System.out.println("customer2.getAddress()");

                   System.out.print("The second customer telephone");

                   System.out.println("customer2.getTelephone()");

         }

}

                       

http://www.xdnf.cn/news/814141.html

相关文章:

  • 制作一个简单HTML公司官网网页设计(HTML+CSS)
  • Mysql中 distinct 和 group by 哪个效率高?
  • Softice入门
  • 有关在matlab中对信号采样及频谱的一些解释;复数的频谱,高分辨率谱,高密度谱的一些理解
  • 启动程序因找不到sqlite3.dll文件出现错误提示
  • typedef用法
  • html中引入视频的方法
  • Linux内存调试工具初探-MEMWATCH
  • GitHub和码云上,7个 h5 页面制作工具推荐
  • 11.20 《第二家园》上线内测
  • linux网络编程 copymemory,在VB6中用CopyMemory拷贝字符串的种种猫腻(一)
  • html爱心代码
  • SET QUOTED_IDENTIFIER OFF
  • 占座网失败原因分析
  • 程序员入门教程【非常详细】从零基础入门到精通,看完这一篇就够了 !
  • C#WebMVCLayui实战之《新闻管理系统》(适合初学者)
  • 服务器Hot Spare热备
  • 分页查询研究
  • 信息检索相关任务及数据集介绍
  • Android5 高级教程(三)
  • 英语词根词缀总结整合版
  • nginx配置使用笔记:三
  • 震撼!国产自研多环境开发软件 CEC-IDE 问世!遥遥领先!
  • C标准、C标准库、C++标准、C++标准库
  • 10个用于Android开发的有用的Kotlin库及示例
  • SMTP、ESMTP、POP3发送接收邮件
  • 启动应用程序出现mfc71u.dll找不到问题解决
  • PropertyGrid 用法,还没明白呢.
  • linux_i2c驱动架构(史上最全) davinc dm368 i2c驱动分析
  • 【数学建模】基于matlab模拟报童问题仿真