JL Valor

Greenhorn
+ Follow
since Mar 15, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by JL Valor

I am studying for the Sun Java Cert exam and this problem appeared on a mock exam.
What will happen when you attempt to compile the following in a Test.java file?
class Base{
public static void main(String[] args) {
System.out.println("Hello");
}
}
public class Test extends Base{}
Well, I got it wrong but when i ran it myself it outputs "Hello." My question is...I though there could only be one default or public class in a source file. If that is true, then why is this code successful?
Thanks
JL
23 years ago