ZazoTazo

Updated Course Class

Jul 6th, 2019
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1. package com.company;
  2.  
  3. public class Course {
  4.     private String name;
  5.     private int hours;
  6.     private String grade;
  7.  
  8.     public Course(){
  9.  
  10.     }
  11.     public Course(String cn, int ch, String cg){
  12.         setCourseName(cn);
  13.         setCourseHours(ch);
  14.         setCourseGrade(cg);
  15.     }
  16.  
  17.     public void setCourseName(String cn){
  18.         name = cn;
  19.     }
  20.     public void setCourseHours(int ch){
  21.         hours = ch;
  22.     }
  23.     public void setCourseGrade(String cg){
  24.         grade = cg;
  25.     }
  26.     public String getCourseName(){
  27.         return name;
  28.     }
  29.     public int getCourseHours(){
  30.         return hours;
  31.     }
  32.     public String getCourseGrade(){
  33.         return grade;
  34.     }
  35. }
Add Comment
Please, Sign In to add comment