Flylib.com

Books Software

 
 
 

Copyright


Copyright

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 Addison-Wesley was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals.

The authors and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein.

The publisher offers discounts on this book when ordered in quantity for bulk purchases and special sales. For more information, please contact:

         U.S.  Corporate  and  Government  Sales
         (800)  382-3419
         corpsales@pearsontechgroup.com

For sales outside of the U.S., please contact:

         International  Sales
         (317)  581-3793
         international@pearsontechgroup.com

Visit Addison-Wesley on the Web: www.awprofessional.com

Library of Congress Cataloging-in-Publication Data is available.

Copyright 2004 by Pearson Education, Inc.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form, or by any means, electronic, mechanical, photocopying, recording, or otherwise , without the prior consent of the publisher. Printed in the United States of America. Published simultaneously in Canada.

For information on obtaining permission for use of material from this work, please submit a written request to:

         Pearson  Education,  Inc.
         Rights  and  Contracts  Department
         75  Arlington  Street,  Suite  300
         Boston,  MA  02116
         Fax:  (617)  848-7047

Text printed on recycled paper

1 2 3 4 5 6 7 8 9 10 ”CRS ”0706050403

First printing, August 2003

Dedication

To the loving memory of my mother, Zubaida Begum, and my father, Mohammed Azim.

”K. A.M.

For Olivia E. Rasmussen and Louise J. Dahlmo.

”R.W.R.


List of Figures

Chapter 1

1.1 UML Notation for Classes

1.2 UML Notation for Objects

1.3 Aliases

1.4 Class Diagram Showing Static Members of a Class

1.5 Members of a Class

1.6 Class Diagram Depicting Inheritance Relation

1.7 Class Diagram Depicting Aggregation

Chapter 2

2.1 Primitive Data Types in Java

2.2 Java Source File Structure

Chapter 3

3.1 Widening Numeric Conversions

3.2 Overflow and Underflow in Floating-point Arithmetic

3.3 Numeric Promotion in Arithmetic Expressions

3.4 Parameter Passing: Primitive Data Values

3.5 Parameter Passing: Object Reference Values

3.6 Parameter Passing: Arrays

Chapter 4

4.1 Array of Arrays

4.2 Block Scope

4.3 Package Hierarchy

4.4 Public Accessibility

4.5 Protected Accessibility

4.6 Default Accessibility

4.7 Private Accessibility

Chapter 5

5.1 Activity Diagram for if Statements

5.2 Activity Diagram for switch Statement

5.3 Activity Diagram for while Statement

5.4 Activity Diagram for do-while Statement

5.5 Activity Diagram for the for Statement

5.6 Method Execution

5.7 Exception Propagation

5.8 Partial Exception Inheritance Hierarchy

5.9 try-catch-finally Block

5.10 Exception Handling (Scenario 1)

5.11 Exception Handling (Scenario 2)

5.12 Exception Handling (Scenario 3)

5.13 Execution of the Simple assert Statement (When Assertions Are Enabled)

Chapter 6

6.1 Inheritance Hierarchy

6.2 Inheritance Relationship between String and Object Classes

6.3 Inheritance Relations

6.4 Reference Type Hierarchy

6.5 Polymorphic Methods

6.6 Implementing Data Structures by Inheritance and Aggregation

Chapter 7

7.1 Static Member Classes and Interfaces

7.2 Outer Object with Associated Inner Objects

Chapter 8

8.1 Memory Organization at Runtime

Chapter 9

9.1 Spawning Threads Using a Runnable Object

9.2 Spawning Threads ”Extending the Thread Class

9.3 Thread States

9.4 Running and Yielding

9.5 Sleeping and Waking up

9.6 Waiting and Notifying

9.7 Thread Communication

9.8 Stack Users

9.9 Joining of Threads

9.10 Deadlock

Chapter 10

10.1 Partial Inheritance Hierarchy in the java.lang Package

10.2 Converting Values between Primitive, Wrapper, and String Types

Chapter 11

11.1 The Core Interfaces

11.2 The Core Collection Interfaces and Their Implementations

11.3 The Core Map Interfaces and Their Implementations

11.4 Bulk Operations on Collections

G.1 Converting between Binary, Octal, and Hexadecimal