title: Difference between constructors and methods
body: <p>Bellow is an example I found on Tutorials Points, an example of a constructor. I got most of them, but I just don't get why you need a constructor <em>and</em> a method.</p>
  
  <pre><code>public Puppy(String name){
      System.out.println("Passed Name is :" + name ); 
  }
  </code></pre>
  
  <p>My question is, what stops you from doing this instead? </p>
  
  <pre><code>public static void Puppy(String name){
      System.out.println("Passed Name is: "+name);
  }
  </code></pre>
  
  <p>Doesn't these two do the same thing once called?</p>
  
  <p>Here is the full program for reference:</p>
  
  <pre><code>public class Puppy {
      int puppyAge;
  
      public Puppy(String name) {
          System.out.println("Passed Name is :" + name); 
      }
  
      public void setAge(int age) {
          puppyAge = age;
      }
  
      public int getAge() {
          System.out.println("Puppy's age is :" + puppyAge); 
          //what does this return do? since the puppyAge is already printed above.
          return puppyAge;
      }
  
      public static void main(String []args){
          Puppy myPuppy = new Puppy("tommy");
  
          myPuppy.setAge(2);
          myPuppy.getAge();
  
          System.out.println("Variable Value :" + myPuppy.puppyAge); 
      }
  }
  </code></pre>