How to convert the following Java
code to JScript
:
return ((IPOSBasket) basket).getOriginalCashierID();
When executing the above code in Java
, it works fine. But if I try to execute as a JScript
, I am getting NULL
value.
How to convert the following
When executing the above code in |
|||
At the risk of getting downvotes XD
|
|||||
|
You shouldn't need to cast anything, how are you getting the basket variable? Also, as a good practice don't do any operations in a return statement, it sometimes hides errors/problems in code and harms readability. So if it is JScript:
|
|||
|
As mentioned by HMR in comment, the following line works fine:
|
|||
|
return basket.getOriginalCashierID();
will do. – HMR Jul 10 '13 at 8:17