添加Lesson14和Lesson15
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
namespace Lesson15_继承_万物之父和装箱拆箱练习
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("Hello, World!");
|
||||
//用代码演示拆箱装箱
|
||||
|
||||
//装箱
|
||||
int i = 10;
|
||||
object o1 = i;
|
||||
|
||||
//拆箱
|
||||
object o2 = o1;
|
||||
int i2 = (int)o2;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user