java匿名对象_面向对象

class Student{

public void tell(){

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

}

public void main{

Student stu=new Student();

stu.tell();

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

new Student.tell();

}

}

posted @ 2015-11-02 21:28  山河永慕~  阅读(162)  评论(0编辑  收藏  举报