aspose file tools
The moose likes Beginning Java and the fly likes Type mismatch: cannot convert from Override to Annotation Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Type mismatch: cannot convert from Override to Annotation" Watch "Type mismatch: cannot convert from Override to Annotation" New topic
Author

Type mismatch: cannot convert from Override to Annotation

Sasha Ruehmkorf
Ranch Hand

Joined: Mar 29, 2007
Posts: 115
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

Joined: Aug 25, 2006
Posts: 1274
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 ]

all events occur in real time
Sasha Ruehmkorf
Ranch Hand

Joined: Mar 29, 2007
Posts: 115
That was the problem.
Thank you!!!
shakthi balaji
Greenhorn

Joined: Oct 13, 2010
Posts: 3
Thanks! That saved my time.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32675
    
    4
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

Joined: Oct 13, 2005
Posts: 32675
    
    4
Alternatively, you can use the fully‑qualified names of the classes imported.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Type mismatch: cannot convert from Override to Annotation
 
Similar Threads
is overloading possible in subclass
Capturing Terminal Window Text (overloading flush()?)
validation
Instance of an abstract class
Hashcode program error