• Document


    创建Customer.java

     1 /***
     2  * 需求分析:创建客户类
     3  * @author chenyanlong
     4  * 日期:2017/10/15
     5  */
     6 package com.hp.test06;
     7 
     8 public class Customer {
     9    int points;//积分
    10    String cardType;//卡类型
    11   
    12    //显示信息
    13    public void show(){
    14        System.out.println("积分"+points+",卡类型:"+cardType);
    15    }
    16 }

     

    InitialCustomer.java

     1 /***
     2  * 需求分析:测试Customer
     3  * @author chenyanlong
     4  * 日期:2017/10/15
     5  */
     6 package com.hp.test06;
     7 
     8 public class InitialCustomer {
     9 
    10     public static void main(String[] args) {
    11         // TODO Auto-generated method stub
    12         Customer customer=new Customer();
    13         customer.points=1000;
    14         customer.cardType="会员卡";
    15         customer.show();
    16     }
    17 
    18 }

    运行InitialCustomer.java,结果为

     

  • 相关阅读:
    iptables
    apt
    cvc-elt.1: Cannot find the declaration of element 'beans'.
    di
    log
    java内存模型
    spring-jms
    JTS
    10java进阶——IO2
    17单例
  • 原文地址:https://www.cnblogs.com/chenyanlong/p/7670946.html
Copyright © 2020-2023  润新知