course.java

来自「Refer to the UML diagram above and imple」· Java 代码 · 共 58 行

JAVA
58
字号
/*
 * Course.java
 *
 * Created on October 1, 2007, 3:04 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package javaapplication5;

/**
 *
 * @author WEK070010
 */

public class Course {
    
    /** Creates a new instance of Course */
    public Course() {
    }
    
    private String title;
    private String code;
    private String lecturer;
    
    public Course(String title,String code,String lecturer){
        this.title = title;
        this.code = code;
        this.lecturer = lecturer;    
        }
        
        
        public String getTitle(){ 
            return title;
        }
        public String getCode(){
            return code;
        }
        public String getLecturer(){
            return lecturer;
        }
        public void setTitle(String title){
            this.title =title;
        }
        public void setCode(String code){
            this.code = code;
        }
        public void setLecturer(String lecturer){
            this.lecturer = lecturer;
        }
         public String toString(){
            String output = getTitle() + "," + getCode() + "," + "taught by " + getLecturer();
            return output;        
        }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?