Discuss / Java / 练习题

练习题

Topic source

追风少年

#1 Created at ... [Delete] [Delete and Lock User]
public class Person {
    public static int count;
    public Person() {
        this.count++;
    }
    public static int getCount() {
        return count;
    }
}

Valen

#2 Created at ... [Delete] [Delete and Lock User]

可以把this也去掉

public class Person {
    public static int count;
    public Person() {
       count++;
    }
    public static int getCount() {
        return count;
    }
}

just

#3 Created at ... [Delete] [Delete and Lock User]

this在这里有点鸡肋


  • 1

Reply