1

I am getting the following warning in Netbeans:

incompatible types
found : carPackage.port.search
required : carPackage.SearchResponse 

In my JSP page, I have the following code:

CarService service = new CarService();
CarPort port = service.getCarPort();
SearchResponse searchResult = port.search("Toyota");

The error obviously occurs on this line:

SearchResponse searchResult = port.search("Toyota");

What datatype should I put in instead of SearchResponse?

Thanks, Lucas

Lycana
  • 1,154
  • 4
  • 10
  • 17

1 Answers1

0

You're missing ; from the end. If CarPort.search returns SearchResponse, then your datatypes are correct.

Joonas Pulakka
  • 36,252
  • 29
  • 106
  • 169
  • sorry. I did have the semi-colons at the end. Typo. Will edit now. I am not too sure why...then...the error is displaying. I have imported the packages correctly as well... – Lycana May 06 '09 at 13:29
  • Netbeans (at least usually) shows you the return types while editing. Try it, write SearchResponse searchResult = port. and you'll see all public methods that port object has, as well as their return types in the rightmost column. – Joonas Pulakka May 07 '09 at 10:55