Jump to content

Simple do while <Java>

- - - - -

  • Please log in to reply
No replies to this topic

#1
Turk4n

Turk4n

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 3,847 posts
import java.util.*;

class TestCLass	{

	public static void main(String args[])	{

		char choice;

		String in;

		Scanner myScanner = new Scanner(System.in);

	do {

		System.out.print("Type Q to Quit: ");

		in = myScanner.next();

		choice = in.charAt(0);

	if(choice == 'Q' || choice == 'q') {

		break;

	}

	else 

		continue;

	}

		while(choice != 'Q' || choice != 'q');	

	}

}
Enjoy.
Posted Image




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users