方法内部类里面不能用这个吗?
package com.imooc1;
public class Water {
public String color;
public float weight;
public void how(){
System.out.println("水可以干很多事情!");
class What {
System.out.println("墨水是用来写字的"); //这一行报错 ,方法内部类 不是这样用的啊?
}
}
public static void main(String[] args){
Water o=new Water();
o.how();
}
谢谢帮助~