⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 question.java

📁 在线模拟选课系统
💻 JAVA
字号:
package ch07.object.unit;

import java.sql.ResultSet;

//针对user表的bean类
public class Question 
{
    private String questionId = "";    //题目ID
    private String categoryId = "";    //分类ID
    private String difficulty = "";    //题目难度
    private String subject    = "";    //题目描述
    private String choiceA    = "";    //选项A
    private String choiceB    = "";    //选项B
    private String choiceC    = "";    //选项C
    private String choiceD    = "";    //选项D
    private String answer     = "";    //正确答案
    
    //空的构造方法
    public Question()
    {
    }
    
    //针对rs对象的构造方法
    public Question( ResultSet rs )
        throws Exception
    {
        this.questionId = rs.getString("question_id");
        this.categoryId = rs.getString("category_id");
        this.difficulty = rs.getString("difficulty");
        this.subject = rs.getString("subject");
        this.choiceA = rs.getString("choice_a");
        this.choiceB = rs.getString("choice_b");
        this.choiceC = rs.getString("choice_c");
        this.choiceD = rs.getString("choice_d");
        this.answer = rs.getString("answer");
    }
    
    //get/set方法
    
    public String getQuestionId()
    {
        return questionId;
    }
    public void setQuestionId( String questionId )
    {
        this.questionId = questionId;
    }
    
    public String getCategoryId()
    {
        return categoryId;
    }
    public void setCategoryId( String categoryId )
    {
        this.categoryId = categoryId;
    }
    
    public String getDifficulty()
    {
        return difficulty;
    }
    public void setDifficulty( String difficulty )
    {
        this.difficulty = difficulty;
    }
    
    public String getSubject()
    {
        return subject;
    }
    public void setSubject( String subject )
    {
        this.subject = subject;
    }
    
    public String getChoiceA()
    {
        return choiceA;
    }
    public void setChoiceA( String choiceA )
    {
        this.choiceA = choiceA;
    }
    
    public String getChoiceB()
    {
        return choiceB;
    }
    public void setChoiceB( String choiceB )
    {
        this.choiceB = choiceB;
    }
    
    public String getChoiceC()
    {
        return choiceC;
    }
    public void setChoiceC( String choiceC )
    {
        this.choiceC= choiceC;
    }
    
    public String getChoiceD()
    {
        return choiceD;
    }
    public void setChoiceD( String choiceD )
    {
        this.choiceD = choiceD;
    }
    
    public String getAnswer()
    {
        return answer;
    }
    public void setAnswer( String answer )
    {
        this.answer = answer;
    }
}

⌨️ 快捷键说明

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