Hi,

It's because in Java, for top-level classes(not inner/nested class) you can
have for classes only default or public access level, so if you already have
a public class in your file, you cannot declare another public class.

Regards,
Georgiana

On Fri, Nov 26, 2010 at 8:42 AM, SantoshJ <santoshbjag...@gmail.com> wrote:

> hi,
>
> I am creating simple java program i.e. class file. I have written
> public class with main method to run that program. Also I have written
> another class into same java file.
>
> Here I can not able to give any access specifier to another class code
> block. Can any one explain me why this will be happen in java.
>
> Please find the java file code snapshot below:
>
> public class Test extends JFrame {
>        public Test() {
>                //some operation
>        }
>
>        public static void main(String[] args) {
>                // TODO Auto-generated method stub
>        }
> }
> // here i can not able to give ny access specifier to this class
> declaration.
> class test1
> {
>        //some operation
> }
>
>
> Thanks in advance.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Java EE (J2EE) Programming with Passion!" group.
> To post to this group, send email to
> java-ee-j2ee-programming-with-passion@googlegroups.com
> To unsubscribe from this group, send email to
> java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com<java-ee-j2ee-programming-with-passion%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
>
> http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en

Reply via email to