编码声明不理解 [英] Coding statement not understanding
本文介绍了编码声明不理解的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
结果i =((int)((string)((int)7)+5))
a)整数i,其中i = 12
b)一个字符串,其中i = 12
c)字符串,其中i = 75
d)整数i,其中i = 75
e)一个例外
你能解释一下我需要弄清楚什么吗?=(int )((string)((int)7)+5))
The result of i = ((int)((string)((int)"7")+"5"))
a) An integer i, where i = 12
b) A String, i where i = 12
c) A String, i where i = 75
d) An integer i, where i = 75
e) An Exception
Would you mind to explain what I need to figure out fron i = ((int)((string)((int)"7")+"5"))
推荐答案
你的答案是d。
7首先转换为整数。
7然后隐式转换为字符串并连接到5,从而得到75作为字符串。
然后再将其转换为整数,从而得到整数75。
Your answer would be d.
7 is first converted to an integer.
7 is then implicit y converted to a string and concatenated to 5 thus giving you 75 as a string.
This is then again converted to an integer thus giving you integer 75.
这篇关于编码声明不理解的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文