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

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top