/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package puppy;

/**
 *
 *
 */

public class Puppy{
   int puppyAge;
   String puppyName;
   public Puppy(String name){
      // This constructor has one parameter, name.
      System.out.println("Passed Name is :" + name );
      puppyName = name;
   }
   public void setAge( int age ){
       puppyAge = age;
   }
   public int getAge( ){
       System.out.println("Puppy's age is :" + puppyAge ); 
       return puppyAge;
   }
   public static void main(String []args){
      /* Object creation */
      Puppy myPuppy = new Puppy( "tommy" );
      /* Call class method to set puppy's age */
      myPuppy.setAge( 2 );
      /* Call another class method to get puppy's age */
      myPuppy.getAge( );
      /* You can access instance variable as follows as well */
      System.out.println(myPuppy.puppyName + " age :" + myPuppy.puppyAge ); 
   }
}