-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuestions.java
More file actions
63 lines (53 loc) · 1.46 KB
/
Questions.java
File metadata and controls
63 lines (53 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import java.util.ArrayList;
public class Questions {
private int id;
private String Statement;
private ArrayList<Integer> clos;
//constructor
public Questions(int id,String statement, ArrayList<Integer> clos) {
this.id=id;
Statement = statement;
this.clos = clos;
}
//print Question
public void printQuestion() {
if(this!=null)
{
System.out.println("ID : "+this.getId());
System.out.println("Statement : "+this.getStatement());
if(this.clos!=null && !clos.isEmpty()){
for (int i = 0; i < clos.size(); i++) {
System.out.print("Clos "+clos.get(i)+" ");
}
}
System.out.println('\n');
}
}
//custom function
public boolean checkCLO(int clo){
if(this.clos!=null && !this.clos.isEmpty())
for (int i = 0; i < this.clos.size(); i++) {
if(this.clos.get(i)==clo)
{
return true;
}
}
return false;
}
//////////////getter setters////////////
public int getId() {
return id;
}
public String getStatement() {
return Statement;
}
public ArrayList<Integer> getClos() {
return clos;
}
public void setStatement(String statement) {
Statement = statement;
}
public void setClos(ArrayList<Integer> clos) {
this.clos = clos;
}
}