java 1.5, a developer's notebook, 2004

231 564 0
java 1.5, a developer's notebook, 2004

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

[...]... PriorityQueueTester [java] 1 Chapter 1 What's New? Pagina 10 di 17 [java] 2 [java] 3 [java] 4 [java] 5 [java] 6 [java] 7 [java] 8 [java] 9 [java] 10 [java] 11 [java] 12 [java] 13 [java] 14 [java] 15 [java] 16 [java] 17 [java] 18 [java] 19 [java] 20 However, this queue starts to really come into its own when you provide your own comparator, as shown in Example 1-3 This is done via the constructor, and a custom... [java] 14 [java] 16 [java] 18 [java] 20 [java] 1 [java] 3 [java] 5 [java] 7 [java] 9 [java] 11 [java] 13 [java] 15 [java] 17 [java] 19 1.4 Overriding Return Types One of the most annoying features when you're using Java inheritance is the inability to override return types This is most commonly desired when you've got a base class, and then a subclass adds a dimension (either literally or figuratively)... creating web games, futilely trying to catch up to its "big brothers," C and C++ While AWT and Swing (and now SWT) are important parts of the Java language, Java has also evolved to take on more far-ranging tasks— database interaction, financial management, e-commerce, and more Its speed is comparable to C, and its APIs are farreaching As a result, the core language has undergone significant stabilization,... that much closer to feeling like you are indeed learning from a master And most of all, remember—these books are All Lab, No Lecture —Brett McLaughlin, Series Creator Preface Pagina 1 di 6 Preface Professional Java Enterprise Java Commercial Java These are all terms that are commonplace in programming discussions these days—and for good reason Gone are the days when Java was considered a toy language... user interface buttons and menus Constant width is used for: l Anything that appears literally in a JSP page or a Java program, including keywords, data types, constants, method names, variables, class names, and interface names l Command lines and options that should be typed verbatim on the screen l All JSP and Java code listings l HTML documents, tags, and attributes Constant width italic is used... false, and the second true: [java] Boards 1 and 2 are not equal [java] Boards 1 and 3 are equal 1.1.2 What About hash codes? Java 101 dictates that every good equals( ) method should be paired with an equivalent hashCode( ), and the Arrays class is no exception Arrays defines both hashCode( ) and deepHashCode( ) methods for just this purpose I'll leave it to you to play with these, but they are self-explanatory:... particularly helpful if you have an array of numeric primitives, which is what Example 1-1 demonstrates (in varied and mostly useless ways) Example 1-1 Using the Arrays utility class package com.oreilly.tiger.ch01; import java. util.Arrays; import java. util.List; Chapter 1 What's New? Pagina 2 di 17 public class ArraysTester { private int[] ar; public ArraysTester(int numValues) { ar = new int[numValues];... O'Reilly Media, Inc 1005 Gravenstein Highway North Preface Pagina 5 di 6 Sebastopol, CA 95472 (800) 998-9938 (in the United States or Canada) (707) 829-0515 (international or local) (707) 829-0104 (fax) We have a web page for this book, where we list errata, examples, or any additional information You can access this page at: www.oreilly.com/catalog/javaadn/ To comment or ask technical questions about this...The Developer's Notebook Series Pagina 3 di 3 Organization Developer's Notebooks try to communicate different information than most books, and as a result, are organized differently They do indeed have chapters, but that's about as far as the similarity between a notebook and a traditional programming book goes First, you'll find that all the headings in each chapter are organized around a specific task... and readers of this book and Java in a Nutshell will be hard-pressed to find any duplication of prose In a few cases, Brett has used code samples that also appear in Java in a Nutshell, and in each case that fact is mentioned in the margin About the Examples This book has hundreds of code examples, spread throughout its pages While some complete code listings are shown in the text, other examples are . of a laboratory notebook, and related trade dress are trademarks of O'Reilly Media, Inc. Java and all Java- based trademarks and logos are trademarks. AWT and Swing (and now SWT) are important parts of the Java language, Java has also evolved to take on more far-ranging tasks— database interaction, financial

Ngày đăng: 20/03/2014, 15:39

Từ khóa liên quan

Mục lục

  • Table of Contents

  • The Developer's Notebook Series

  • Preface

    • Organization

    • How This Book Was Written

    • About the Examples

    • Conventions Used in This Book

    • How to Contact Us

    • Acknowledgments from Brett

    • Acknowledgments from David

    • Chapter 1. What's New?

      • 1.1 Working with Arrays

      • 1.2 Using Queues

      • 1.3 Ordering Queues Using Comparators

      • 1.4 Overriding Return Types

      • 1.5 Taking Advantage of Better Unicode

      • 1.6 Adding StringBuilder to the Mix

      • Chapter 2. Generics

        • 2.1 Using Type-Safe Lists

        • 2.2 Using Type-Safe Maps

        • 2.3 Iterating Over Parameterized Types

        • 2.4 Accepting Parameterized Types as Arguments

        • 2.5 Returning Parameterized Types

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan