0

I have following code:

class Key{
 --Some Implementation
}

class A{
   public void grpMap(ConcurrentMap<Key,List<Key> keyList){ 
   --Some Implementation   
   }

}

public class B extends A{
   --Edited
   @Override -- [Made "O" capital case after kocko's reply]
   public void grpMap(ConcurrentMap<Key,List<Key> keyList){ 
   --Some Implementation   
   }


}

With above code i get following error in class B

The method grpMap(ConcurrentMap) of type B must override or implement a supertype method

My problem is i can't change the way classes key, B and C are declared as these are legacy classes.

Any suggestion on how to get rid of this error?

EDIT---

JDK version used is 1.6.43 I am using eclipse which will auto generate annotations.

Lokesh
  • 7,810
  • 6
  • 48
  • 78

1 Answers1

2

The annotation

@override

should be

@Override
 ↑

Also, check you Java version in the IDE - it should be 1.6, or newer, in order to get rid of the error.

Open Project properties -> Java compiler -> Set compliance level to 1.6 -> OK.

Konstantin Yovkov
  • 62,134
  • 8
  • 100
  • 147