Java中静态调用静态,静态调用非静态
1. 静态调用非静态 $ cat Helloworld.java public class Helloworld { public void Puppy(String name) { System.out.println("dog name is : " + name); } public static void main(String[] args) { Helloworld p = new Helloworld(); p.Puppy("dddd"); } } 2. 静态调用静态 $ cat Helloworld.java public class Helloworld { public static void Puppy(String name) { System.out.println("dog name is : " + name); } public static void main(String[] args) { Puppy("dddd"); } }
知人难,相知相惜更难