Why is the if statement line an error? im trying to get an if statement after a random boolean. is this possible?
package lieDetector;
import java.util.Random;
import java.util.Scanner;
public class LieDetector {
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
System.out.println("Type In a Question here");
String q1 = scanner.nextLine();
System.out.println("Insert Answer here");
String a1 = scanner.nextLine();
}public boolean getRandomBoolean() {
Random random = new Random();
return random.nextBoolean();
if (random.boolean == true);
System.out.println("you are telling the truth");
}
}
Aucun commentaire:
Enregistrer un commentaire