Java Scanner Usage nextInt(final Scanner sc)

Here you can find the source of nextInt(final Scanner sc)

Description

next Int

License

Open Source License

Declaration

public static int nextInt(final Scanner sc) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.InputMismatchException;
import java.util.Scanner;

public class Main {
    public static int nextInt(final Scanner sc) {
        try {// www  .  jav a  2  s. c  o m
            return sc.nextInt();
        } catch (final InputMismatchException ime) {
            return 0;
        }
    }
}

Related

  1. listify(String s, String prefix, String... ignorelist)
  2. loadElements(Scanner scan, int elementCount, int skipCount)
  3. loadStringDoubleMap(Scanner scanner)
  4. menu()
  5. nextChar(Scanner s)
  6. numberOfLines(String text)
  7. OperasiMasukan()
  8. parameterInput(int start, int end)
  9. parse_str_vector(String str_vector)