Java创建对象 Java注释 Java访问实例变量和方法 Java创建对象 public class Puppy { public Puppy(String name) { // This constructor has one parameter, name. System.out.println("Passed Name is :" + name ); } public static void main(String []args) { // Following statement would create an object myPuppy Puppy myPuppy = new Puppy( "tommy" ); } } Java注释 Java访问实例变量和方法