C#语言中什么是类,怎么调用类?
类示例:
public class TestTime
{
int hours;
int minutes;
int seconds;
public void passtime()
{
//implementation of behavior
}
}
调用过程:
public class Test
{
public static ovid Main
{
TestTime Mytime=New TestTime //声明类
}
}
类示例:
public class TestTime
{
int hours;
int minutes;
int seconds;
public void passtime()
{
//implementation of behavior
}
}
调用过程:
public class Test
{
public static ovid Main
{
TestTime Mytime=New TestTime //声明类
}
}