1public class Puppy {
2 public Puppy(String name) {
3 // This constructor has one parameter, name.
4 System.out.println("Passed Name is :" + name );
5 }
6
7 public static void main(String []args) {
8 // Following statement would create an object myPuppy
9 Puppy myPuppy = new Puppy( "tommy" );
10 }
11}