小编Rak*_*esh的帖子

如果结构不能继承另一个类或结构,为什么Int32有一个ToString()方法?

int a = 2;

Console.WriteLine(a.ToString()); // displays 2

// definition of ToString() here - public override string ToString();
Run Code Online (Sandbox Code Playgroud)

现在,以下是我的一些理解:

  1. .net中的所有类都获得一个ToString()Object类继承的方法.
  2. 结构不能从Class或其他结构派生.int是一个类型的结构Int32,它ToString()从它实现的接口获取一些[With Parameters]方法.
  3. ToString()struct中还有一个[without params]函数Int32

根据http://msdn.microsoft.com/en-us/library/system.int32.tostring.aspx,

struct Int32重写ValueType.ToString()方法

如果结构不能继承某个类或结构,请解释一下这个ToString()方法是如何可用的Int32

.net c# inheritance struct

21
推荐指数
1
解决办法
8555
查看次数

Div 背景图像消失

嗨,我正在尝试将图像作为背景添加到 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)

谢谢你。

html css

1
推荐指数
1
解决办法
9502
查看次数

标签 统计

.net ×1

c# ×1

css ×1

html ×1

inheritance ×1

struct ×1