It is absolutely non-sensical to forbid using the hasNext() method.
That said, while breaking the "rules" of your question, you should be using the following idiom:
while (scanner.hasNext()) {
String s = scanner.next();
// do stuff...
}
If your situation is that you are curious, then sure, a NoSuchElementException will be thrown when there are no more tokens to be read. The only way to "check" this is a try-catch block. It will not return null in the case of an exception. Your program will simply die, provided you don't handle the exception...