java匿名对象_面向对象

class Student{

public void tell(){

System.out.println("Hello jikexueyuan");

}

public void main{

Student stu=new Student();

stu.tell();

//匿名对象可以直接new 但是只能使用一次

new Student.tell();

}

}

原文地址:https://www.cnblogs.com/shanheyongmu/p/4931446.html