Java classic algorithm 90 topic