//可以赋值但没有意义。当方法只调用一次的时候可以使用匿名对象
package study;
public class better{
public static void main(String[] args) {
new student().age=18;
new student().study();
System.out.println(new student().age);
}
}
class student{
int age;
public void study(){
System.out.println(“好好学习”);
}
}