I was looking through O’Reillys Java Cookbook (2ed) for some good stuff and found Scanner.create() method about 10 times. But there’s no such in the API or class declaration\implementation. Ex: Page example
I was looking through O’Reillys Java Cookbook (2ed) for some good stuff and found
Share
It’s either referring to a non-SDK Scanner type or is an error in the book.
There is no
static Scanner Scanner.create()in Java 1.5/5 (when it was introduced), or in the SDK 6 or SDK 7 APIs. There is also no mention of such a method being obsoleted (which, in Java SDK API, effectively means it never [officially] existed :-).Update note: It appears that the
createfactory method did indeed exist in the earliest preview/beta versions of Java 5. RanRag found a relevant thread on the issue:(So the only correct way to is use the constructor.)
Happy coding.