public static void main(String[] args) throws Exception {
String id = "TV1523";
BufferedReader br = new BufferedReader((new InputStreamReader(System.in)));
String tocompare = br.readLine();
if(tocompare.equals(id)) { //do stuff
something like that, except you might wand to enclose the readLine() within a try catch instead :x