zoukankan      html  css  js  c++  java
  • 造人

    package com.aila;
    public class La {
      public int id;
      public String name;
      public int age;
      public String city;
      public void printX()
      {
        System.out.println("我的名字叫=" + name + ",代号是 =" + id + ", 年龄是=" + age + ", 所在城市=" + city);
      }

      public La()
      {
        System.out.println("这是没有参数的方法,用此语句证明执行过!");
      }

      public La(int id,String name,int age,String city) {
        this.name=name;
        this.id=id;
        this.age=age;
        this.city=city;
      }
    }
     
    package com.aila;
    public class Ai {
      public static void main(String[] args)
      {
      
        La aila1=new La();
        aila1.name="xiaohan1";
        aila1.id=001;
        aila1.age=18;
        aila1.city="秋叶原";

        La aila2=new La();
        aila2.name="xiaohan2";
        aila2.id=002;
        aila2.age=18;
        aila2.city="秋叶原";

        La aila3=new La();
        aila3.name="xiaohan3";
        aila3.id=002;
        aila3.age=18;
        aila3.city="秋叶原";

        aila1.printX();
        aila2.printX();
        aila3.printX();

      }
    }

  • 相关阅读:
    一点优化小知识
    网站结构优化之一
    [JOISC 2016 Day 3] 电报
    [HDU 6157] The Karting
    [JOISC 2015 Day2] Keys
    Educational Codeforces Round 107 (Rated for Div. 2)
    [JOISC 2020 Day4] 治疗计划
    CF1131G Most Dangerous Shark
    [APIO2016] 划艇
    [ICPC World Finals 2018] 绿宝石之岛
  • 原文地址:https://www.cnblogs.com/hhr1998/p/8022524.html
Copyright © 2011-2022 走看看