demo 1
public class HelloWorld {
public static void main(String[] args) {
print();// 静态方法 调用静态方法;
}
public static void print(){
System.out.println("www.mldn.cn");
}
}
last demo
public class HelloWorld {
public static void main(String[] args) {
new HelloWorld().print();// 静态方法,调用非静态方法;
}
public void print(){
System.out.println("www.mldn.cn");
}
}
标签:静态方法,void,HelloWorld,案例,static,5.14,print,public
From: https://www.cnblogs.com/pansidong/p/17452125.html