Check out example codes for "java stdin". It will help you in understanding the concepts better.

Code Example 1

public static void main(String[] args) {
        StdOut.print("Type an int: ");
        int a = StdIn.readInt();
        StdOut.println("Your int was: " + a);
        StdOut.println();
    }
}

Learn ReactJs, React Native from akashmittal.com