I am trying to create a method for my program that, when called, will ask you to press enter to continue. However, BlueJ gives me an error message saying ' expected'. Below is my code
Note: the continue class hasn't been fully finished yet.
import java.util.Scanner;
public class BlackjackRunner
{
public static void main (String[]args)
{
System.out.print("Ready to play Blackjack(y/n)? =====> ");
Scanner input = new Scanner(System.in);
String response = input.nextLine();
System.out.println();
if(response.charAt(0) != 'y' || response.charAt(0)!= 'Y')
System.out.println("Too bad, you play");
else
System.out.println("Good.");
}
public static void*** continue()
{
System.out.println("-----PRESS ENTER TO CONTINUE-----");
Scanner wait = new Scanner(System.in);
}
}
BlueJ gives an error message after the void statement (where the ***
is). I am not exactly sure why this is incorrect. If someone could explain/help, that would be wonderful.