111,126
社区成员
发帖
与我相关
我的任务
分享
类型:描述一种类别的物体有的东西, ------类
实体:就照这个描述造一个这样的物体。 ------对象 我写 int i; --然后光标移到int 中间 右键转到定义。
namespace System
{
// 摘要:
// Represents a 32-bit signed integer.
[Serializable]
[ComVisible(true)]
public struct Int32 : IComparable, IFormattable, IConvertible, IComparable<int>, IEquatable<int>
{
public const int MaxValue = 2147483647;
public const int MinValue = -2147483648;
public int CompareTo(int value);
public int CompareTo(object value);
public bool Equals(int obj);
public override bool Equals(object obj);
public override int GetHashCode();
public TypeCode GetTypeCode();
public static int Parse(string s);
public static int Parse(string s, IFormatProvider provider);
public static int Parse(string s, NumberStyles style);
public static int Parse(string s, NumberStyles style, IFormatProvider provider);
public override string ToString();
public string ToString(IFormatProvider provider);
public string ToString(string format);
public string ToString(string format, IFormatProvider provider);
public static bool TryParse(string s, out int result);
public static bool TryParse(string s, NumberStyles style, IFormatProvider provider, out int result);
}
} int i = 10; //1
System.Int32=10;//2using int = System.Int32;
//可是我又没有发现啊,在何处??
public const int MaxValue = 2147483647;//
public static const int MaxValue = 2147483647;// //错误的类定义:
public class errorClass
{
//不能出现此属性:
private errorClass ec=new errorClass();
} Type type = Type.GetType("ClassA", false, true);
object o = System.Activator.CreateInstance(type);
//就可以得到 一个类型为[ClassA]的 对象 ,
//现在,我有一个现成的类[ClassB] ,要如何才能让对象 A 继承 Class 的方法与属性?
//求 指引! Type type = Type.GetType("ClassA", false, true);
object o = System.Activator.CreateInstance(type);
的方式创建对象o。--但这不是我想要的, int i = 10; //1
System.Int32 i=10;//2上下两句是不是等价的? public const int MaxValue = 2147483647;//
public static const int MaxValue = 2147483647;//上下两句是不是等价的? Type type = Type.GetType("ClassA", false, true);
object o = System.Activator.CreateInstance(type);的方式创他对象opublic interface IClassA
{
int GetSomething();
}
public interface IClassB
{
int GetAnotherThing();
}
public class ClassC : IClassA, IClassB
{
public int GetSomething()
{
//........
}
public int GetAnotherThing()
{
//........
}
}