views:

164

answers:

1

Hi there, 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

A: 

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

Joonas Pulakka
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
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