<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @author TESI
 */
public class ReadKeyboard {

    public static void main(String[] args)
    {
        BufferedReader kbd;
        String linea, s;
        int n;

        // Open the standard input (the keyboard by default)
        kbd = new BufferedReader(new InputStreamReader(System.in));

        try {
            // Strings are easy
            System.out.print("Write a string: ");
            linea = kbd.readLine();

            // Numbers should be converted from string to number
            System.out.print("Write an integer: ");
            s = kbd.readLine();
            n = Integer.parseInt(s);
            System.out.println("The string is: " + linea + " and the integer is: " + n);
        }
        catch (Exception e) {
            System.out.println("Error: " + e);
        }
    }
}
</pre></body></html>