Java Error: Multiple Public Classes & Missing Brace in Student Class
There are a couple of issues with this code:
- There cannot be two public classes in the same file. In this case, the 'Manager' class is public, but the 'Student' class is not. Either make the 'Student' class public or move it to a separate file.
- The 'Student' class is missing a closing brace on line 5.
Here's the corrected code:
public class Manager {
int age;
}
public class Student {
private String name;
}
原文地址: https://www.cveoy.top/t/topic/ozWu 著作权归作者所有。请勿转载和采集!