Absolute JavaBest-selling author Walt Savitch offers students a comprehensive introduction of the java programming language. The hallmark feature of his accessible writing style is predominate in this text, along with the needed tools and java topics for novice and experienced programmers to master the java language. In this second edition he takes full advantage of the new java 5.0 features and incorporates the new Scanner class, automatic boxing and unboxing, System.out.pintf for formatting output and enhanced for loop. There is comprehensive coverage of generic types, including how to define classes with type parameters, collection classes done as generic classes, and linked lists done with type parameters. Pedagogical features are integrated throughout including: pitfalls, programming tips, and self-test exercises and answers. This book is appropriate for introductory courses covering Java and intermediate programming courses introducing Java to students familiar with another language. |
From inside the book
Results 1-3 of 43
... Iterator Interface Java has an interface named Iterator that specifies how Java would like an iterator to behave . It is in the package java.util ( and so requires that you import this package ) . Our iterators do not quite satisfy this ...
... Iterator < T > iterator ( ) Returns an iterator for the calling object . ( Iterators are discussed in Section 16.2 . ) public Object [ ] toArray ( ) Returns an array containing all of the elements in the calling object . If the calling ...
... iterator ( ) , and if need be , the method listIterator ( ) , which takes care of iterators . However , if you should need to define a collection class in some other way , then the best way to define your iterator class or classes is to ...