If I am scanning from a text
Scanner s= new Scanner(\"texto.txt\");
// I want to compare the next char from the line with a <>
<
Consider dumping Scanner and using FileReader:
FileReader fileReader = new FileReader("textto.txt"); int charRead while( (charRead = fileReader.read()) != -1) { if(charRead == '<') { //do something } }