title: How to create a subclass?
body: <p>I'm kind of a beginner at coding and I've been looking all over the internet and nothing really comes out and gives me an example on how to use the extend method and how to properly use the <strong>super()</strong> method. I'm kind of stuck with this and wondering if someone could show or give me a good example. My project was to Define a class Diploma and its subclass DiplomaWithHonors, so that some statements display their academic achievements. Thanks for your help! Okay now that I took a "stab" at the problem I have a error with the return statement if anyone can help with that...</p>
  
  <pre><code>     public class Diploma
        {
         public String fullName;
         public String course;
         int output = Diploma();
  
          public Diploma(String name, String info)
           {
           fullName = name;
           course = info;
           }
          public String toString()
           {
            return "This certifies that \n" + fullName + " \n has completed a course in " + course;
             }
          }
  
           public class DiplomaWithHonors extends Diploma
        {
          public DiplomaWithHonors( String name, String info ) 
        {
          super( name, info );
        }
         public String toString() 
        {
        return "This certifies that \n" + fullName + " \n has completed a course in " +   course+ "\n*** with honors ***";
        }
          }
        public String toString()
         {
          Diploma[] diplomas = new Diploma[2];
          diplomas[ 0 ] = new Diploma("Murray Smith", "Gardening");
          diplomas[ 1 ] = new DiplomaWithHonors("Lisa Smith", "Evolutionary Psychology");
  
          for( int i = 0; i&lt; diplomas.length; i++) 
          {
           System.out.println( diplomas[ i ] );
          }
         }
          return output;
         }
  </code></pre>
  
  <p>P.S Sorry about the style malfunction, I kind of messed up on the copy paste.</p>