Skip to content

Instantly share code, notes, and snippets.

@uncoded-ro
Created January 12, 2020 07:09
Show Gist options
  • Save uncoded-ro/9dcfdfd60376412bca663c5825ed61e8 to your computer and use it in GitHub Desktop.
Save uncoded-ro/9dcfdfd60376412bca663c5825ed61e8 to your computer and use it in GitHub Desktop.
package ro.virtualcampus.read;
import java.io.IOException;
public class ReadIn {
public static void main(String args[]) {
char c;
System.out.print("introduceti un caracter: ");
try {
c = (char) System.in.read();
System.out.println("ati introdus caracterul " + c);
System.out.println("cod ASCII caracter " + (int) c);
} catch (IOException e) {
System.out.println("eroare citire");
e.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment