public class CustomBlockFactory
{
private static final Logger logger =
Logger.getLogger(TableListControllerFactory.class.getName());
public static AndroidTourController getController(TourControllerParameters
paramTourControllerParameters, TourSequencer paramTourSequencer)
{
((CustomBlock)paramTourControllerParameters);
return new EnableTableController(paramTourControllerParameters, paramTourSequencer);
}
}
I’m getting error at ((CustomBlock)paramTourControllerParameters); as “The left-hand side of an assignment must be a variable”.
Could anyone please rectify this error?
Thanks in advance
It looks like you are trying to cast the parameter
paramTourControllerParametersto typeCustomBlockso that you can call theEnableTableControllerconstructor. However your code won’t work because the cast operator does not change the static type of a variable.Instead you can create a new variable with the desired type and assign the result of the cast operator to this variable:
Alternatively you can omit the temporary variable and write both the cast and the constructor call in a single statement: