Let's parse why. '10*10' is obviously a String as it contains a mix of characters so we start out with that datatype and keep going until we encounter a modifier such as the '*' which we'll treat as just that, a multiplier. We also know that what follows should be a numeric value so we test if the following '10' passes as an Integer and it does. So now we have "10"*10 and nobody is happy
26
u/PregnantOrc Aug 06 '22 edited Aug 06 '22
10101010101010101010
Let's parse why. '10*10' is obviously a String as it contains a mix of characters so we start out with that datatype and keep going until we encounter a modifier such as the '*' which we'll treat as just that, a multiplier. We also know that what follows should be a numeric value so we test if the following '10' passes as an Integer and it does. So now we have "10"*10 and nobody is happy