Java Scanner Usage menu()

Here you can find the source of menu()

Description

menu

License

Apache License

Declaration

public static int menu() 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.Scanner;

public class Main {

    public static int menu() {
        int selection;
        Scanner input = new Scanner(System.in);

        System.out.println("Please enter a number to perfom the desired operation");
        System.out.println("-------------------------\n");
        System.out.println("1 - Call the international geocoding API provided by PostCodeAnywhere (SOAP)");
        System.out.println("2 - Call the global weather API provided by WorldWeatherOnline (REST)");
        System.out.println("3 - Quit");

        selection = input.nextInt();//  ww w .ja  v a 2 s  .  c o  m
        return selection;
    }
}

Related

  1. leerTexto(String msgUsr)
  2. listify(String s, String prefix, String... ignorelist)
  3. listify(String s, String prefix, String... ignorelist)
  4. loadElements(Scanner scan, int elementCount, int skipCount)
  5. loadStringDoubleMap(Scanner scanner)
  6. nextChar(Scanner s)
  7. nextInt(final Scanner sc)
  8. numberOfLines(String text)
  9. OperasiMasukan()