• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Type mismatch: cannot convert from Override to Annotation

 
Sasha Ruehmkorf
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Eclipse and I always get the above mentioned message when hoovering the mouse over the word Override. I don't have a clue what to do...

class ObjektMitFinalize{

int [] intArray = new int[100];

@Override
protected void finalize(){
}
}
 
Burkhard Hassel
Ranch Hand
Posts: 1274
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sasha,

I had the same problem also.

In my case I had a class named "Override" that caused the error. The class was in the same package.


Yours,
Bu.
[ April 01, 2007: Message edited by: Burkhard Hassel ]
 
Sasha Ruehmkorf
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That was the problem.
Thank you!!!
 
shakthi balaji
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks! That saved my time.
 
Campbell Ritchie
Sheriff
Posts: 48382
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Common problem; the answer is never to create a class with the same name as a class in the package you are importing. That implicitly includes the java.lang package.
 
Campbell Ritchie
Sheriff
Posts: 48382
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alternatively, you can use the fully‑qualified names of the classes imported.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic