当我尝试在类内访问时,找不到变量错误m.name = "killer"
。请帮忙。
class Movie {
String name;
String genre;
int num;
public void play()
{
System.out.println("start playing");
}
}
public class MovieObjects{
public static void main(String[] args) {
MovieObjects m = new MovieObjects ();
{
m.name="Killer";
m.genre = "Romance";
}
}
}