This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
I'm a beginner programmer and I'm just really getting to grips with the language. A few people have pointed me in the direction of the API documentation in order to find out what methods are available. I also have Horstmann and Cornell to refer to which covers JDK up to 1.5.
Sadly I am finding inconsistencies between these sources of information and I wonder if someone can help to explain where I should put my faith. For example, on pages 56-59 of the 7th edition of the book the authors mention a String class and a Scanner class. Neither of these classes exist in the API documentation for JDK 1.7 which presumably should be the most up to date document. However the example 3-2 InputTest.java on page 59 compiles perfectly well under JDK 1.7.
Has there been a change in the structure of 1.7 and if so how much importance should I give to H&C. Is the book now outdated or is there more information I need besides the JDK 1.7 API documentation to see what methods are available?
Thanks ... that is fine if you already know about it. My problem is that I don't and I would naively have thought if it wasn't contained in the API documentation which I installed on my computer when I installed Java 1.7 that it might have been superceeded.
Where did you get your API documentation from ? The String class has been in Java from the start and the Scanner class since Java 1.5.
And (as far as I know) no publicly defined class has ever been removed from the Java API. Some have been marked as deprecated with a warning that they may be removed from future releases but I don't believe this has ever happened.
Bill Jillians
Greenhorn
Joined: May 01, 2012
Posts: 22
posted
0
Adrian Burkett wrote:Where did you get your API documentation from ? The String class has been in Java from the start and the Scanner class since Java 1.5.
And (as far as I know) no publically defined class has ever been removed from the Java API. Some have been marked as deprecated with a warning that they may be removed from future releases but I don't believe this has ever happened.
Ah .. its OK ... looks like I rushed to post too soon. The link I was given in another post has the String class. The version I was looking at on my computer seems to be missing some key information. OK .. I know where to look now.
As you work through the book, I suggest you use this API: http://docs.oracle.com/javase/1.5.0/docs/api/ That way you'll know the docs and the text are in sync. You can always update your knowledge to version 7 when you're done with the book.
Bill Jillians
Greenhorn
Joined: May 01, 2012
Posts: 22
posted
0
Dennis Deems wrote:As you work through the book, I suggest you use this API: http://docs.oracle.com/javase/1.5.0/docs/api/ That way you'll know the docs and the text are in sync. You can always update your knowledge to version 7 when you're done with the book.
Thanks for that. I've bookmarked this link and also the one for 1.7. I didn't realize that once a feature is introduced in the API it doesn't get removed later. That helps my general understanding.
And if all else fails, you can always use the JavaRanch message editor. You don't even have to click "Submit" to post your message if all you need is a handy link to get to the JavaDocs. Type in the fully qualified name of the class in the editor, then click on the "Preview" button. The preview will display the class name as a link to the API documentation if it's a standard Java class.