I'm trying to create a quiz project on Java. The code seeems to be going fine. However, I want it to only take only String as an
public class Question { String prompt; String answer; public Question(String prompt, String answer) { this.prompt = prompt; this.answer = answer; } } import java.util.Scanner; public class App { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here String q1 = "What is the hottest planet in the Solar System?\n" + "a. Mercury\nb. Venus\nc. Jupiter"; String q2 = "Who is the hottest instructor in the IT Department?\n" + "a. Sir Harly\nb. Sir Daryll\nc. Sir Rhady"; String q3 = "What is largest planet in the Solar System\n" + "a. Mercury\nb. Venus\nc. Jupiter"; String q4 = "What is the closest planet in the Sun?\n" + "a. Mercury\nb. Venus\nc. Jupiter"; String q5 = "What is the Earth's 'Twin Sister'?\n" + "a. Mercury\nb. Venus\nc. Jupiter"; String q6 = "Which among these three is a 'Gas Giant'?\n" + "a. Mercury\nb. Venus\nc. Jupiter"; String q7 = "What planet is Olympus Mons located?\n" + "a. Saturn\nb. Mars\nc. Uranus"; String q8 = "Which among these three planet doesn't have a ring?\n" + "a. Saturn\nb. Mars\nc. Uranus"; String q9 = "Which of these planet appears to spin on its side, orbiting the Sun like a rolling ball.?\n" + "a. Saturn\nb. Mars\nc. Uranus"; String q10 = "On which planet does the Great Red Spot, a long-lived enormous storm system, located?\n" + "a. Jupiter\nb. Mars\nc. Uranus"; Question [] questions = { new Question(q1, "b"), new Question(q2, "a"), new Question(q3, "c"), new Question(q4, "a"), new Question(q5, "b"), new Question(q6, "c"), new Question(q7, "b"), new Question(q8, "b"), new Question(q9, "c"), new Question(q10, "a") } ; takeTest(questions); } publ