Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package person;
- public class Student
- {
- int age = 10;
- String s = "Jared's age is " + age;
- int year = 1998;
- String s1 = "Jared's year is " + year;
- {
- Major Major = new Major();
- String s = Major.toString();
- }
- }
- package person;
- public class Instructor
- {
- int age = 35;
- String s = "Justin's age is " + age;
- int year = 1984;
- String s1 = "Justin's year is " + year;
- {
- Salary Salary = new Salary();
- String s = Salary.toString();
- }
- }
- public class AnyCorrectChoiceQuestion
- {
- private String text;
- private String answer;
- public AnyCorrectChoiceQuestion()
- {
- text = "";
- answer = "";
- }
- public void setText(String questionText)
- {
- text = questionText;
- }
- public void setAnswer(String correctResponse)
- {
- answer = correctResponse;
- }
- public boolean checkAnswer(String response)
- {
- return response.equals(answer);
- }
- public void display()
- {
- System.out.println(text);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement