What does the following 4test code print and why?

Unfortunately more then seventy five percent of candidates for SilkTest Testing Engineer position would give a wrong answer: "53" "54". Perhaps they forgot or never knew about using the type cast operator to perform explicit type conversion. The result of casting a string to integer is the numeric value of the first character in string. Thus in the example above the second print operator would produce "53" too, which is decimal value of the ASCII character 5.
1 comment:
MP thats really a good question , i will not say it a tricky question as if you know basics its an obvious question.
Post a Comment