Counting substring, while loop
- by user1554786
public class SubstringCount
{
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
System.out.println("Enter a word longer than 4 characters, and press q to quit");
int count = 0;
while (scan.hasNextLine())
{
System.out.println("Enter a word longer than 4 characters, and press q to…