Package java.util

Examples of java.util.Scanner.nextLine()


            "that are provided as JUnit tests.");
    System.out.println("\t--> You can also connect to the server on port '" + crLfServer.getPort() + "' using Telnet.\n\n");

    while (true) {

      final String input = scanner.nextLine();

      if("q".equals(input.trim())) {
        break;
      }
      else {
View Full Code Here


    System.out.print("Please enter 'list' and press <enter> to get a list of coffees.");
    System.out.print("Enter a coffee id, e.g. '1' and press <enter> to get a description.\n\n");

    while (!scanner.hasNext("q")) {

      String input = scanner.nextLine();

      if ("list".equalsIgnoreCase(input)) {
        List<CoffeeBeverage> coffeeBeverages = service.findAllCoffeeBeverages();

        for (CoffeeBeverage coffeeBeverage : coffeeBeverages) {
View Full Code Here

public class Application {

  public static void main(String[] args) throws Exception {
    ConfigurableApplicationContext ctx = SpringApplication.run(Application.class, args);
    Scanner scanner = new Scanner(System.in);
    String hashTag = scanner.nextLine();
    System.out.println(ctx.getBean(Gateway.class).sendReceive(hashTag));
    scanner.close();
    ctx.close();
  }
View Full Code Here

    System.out.println("\tq. Quit the application");
    System.out.print("Enter your choice: ");

    while (true) {
      final String input = scanner.nextLine();

      if("1".equals(input.trim())) {
        searchA.setExecutionTime(1000L);
        searchB.setExecutionTime(1000L);
        final CompositeResult result = searchRequestor.search(TestUtils.getCompositeCriteria());
View Full Code Here

    }
    System.out.println("\tq. Quit the application");
    System.out.print("Enter your choice: ");

    while (true) {
      final String input = scanner.nextLine();

      if("q".equals(input.trim())) {
        System.out.println("Exiting application...bye.");
        System.exit(0);
      } else {
View Full Code Here

        System.out.print("Please enter a non-negative numeric value and press <enter>: ");

        while (true) {
         
          final String input = scanner.nextLine();
         
          if("q".equals(input.trim())) {
            break;
          }
         
View Full Code Here

          + "\n=========================================================" );

    System.out.print("Please enter a string and press <enter>: ");

    while (!scanner.hasNext("q")) {
      String input = scanner.nextLine();

      System.out.println("Converting String to Uppcase using Stored Procedure...");
      String inputUpperCase = service.convertToUpperCase(input);

      System.out.println("Retrieving Numeric value via Sql Function...");
View Full Code Here

          + "\n"
          + HORIZONTAL_LINE );

    while (true) {

      final String input = scanner.nextLine();

      if("q".equals(input.trim())) {
        break;
      }
View Full Code Here

    System.out.println("\t1. Find person details");
    System.out.println("\t2. Create a new person detail");
    System.out.println("\tq. Quit the application");
    System.out.print("Enter you choice: ");
    while (true) {
      final String input = scanner.nextLine();
      if("1".equals(input.trim())) {
        getPersonDetails(scanner, personService);
      } else if("2".equals(input.trim())) {
        createPersonDetails(scanner,personService);
      } else if("q".equals(input.trim())) {
View Full Code Here

      final Scanner numScan = new Scanner(f);

      String line;

      while (numScan.hasNext()) {
        line = numScan.nextLine();
        if (line.contains(lineStop)) {

          s.close();
          numScan.close();
          return true;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.