You are right, it doesn't print out "state" variable. Those 6 7 8 9 are thread ID (printed by "Thread.currentThread().getID()") and you don't need to know why they are not 11, 310 etc. (As you see, all options start as 6 7 8, so this number is not important)
The key thing you need to know is three threads execution go to wait(), and one thread go to notify()/notifyall() and this behavior is because all threads share the access to "state" variable (not concurrently though). And it also tests "synchronized" and "thread execution order is not guaranteed" concepts