java的接口与调用
public interface test_interface
{
public void helloword();
}
public class test_class implements test_interface
{
public void helloword()
{
System.out.println("helloword");
}
}
public class test
{
test_interface inter=new test_class();
inter.helloword();
}
asp.net接口与调用
interface test_interface{
public void helloword();
}
public class test_class : test_interface{
public void test_interface.helloword()
{
console.writeline("helloword");
}
// public void override helloword()
// {
//console.writeline("helloword");
// }
static void Main()
{
test_interface inter = new test_class();
inter.helloword();
}
}
就这些,如果错误 纯属手误。。希望我的回答能帮助您解决问题!
interface IA
{
public void hello();
}
class a:IA
{
public void override hello(){system.text.console.writeline("hello word!");}
}