I am writing a little code in J2ME. I have a class with a method setTableId(Short tableId). Now when I try to write setTableId(100) it gives compil
setTableId(Short tableId)
setTableId(100)
Generally you can just cast the variable to become a short.
short
You can also get problems like this that can be confusing. This is because the + operator promotes them to an int
+
int
Casting the elements won't help:
You need to cast the expression: