java in a nutshell a5th edition

1.3K 3.2K 0
java in a nutshell a5th edition

Đ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

www.traintelco.com www.traintelco.com JAVA TM IN A NUTSHELL Downloa d f r o m W o w ! e B o o k < w w w.woweb o o k . c o m > www.traintelco.com Other Java ™ resources from O’Reilly Related titles Learning Java ™ Java ™ Cookbook Java ™ Threads Java ™ 5.0 Tiger: A Developer’s Notebook Better, Faster, Lighter Java ™ Enterprise JavaBeans ™ Head First Java ™ Java ™ Network Programming Java Books Resource Center java.oreilly.com is a complete catalog of O’Reilly’s books on Java and related technologies, including sample chap- ters and code examples. OnJava.com is a one-stop resource for enterprise Java de- velopers, featuring news, code recipes, interviews, weblogs, and more. Conferences O’Reilly Media brings diverse innovators together to nur- ture the ideas that spark revolutionary industries. We specialize in documenting the latest tools and systems, translating the innovator’s knowledge into useful skills for those in the trenches. Visit conferences.oreilly.com for our upcoming events. Safari Bookshelf (safari.oreilly.com) is the premier online reference library for programmers and IT professionals. Conduct searches across more than 1,000 books. Sub- scribers can zero in on answers to time-critical questions in a matter of seconds. Read the books on your Book- shelf from cover to cover or simply flip to the page you need. Try it today with a free trial. www.traintelco.com Fifth Edition JAVA TM IN A NUTSHELL David Flanagan Beijing • Cambridge • Farnham • Köln • Sebastopol • Tokyo www.traintelco.com Java ™ in a Nutshell, Fifth Edition by David Flanagan Copyright © 2005, 2002, 1999, 1997, 1996 O’Reilly Media, Inc. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (safari.oreilly.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 or corporate@oreilly.com. Editors: Debra Cameron and Mike Loukides Production Editor: Jamie Peppard Cover Designer: Edie Freedman Interior Designer: David Futato Printing History: February 1996: First Edition. May 1997: Second Edition. November 1999: Third Edition. March 2002: Fourth Edition. March 2005: Fifth Edition. Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. The In a Nutshell series designations, Java in a Nutshell, the image of the Javan tiger, and related trade dress are trademarks of O’Reilly Media, Inc. Java™ and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc., in the United States and other countries. O’Reilly Media, Inc. is independent of Sun Microsystems. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein. ISBN: 978-0-596-00773-7 [TG] [2011-07-22] www.traintelco.com This book is dedicated to all who teach peace and resist violence. www.traintelco.com www.traintelco.com vii This is the Title of the Book, eMatter Edition Copyright © 2011 O’Reilly & Associates, Inc. All rights reserved. Table of Contents Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii Part I. Introducing Java 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 What Is Java? 1 The Java Programming Language 1 The Java Virtual Machine 2 The Java Platform 2 Versions of Java 3 Key Benefits of Java 4 Write Once, Run Anywhere 4 Security 5 Network-Centric Programming 5 Dynamic, Extensible Programs 5 Internationalization 6 Performance 6 Programmer Efficiency and Time-to-Market 6 An Example Program 7 Compiling and Running the Program 7 Analyzing the Program 9 Exceptions 15 2. Java Syntax from the Ground Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Java Programs from the Top Down 18 www.traintelco.com viii | Table of Contents This is the Title of the Book, eMatter Edition Copyright © 2011 O’Reilly & Associates, Inc. All rights reserved. Lexical Structure 18 The Unicode Character Set 18 Case-Sensitivity and Whitespace 19 Comments 19 Reserved Words 20 Identifiers 20 Literals 21 Punctuation 21 Primitive Data Types 21 The boolean Type 22 The char Type 22 Strings 24 Integer Types 24 Floating-Point Types 25 Primitive Type Conversions 26 Expressions and Operators 28 Operator Summary 28 Arithmetic Operators 32 String Concatenation Operator 33 Increment and Decrement Operators 34 Comparison Operators 34 Boolean Operators 35 Bitwise and Shift Operators 37 Assignment Operators 39 The Conditional Operator 39 The instanceof Operator 40 Special Operators 40 Statements 42 Expression Statements 42 Compound Statements 43 The Empty Statement 43 Labeled Statements 43 Local Variable Declaration Statements 43 The if/else Statement 44 The switch Statement 46 The while Statement 48 The do Statement 49 The for Statement 49 The for/in Statement 50 The break Statement 54 The continue Statement 54 The return Statement 55 The synchronized Statement 55 The throw Statement 56 The try/catch/finally Statement 58 The assert Statement 60 www.traintelco.com [...]... 5.0 Finally, as a quick tutorial introduction to the language, it walks you through a simple Java program you can type, compile, and run What Is Java? In discussing Java, it is important to distinguish between the Java programming language, the Java Virtual Machine, and the Java platform The Java programming language is the language in which Java applications, applets, servlets, and components are written... chapter is an overview of the Java language and the Java platform that explains the important features and benefits of Java It concludes with an example Java program and walks the new Java programmer through it line by line Chapter 2: Java Syntax from the Ground Up This chapter explains the details of the Java programming language, including some of the Java 5.0 language changes It is a long and detailed... Java VM The Java platform is the predefined set of Java classes that exist on every Java installation; these classes are available for use by all Java programs The Java platform is also sometimes referred to as the Java runtime environment or the core Java APIs (application programming interfaces) The Java platform can be extended with optional packages (formerly called standard extensions) These APIs... the Java language and the Java platform These chapters provide enough information for you to get started using Java right away Chapter 1, Introduction Chapter 2, Java Syntax from the Ground Up Chapter 3, Object-Oriented Programming in Java Chapter 4, Java 5.0 Language Features Chapter 5, The Java Platform Chapter 6, Java Security Chapter 7, Programming and Documentation Conventions Chapter 8, Java Development... • java. lang.management These packages support Java 5.0 annotations and the instrumentation, management, and monitoring of a running Java interpreter Although their position in the java. lang hierarchy marks these packages as very important, they are not commonly used Annotation examples are provided in Chapter 4, and a simple instrumentation and management example is found in Chapter 5 • New packages... run remarkably fast Of particular note is a VM technology called just -in- time (JIT) compilation whereby Java byte codes are converted on the fly into native platform machine language, boosting execution speed for code that is run repeatedly The Java Platform The Java platform is just as important as the Java programming language and the Java Virtual Machine All programs written in the Java language rely... Java platform, you can write applications in Java without sacrificing the advanced features available to programmers writing native applications targeted at a particular underlying operating system An application written on the Java platform runs on any operating system that supports the Java platform This means you do not have to create distinct Windows, Macintosh, and Unix versions of your programs,... the Java platform means that a Java application can dynamically extend itself by loading new classes over a network An application that takes advantage of these features ceases to be a monolithic block of code Instead, it becomes an interacting collection of independent software components Thus, Java enables a powerful new metaphor of application design and development Internationalization The Java language... Interface (JNDI) and the Java Sound APIs, which were previously available as extensions to the platform The most interesting classes in this release were probably java. util.Timer and java. lang.reflect.Proxy In total, Java 1.3 contains 1,842 classes in 76 packages Java 1.4 This was another big release, adding important new functionality and increasing the size of the platform by 62% to 2,991 classes and interfaces... exist in some Java installations but are not guaranteed to exist in all installations The Java Programming Language The Java programming language is a state-of-the-art, object-oriented language that has a syntax similar to that of C The language designers strove to make the Java language powerful, but, at the same time, they tried to avoid the overly 1 This is the Title of the Book, eMatter Edition . titles Learning Java ™ Java ™ Cookbook Java ™ Threads Java ™ 5.0 Tiger: A Developer’s Notebook Better, Faster, Lighter Java ™ Enterprise JavaBeans ™ Head First Java ™ Java ™ Network Programming Java. includes important utilities for threadsafe concurrent programming. Chapter 5 provides examples. • java. lang has three new subpackages: • java. lang.annotation • java. lang.instrument • java. lang.management These. registered trademarks of O’Reilly Media, Inc. The In a Nutshell series designations, Java in a Nutshell, the image of the Javan tiger, and related trade dress are trademarks of O’Reilly Media, Inc. Java

Ngày đăng: 27/10/2014, 00:47

Từ khóa liên quan

Mục lục

  • Table of Contents

    • apt 326

    • extcheck 327

    • jarsigner 328

    • jar 329

    • java 332

    • javac 338

    • javadoc 342

    • javah 348

    • javap 349

    • javaws 351

    • jconsole 352

    • jdb 353

    • jinfo 357

    • jmap 358

    • jps 358

    • jsadebugd 359

    • jstack 359

    • jstat 360

    • jstatd 362

    • keytool 362

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

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

Tài liệu liên quan