public class Test3
{
public static void main (String args[])
{
void pub()
{
system.out.println("this is pub");
}
void tffan()
{
pub();
}
test3 a = new a();
a.tffan();
}
}
我不明白为什么这样写不行
{
public static void main (String args[])
{
void pub()
{
system.out.println("this is pub");
}
void tffan()
{
pub();
}
test3 a = new a();
a.tffan();
}
}
我不明白为什么这样写不行
ms只在Delphi里面见过。
public class Test3
{
public static void main (String args[])
{
Test3 a = new Test3();
a.tffan();
}
void pub()
{
System.out.println("this is pub");
}
void tffan()
{
pub();
}
}
{
public static void main(String[] args)
{
Test1 a = new Test1();
a.tffan();
}
void pub()
{
System.out.println("this is pub");
}
void tffan()
{
pub();
}
}new 后面跟类名
还有main只是一个方法
我也不太清楚你想这个例子干嘛