File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes problem with return type map Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "problem with return type map" Watch "problem with return type map" New topic
Author

problem with return type map

indu iyengar
Ranch Hand

Joined: Jul 30, 2010
Posts: 115
Hi

am using java5..I have a method with return type map...
when I declare the method signature in interface it is not showing any error

but if I declare like this it shows the error
set return type as void
we should not declare generics in return type ?


thanks ,
Indu
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4370
    
    8

Try Map<String, Integer> - primitives can't be applied as generic types. Declare the generic type as Integer and the auto-boxing will allow you to add ints to it.
indu iyengar
Ranch Hand

Joined: Jul 30, 2010
Posts: 115
thank you..
 
 
subject: problem with return type map