Netbeans incompatible types question
-
06-07-2019 - |
Question
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
Solution
You're missing ; from the end. If CarPort.search returns SearchResponse, then your datatypes are correct.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow