• Post Reply Bookmark Topic Watch Topic
  • New Topic

I want to declare a method in the Interface with return type of Map  RSS feed

 
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to declare the method in the Interface with the return type of of a Map like this :



But it throws an error :

 
Ranch Hand
Posts: 62
5
Eclipse IDE Java Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sucheta Shrivastava wrote:

The "empMap" is wrong.



is syntactically correct. (Employee must exists somewhere, obviously)
Note also that public on method is optional. Interface methods are always (implicitly) public.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!