Hi,
I have a simple Question . Can there be only one "public class" in a file ?
I did some sort of this , but it complained .
import java.util.*;
import java.io.*;
public class MyTest
{
public static void main (
String[] args)
{
FirstClass fs = new FirstClass();
SecondClass sc = new SecondClass();
System.out.println("This Works--sai");
}
}
Public class FirstClass
{
public FirstClass(){}
}
public class SecondClass
{
public SecondClass() {}
}
C:\praveen\DisMDSets\mandelbrot>javac MyTest.java
MyTest.java:14: 'class' or 'interface' expected
Public class FirstClass
^
MyTest.java:18: class SecondClass is public, should be declared in a file named
SecondClass.java
public class SecondClass
^
2 errors
C:\praveen\DisMDSets\mandelbrot>
Can someone explain further? or point to me a link.
Thanks
Praveen