Skip to content

Instantly share code, notes, and snippets.

@claraj
Last active August 13, 2016 16:24
Show Gist options
  • Save claraj/2f0b5960c01a62c4c27e335f22925260 to your computer and use it in GitHub Desktop.
Save claraj/2f0b5960c01a62c4c27e335f22925260 to your computer and use it in GitHub Desktop.
package com.company;
import java.util.Scanner;
public class Main {
//Create two scanners, one for Strings, and one for numbers - int and float values.
static Scanner stringScanner = new Scanner(System.in);
static Scanner numberScanner = new Scanner(System.in);
public static void main(String[] args) {
// Write your code between here...
// ... and here.
// Close scanners. Good practice to clean up resources you use.
// Don't try to use scanners after this point. All code that uses scanners goes above here.
stringScanner.close();
numberScanner.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment