Create Class example

__________________________course.java
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package courseregistration;

/**
 *
 * @author elacy
 */
public class Course {
   private String courseName = "Java";
   private int creditHours = 4;
   
   public void printInfo(){
       System.out.println("The name of the course is: " + courseName);
       System.out.println("The hours of the course is: " + creditHours);
   }
}
_______________________________________Student.java

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package courseregistration;

/**
 *
 * @author elacy
 */
public class Student {
    private String studentName = null;
    
    public void setName(String name){
    studentName = name;
    
    }
public String getName(){
return studentName;
}
        public void saying(){
            System.out.println("Hello " + studentName);
        }
}