6 this的使用方法

class Person

{

  String name;

  void talk()

  {

    System.out.println("my name is "+this.name);

  }

}

class Person

{

  String name;

  int age;

  String address;

  

    Person()

  {

    System.out.println("无参的构造函数");

  }

Person(String name,int age,String address)

  {

    this.name=name;

    this.age=age;

    this.address=address;

    System.out.println("有参的构造函数");

  }

  void talk()

  {

    System.out.println("my name is "+this.name);

  }

}

上一篇:基本概率分布Basic Concept of Probability Distributions 8: Normal Distribution


下一篇:微内核架构(Microkernel Architecture)