Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.foo;
- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- import java.util.Scanner;
- public class SomeClass {
- public static void main(final String[] args) throws IOException {
- char i;
- String a;
- final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
- try (Scanner sc = new Scanner(System.in)) {
- a = sc.next();// input: 2
- i = (char) br.read(); // input: 2
- System.out.println(i);// output: 2
- System.out.println(a);// output: 2
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement