exhuser
asked on
Java: The Public Class Main
I am getting a compiler error " The public type "Main" must be defined in its own file"
Any suggestions?
public class Main {
public static void main(String[] args)
Any suggestions?
public class Main {
public static void main(String[] args)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
public class A {
}
public class B { // Not allowed
}
Java doesn't allow that. You either need to make Main private or move it to its own file.
Doug