Resolution: Not A Problem
Affects Version/s: None
Fix Version/s: None
String with length 1, if assigned to int variable, assigns the ascii value. String with more than 1 length throws GroovyCastException
Line 3 prints `49`. It is ok as `char` is assgined to integer in line 2
Line 7 prints `n21` eventhough String is assgined in line 5... Is it right?
Line 6 : `n22` is assigned 1 as I have written `s2 as int`. This is ok
Line 10 : Throwing GroovyCastException. This is ok.
The difference between Line-5 and Line-10 is the difference in String length. Both are Strings. The former is of length 1 and the latter is of length 2.
So, String with length 1, if assigned to int variable, assigns the ascii value. String with more than 1 length throws GroovyCastException This looks some what different...
Is it the acceptable behavior