int a = 2;
Console.WriteLine(a.ToString()); // displays 2
// definition of ToString() here - public override string ToString();
Run Code Online (Sandbox Code Playgroud)
现在,以下是我的一些理解:
ToString()从Object类继承的方法.int是一个类型的结构Int32,它ToString()从它实现的接口获取一些[With Parameters]方法.ToString()struct中还有一个[without params]函数Int32根据http://msdn.microsoft.com/en-us/library/system.int32.tostring.aspx,
struct Int32重写ValueType.ToString()方法
如果结构不能继承某个类或结构,请解释一下这个ToString()方法是如何可用的Int32?
嗨,我正在尝试将图像作为背景添加到 div。它在窗口最大化时工作,但是当我改变窗口大小时,图像消失。
你能告诉我我哪里出错了。
background-image: url('../Images/IPCC-Tile.jpg');
background-color: #FFFFFF;
background-repeat: no-repeat;
background-position: center center;
position: absolute;
width: 15%;
height: 35%;
top: 30%;
left: 2%;
overflow:visible;
Run Code Online (Sandbox Code Playgroud)
谢谢你。