easy newbie question

  • Thread starter news.nucleus.com
  • Start date
N

news.nucleus.com

The following code gives this compile error

The type A is already defined

My Question is

1. WHY?
2. What part of code needs removing to fix the problem?

Thanks :)

class Assign2_2
{
public static void main(String [] args)
{
new A();
}
}

class A{
A a = new A();
}
 
P

Phil Hanna

At least you will have presented evidence of having
attempted this task which, by the looks of it, is part of an assignment.

Especially suspicious is that class name, "Assign2_2". Sure looks
like homework to me.

BTW, I don't get a compile error as the OP claimed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top