Docsity
Docsity

Pripremite ispite
Pripremite ispite

Studirajte zahvaljujući brojnim resursima koji su dostupni na Docsity-u


Nabavite poene za preuzimanje
Nabavite poene za preuzimanje

Zaradite bodove pomažući drugim studentima ili ih kupite uz Premium plan


Školska orijentacija
Školska orijentacija


Thinking in Java-Skripta-Principi programiranja-Informacioni sistemi2, Rezime od Osnovi programiranja

Thinking In Java,Skripta,Principi programiranja,Informacioni sistemi,fon,fakultet organizacionih nauka, Objekti, Klase, Osnovni činioci klasa, Odnos klase i objekta, Nasleđivanje, Osnovni pojmovi u Javi. Sintaksa, Osnovna sintaksa, Tipovi podataka,promenjivih, varijabli, About Thinking in C , Introduction to objects, Everything is an object, Controlling program flow, Initialization and cleanup, Hiding the implementation, Reusing classe, Polymorphism, Holding your objects, Error handling with ex

Tipologija: Rezime

2011/2012

Učitan datuma 27.10.2012.

rock.super.star
rock.super.star 🇸🇷

4.8

(8)

85 dokumenti

1 / 848

Toggle sidebar

Ova stranica nije vidljiva u pregledu

Ne propustite važne delove!

bg1
Thinking
in
Java
Bruce Eckel
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Delimični pregled teksta

Preuzmite Thinking in Java-Skripta-Principi programiranja-Informacioni sistemi2 i više Rezime u PDF od Osnovi programiranja samo na Docsity!

Thinking

in

Java

Bruce Eckel

Comments from readers:

Much better than any other Java book I’ve seen. Make that “by an order of magnitude”... very complete, with excellent right-to-the-point examples and intelligent, not dumbed- down, explanations ... In contrast to many other Java books I found it to be unusually mature, consistent, intellectually honest, well-written and precise. IMHO, an ideal book for studying Java. Anatoly Vorobey, Technion University, Haifa, Israel

One of the absolutely best programming tutorials I’ve seen for any language. Joakim Ziegler, FIX sysop

Thank you for your wonderful, wonderful book on Java. Dr. Gavin Pillay, Registrar, King Edward VIII Hospital, South Africa

Thank you again for your awesome book. I was really floundering (being a non-C programmer), but your book has brought me up to speed as fast as I could read it. It’s really cool to be able to understand the underlying principles and concepts from the start, rather than having to try to build that conceptual model through trial and error. Hopefully I will be able to attend your seminar in the not-too-distant future. Randall R. Hawley, Automation Technician, Eli Lilly & Co.

The best computer book writing I have seen. Tom Holland

This is one of the best books I’ve read about a programming language… Chapter 16 on design patterns is one of the most interesting things I’ve read in a long time. Ilan Finci, graduate student and teaching assistant, Institute of Computer Science, The Hebrew University of Jerusalem, Israel

The best book ever written on Java. Ravindra Pai, Oracle Corporation, SUNOS product line

This is the best book on Java that I have ever found! You have done a great job. Your depth is amazing. I will be purchasing the book when it is published. I have been learning Java since October 96. I have read a few books, and consider yours a “MUST READ.” These past few months we have been focused on a product written entirely in Java. Your book has helped solidify topics I was shaky on and has expanded my knowledge base. I have even used some of your explanations as information in interviewing contractors to help our team. I have found how much Java knowledge they have by asking them about things I have learned from reading your book (e.g. the difference between arrays and Vectors). Your book is great! Steve Wilkinson, Senior Staff Specialist, MCI Telecommunications

Great book. Best book on Java I have seen so far. Jeff Sinclair, Software Engineer, Kestral Computing

Thank you for Thinking in Java. It’s time someone went beyond mere language description to a thoughtful, penetrating analytic tutorial that doesn’t kowtow to The Manufacturers. I’ve read almost all the others–only yours and Patrick Winston’s have found a place in my heart. I’m already recommending it to customers. Thanks again. Richard Brooks, Java Consultant, Sun Professional Services, Dallas

Other books cover the WHAT of Java (describing the syntax and the libraries) or the HOW of Java (practical programming examples). Thinking in Java is the only book I know that explains the WHY of Java; why it was designed the way it was, why it works the way it does, why it sometimes doesn’t work, why it’s better than C++, why it’s not. Although it also does a good job of teaching the what and how of the language, Thinking in Java is definitely the thinking person’s choice in a Java book. Robert S. Stephenson

This has to be one of the best Java books I’ve seen. E.F. Pritchard, Senior Software Engineer, Cambridge Animation Systems Ltd., United Kingdom

Your book makes all the other Java books I’ve read or flipped through seem doubly useless and insulting. Brett g Porter, Senior Programmer, Art & Logic

I have been reading your book for a week or two and compared to the books I have read earlier on Java, your book seems to have given me a great start. I have recommended this book to lot of my friends and they have rated it excellent. Please accept my congratulations for coming out with an excellent book. Rama Krishna Bhupathi, Software Engineer, TCSI Corporation, San Jose

Just wanted to say what a “brilliant” piece of work your book is. I’ve been using it as a major reference for in-house Java work. I find that the table of contents is just right for quickly locating the section that is required. It’s also nice to see a book that is not just a rehash of the API nor treats the programmer like a dummy. Grant Sayer, Java Components Group Leader, Ceedata Systems Pty Ltd, Australia

Wow! A readable, in-depth Java book. There are a lot of poor (and admittedly a couple of good) Java books out there, but from what I’ve seen yours is definitely one of the best. John Root, Web Developer, Department of Social Security, London

I’ve just started Thinking in Java. I expect it to be very good because I really liked Thinking in C++ (which I read as an experienced C++ programmer, trying to stay ahead of the curve). I’m somewhat less experienced in Java, but expect to be very satisfied. You are a wonderful author. Kevin K. Lewis, Technologist, ObjectSpace, Inc.

I think it’s a great book. I learned all I know about Java from this book. Thank you for making it available for free over the Internet. If you wouldn’t have I’d know nothing about Java at all. But the best thing is that your book isn’t a commercial brochure for Java. It also shows the bad sides of Java. YOU have done a great job here. Frederik Fix, Belgium

I have been hooked to your books all the time. A couple of years ago, when I wanted to start with C++, it was C++ Inside & Out which took me around the fascinating world of C++. It helped me in getting better opportunities in life. Now, in pursuit of more knowledge and when I wanted to learn Java, I bumped into Thinking in Java – No doubts in my mind as to whether I need some other book. Just fantastic. It is more like rediscovering myself as I get along with the book. It is just a month since I started with Java, and heartfelt thanks to you, I am understanding it better now. Anand Kumar S. - Software Engineer – Computervision, India

Your book stands out as an excellent general introduction. Peter Robinson, University of Cambridge Computer Laboratory

It’s by far the best material I have come across to help me learn Java and I just want you to know how lucky I feel to have found it. THANKS! Chuck Peterson, Product Leader, Internet Product Line, IVIS International

The book is great. It’s the third book on Java I’ve started and I’m about two-thirds of the way through it now. I plan to finish this one. I found out about it because it is used in some internal classes at Lucent Technologies and a friend told me the book was on the Net. Good work. Jerry Nowlin, MTS, Lucent Technologies

Of the six or so Java books I’ve accumulated to date, your Thinking in Java is by far the best and clearest. Michael Van Waas, Ph.D., President, TMR Associates

I just want to say thanks for Thinking in Java. What a wonderful book you’ve made here! Not to mention downloadable for free! As a student I find your books invaluable (I have a copy of C++ Inside Out , another great book about C++), because they not only teach me the how-to, but also the whys, which are of course very important in building a strong foundation in languages such as C++ or Java. I have quite a lot of friends here who love programming just as I do, and I’ve told them about your books. They think it’s great! Thanks again! By the way, I’m Indonesian and I live in Java. Ray Frederick Djajadinata, Student at Trisakti University, Jakarta

The mere fact that you have made this work free over the Net puts me into shock. I thought I’d let you know how much I appreciate and respect what you’re doing. Shane LeBouthillier, Computer Engineering student, University of Alberta, Canada

I have to tell you how much I look forward to reading your monthly column. As a newbie to the world of object oriented programming, I appreciate the time and thoughtfulness that you give to even the most elementary topic. I have downloaded your book, but you can bet that I will purchase the hard copy when it is published. Thanks for all of your help. Dan Cashmer, B. C. Ziegler & Co.

Just want to congratulate you on a job well done. First I stumbled upon the PDF version of Thinking in Java. Even before I finished reading it, I ran to the store and found Thinking in C++. Now, I have been in the computer business for over eight years, as a consultant, software engineer, teacher/trainer, and recently as self-employed, so I’d like to think that I have seen enough (not “have seen it all,” mind you, but enough). However, these books cause my girlfriend to call me a ”geek.” Not that I have anything against the concept - it is just that I thought this phase was well beyond me. But I find myself truly enjoying both books, like no other computer book I have touched or bought so far. Excellent writing style, very nice introduction of every new topic, and lots of wisdom in the books. Well done. Simon Goland, [email protected], Simon Says Consulting, Inc.

I must say that your Thinking in Java is great! That is exactly the kind of documentation I was looking for. Especially the sections about good and poor software design using Java 1.1. Dirk Duehr, Lexikon Verlag, Bertelsmann AG, Germany

Thank you for writing two great books ( Thinking in C++ , Thinking in Java ). You have helped me immensely in my progression to object oriented programming. Donald Lawson, DCL Enterprises

Thank you for taking the time to write a really helpful book on Java. If teaching makes you understand something, by now you must be pretty pleased with yourself. Dominic Turner, GEAC Support

It’s the best Java book I have ever read - and I read some. Jean-Yves MENGANT, Chief Software Architect NAT-SYSTEM, Paris, France

Thinking in Java gives the best coverage and explanation. Very easy to read, and I mean the code fragments as well. Ron Chan, Ph.D., Expert Choice, Inc., Pittsburgh PA

Your book is great. I have read lots of programming books and your book still adds insights to programming in my mind. Ningjian Wang, Information System Engineer, The Vanguard Group

Thinking in Java is an excellent and readable book. I recommend it to all my students. Dr. Paul Gorman, Department of Computer Science, University of Otago, Dunedin, New Zealand

About Thinking in C++ :
Best Book! Winner of the
1995 Software Development Magazine Jolt Award!

“This book is a tremendous achievement. You owe it to yourself to have a copy

on your shelf. The chapter on iostreams is the most comprehensive and understandable treatment of that subject I’ve seen to date.”

Al Stevens Contributing Editor, Doctor Dobbs Journal

“Eckel’s book is the only one to so clearly explain how to rethink program

construction for object orientation. That the book is also an excellent tutorial on the ins and outs of C++ is an added bonus.”

Andrew Binstock Editor, Unix Review

“Bruce continues to amaze me with his insight into C++, and Thinking in C++

is his best collection of ideas yet. If you want clear answers to difficult questions

about C++, buy this outstanding book.”

Gary Entsminger Author, The Tao of Objects

“Thinking in C++ patiently and methodically explores the issues of when and

how to use inlines, references, operator overloading, inheritance, and dynamic

objects, as well as advanced topics such as the proper use of templates, exceptions and multiple inheritance. The entire effort is woven in a fabric that

includes Eckel’s own philosophy of object and program design. A must for every

C++ developer’s bookshelf, Thinking in C++ is the one C++ book you must

have if you’re doing serious development with C++.”

Richard Hale Shaw Contributing Editor, PC Magazine

Thinking

in

Java

Bruce Eckel

President, MindView Inc.

Prentice Hall PTR
Upper Saddle River, New Jersey 07458
http://www.phptr.com
Check www.BruceEckel.com for
in-depth details and
the date and location of the next
Hands-On Java Seminar

 Based on this book

 Taught by Bruce Eckel

 Personal attention from Bruce Eckel

and his seminar assistants

 Includes in-class programming exercises

 Intermediate/Advanced seminars also offered

 Hundreds have already enjoyed this seminar –

see the Web site for their testimonials

Bruce Eckel’s Hands-On Java Seminar Multimedia CD
It’s like coming to the seminar!
Available at http://www.BruceEckel.com

 Overhead slides and synchronized audio for all the

lectures. Just play it to see and hear the lectures!

 Entire set of lectures are indexed so you can rapidly

locate the discussion of the subject you’re interested in.

 Special screen-formatted electronic version of Thinking

in Java with hyperlinked index and table of contents.

Overview

Using imports to change behavior..................... 172 Package caveat ....................... 174 Java access specifiers......... “Friendly” .............................. 175 public : interface access .......... 175 private : you can’t touch that!............................. 177 protected : “sort of friendly”.................... 178 Interface and implementation ................ Class access....................... Summary ......................... Exercises ...........................

6: Reusing classes 185 Composition syntax.......... Inheritance syntax ............ Initializing the base class........ 190 Combining composition and inheritance ................. Guaranteeing proper cleanup....................... 193 Name hiding .......................... 196 Choosing composition vs. inheritance .................. protected ......................... Incremental development ..................... Upcasting ......................... Why “upcasting”?.................. 200 The final keyword ............ Final data............................... 201 Final methods ........................ 204 Final classes ........................... 205 Final caution.......................... 206 Initialization and class loading ..................... Initialization with inheritance..................... 207 Summary ......................... Exercises ...........................

7: Polymorphism 211

Upcasting ......................... Why upcast?.......................... 212 The twist .......................... Method call binding ............... 214 Producing the right behavior ........................ 215 Extensibility........................... 217 Overriding vs. overloading.......................

Abstract classes and methods .................... 221 Interfaces ......................... 224 “Multiple inheritance” in Java................................... 227 Extending an interface with inheritance..................... 229 Grouping constants ............... 230 Initializing fields in interfaces ........................... 231 Inner classes ..................... 232 Inner classes and upcasting.... 234 Inner classes in methods and scopes ............... 235 The link to the outer class...... 240 static inner classes................. 242 Referring to the outer class object ................... 243 Inheriting from inner classes........................... 244 Can inner classes be overridden?........................ 245 Inner class identifiers ............. 247 Why inner classes: control frameworks ............... 247 Constructors and polymorphism ........................................ 253 Order of constructor calls ...... 253 Inheritance and finalize( ) ..... 255 Behavior of polymorphic methods inside constructors... 258 Designing with inheritance ....................... 260 Pure inheritance vs. extension .......................... 261 Downcasting and run-time type identification.................. 263 Summary......................... 265 Exercises........................... 265

8: Holding your objects 267 Arrays.............................. 267 Arrays are first-class objects .. 268 Returning an array ................ 271 Collections........................ 273 Disadvantage: unknown type ....................... 273 Enumerators (iterators) .... 277 Types of collections........... 280 Vector ................................... 280 BitSet .................................... 281 Stack ..................................... 283

  • Foreword
  • Introduction
  • 1: Introduction to objects
  • 2: Everything is an object
  • 3: Controlling program flow
  • 4: Initialization and cleanup
  • 5: Hiding the implementation
  • 6: Reusing classes
  • 7: Polymorphism
  • 8: Holding your objects
  • 9: Error handling with exceptions
  • 10: The Java IO system
  • 11: Run-time type identification
  • 12: Passing and returning objects
  • 13: Creating windows and applets
  • 14: Multiple threads
  • 15: Network programming
  • 16: Design patterns
  • 17: Projects
  • A: Using non-Java code
  • B: Comparing C++ and Java
  • C: Java programming guidelines
  • D: Performance
  • E: A bit about garbage collection
  • F: Recommended reading
  • Index
  • Foreword What’s Inside
  • Introduction
  • Prerequisites .......................
  • Learning Java .....................
  • Goals ..................................
  • Online documentation ........
  • Chapters .............................
  • Exercises .............................
  • Multimedia CD ROM...........
  • Source code.........................
  • Coding standards
  • Java versions ......................
  • Seminars and mentoring.....
  • Errors .................................
  • Note on the cover design.....
  • Acknowledgements .............
  • to objects 1: Introduction
  • of abstraction ..................... The progress
  • An object has an interface ...
  • implementation .................. The hidden
  • the implementation............. Reusing
  • reusing the interface ........... Inheritance:
  • Overriding base-class functionality
  • Is-a vs. is-like-a relationships...
  • with polymorphism Interchangeable objects
  • Dynamic binding
  • and interfaces Abstract base classes
  • and lifetimes Object landscapes
  • Collections and iterators
  • The singly-rooted hierarchy.....
  • collection use Collection libraries and support for easy
  • who should clean up? The housekeeping dilemma:
  • dealing with errors............. Exception handling:
  • Multithreading...................
  • Persistence
  • Java and the Internet
  • What is the Web?.....................
  • Client-side programming
  • Server-side programming
  • A separate arena: applications..
  • Analysis and Design
  • Staying on course
  • Phase 0: Let’s make a plan
  • What are we making?.............. Phase 1:
  • How will we build it?............... Phase 2:
  • Phase 3: Let’s build it!
  • Phase 4: Iteration.....................
  • Plans pay off............................
  • Java vs. C++? ....................
  • an object 2: Everything is
  • with handles ....................... You manipulate objects
  • all the objects...................... You must create
  • Where storage lives..................
  • Special case: primitive types.....
  • Arrays in Java
  • destroy an object................. You never need to
  • Scoping
  • Scope of objects........................
  • data types: class.................. Creating new
  • Fields and methods
  • and return values ............... Methods, arguments
  • The argument list
  • Building a Java program.....
  • Name visibility.........................
  • Using other components
  • The static keyword..................
  • Your first Java program......
  • documentation.................... Comments and embedded
  • Comment documentation
  • Syntax
  • Embedded HTML......................
  • to other classes @see : referring
  • Class documentation tags
  • Variable documentation tags
  • Method documentation tags
  • Documentation example
  • Coding style........................
  • Summary ...........................
  • Exercises .............................
  • program flow 3: Controlling
  • Using Java operators ..........
  • Precedence................................
  • Assignment..............................
  • Mathematical operators
  • and decrement Auto increment
  • Relational operators
  • Logical operators
  • Bitwise operators
  • Shift operators
  • Ternary if-else operator
  • The comma operator..............
  • String operator +..................
  • using operators...................... Common pitfalls when
  • Casting operators...................
  • Java has no “sizeof”...............
  • Precedence revisited................
  • A compendium of operators...
  • Execution control
  • true and false.........................
  • if-else.....................................
  • Iteration.................................
  • do-while
  • for
  • break and continue
  • switch....................................
  • Summary.........................
  • Exercises...........................
  • and cleanup 4: Initialization
  • with the constructor Guaranteed initialization
  • Method overloading
  • overloaded methods Distinguishing
  • Overloading with primitives
  • return values Overloading on
  • Default constructors
  • The this keyword
  • and garbage collection...... Cleanup: finalization
  • What is finalize( ) for?
  • You must perform cleanup
  • Member initialization
  • Specifying initialization
  • Constructor initialization.......
  • Array initialization...........
  • Multidimensional arrays........
  • Summary.........................
  • Exercises...........................
  • implementation 5: Hiding the
  • the library unit package :
  • package names....................... Creating unique
  • A custom tool library.............
  • Hashtable
  • Enumerators revisited
  • Sorting..............................
  • collection library...............
  • The new collections...........
  • Using Collection s
  • Using List s.............................
  • Using Set s
  • Using Map s
  • implementation Choosing an
  • Unsupported operations
  • Sorting and searching
  • Utilities
  • Summary .........................
  • Exercises ...........................
  • with exceptions 9: Error handling
  • Basic exceptions ................
  • Exception arguments
  • Catching an exception .......
  • The try block
  • Exception handlers.................
  • The exception specification.....
  • Catching any exception..........
  • Rethrowing an exception
  • exceptions ......................... Standard Java
  • own exceptions ................. Creating your
  • Exception restrictions........
  • with finally....................... Performing cleanup
  • What’s finally for?
  • Pitfall: the lost exception........
  • Constructors.....................
  • Exception matching ..........
  • Exception guidelines...............
  • Summary .........................
  • Exercises ...........................
  • IO system 10: The Java
  • Input and output ..............
  • Types of InputStream
  • Types of OutputStream
  • and useful interfaces......... Adding attributes
  • FilterInputStream Reading from an InputStream with
  • FilterOutputStream Writing to an OutputStream with
  • Off by itself: RandomAccessFile
  • The File class....................
  • A directory lister
  • creating directories................. Checking for and
  • of IO streams Typical uses
  • Input streams
  • Output streams......................
  • file manipulation Shorthand for
  • standard input Reading from
  • Piped streams.........................
  • StreamTokenizer
  • StringTokenizer
  • Java 1.1 IO streams..........
  • Sources and sinks of data.......
  • Modifying stream behavior....
  • Unchanged Classes.................
  • An example............................
  • Redirecting standard IO..........
  • Compression
  • with GZIP Simple compression
  • Multi-file storage with Zip.....
  • The Java archive (jar) utility
  • Object serialization
  • Finding the class
  • Controlling serialization.........
  • Using persistence
  • Summary.........................
  • Exercises...........................
  • identification 11: Run-time type
  • The need for RTTI
  • The Class object
  • Checking before a cast............
  • RTTI syntax......................
  • class information Reflection: run-time
  • A class method extractor........
  • Summary.........................
  • Exercises...........................
  • returning objects 12: Passing and
  • Passing handles around
  • Aliasing..................................
  • Making local copies...........
  • Pass by value
  • Cloning objects.......................
  • to a class................................ Adding cloneability
  • Successful cloning
  • The effect of Object.clone( )
  • Cloning a composed object
  • A deep copy with Vector
  • Deep copy via serialization.....
  • further down a hierarchy Adding cloneability
  • Why this strange design?
  • Controlling cloneability ....
  • The copy-constructor.............
  • Read-only classes ..............
  • Creating read-only classes......
  • to immutability The drawback
  • Immutable String s
  • StringBuffer classes The String and
  • String s are special
  • Summary .........................
  • Exercises ...........................
  • and applets 13: Creating windows
  • Why use the AWT? ...........
  • The basic applet ................
  • Testing applets.......................
  • A more graphical example
  • the framework methods......... Demonstrating
  • Making a button...............
  • Capturing an event ...........
  • Text fields..........................
  • Text areas..........................
  • Labels ...............................
  • Check boxes ......................
  • Radio buttons ...................
  • Drop-down lists................
  • List boxes ..........................
  • handleEvent( )
  • Controlling layout ............
  • FlowLayout
  • BorderLayout
  • GridLayout
  • CardLayout
  • GridBagLayout
  • Alternatives to action .......
  • Applet restrictions.............
  • Applet advantages..................
  • Windowed applications
  • Menus....................................
  • Dialog boxes
  • The new AWT
  • The new event model
  • Event and listener types
  • 1.1 AWT Making windows and applets with the Java
  • earlier examples Revisiting the
  • Binding events dynamically
  • from UI logic Separating business logic
  • coding approaches Recommended
  • Java 1.1 UI APIs...............
  • Desktop colors
  • Printing
  • The clipboard
  • and Beans......................... Visual programming
  • What is a Bean?
  • the Introspector Extracting BeanInfo with
  • A more sophisticated Bean
  • Packaging a Bean
  • More complex Bean support
  • More to Beans........................
  • Introduction to Swing
  • Benefits of Swing
  • Easy conversion
  • A display framework
  • Tool tips
  • Borders
  • Buttons..................................
  • Button groups
  • Icons
  • Menus....................................
  • Popup menus.........................
  • List boxes and combo boxes
  • Sliders and progress bars........
  • Trees
  • Tables
  • Tabbed Panes
  • The Swing message box
  • More to Swing
  • Summary.........................
  • Exercises...........................
  • 14: Multiple threads
  • user interfaces.................. Responsive
  • Inheriting from Thread
  • responsive interface Threading for a
  • with the main class................ Combining the thread
  • Making many threads............
  • Daemon threads.....................
  • limited resources............... Sharing
  • resources................................ Improperly accessing
  • How Java shares resources
  • Java Beans revisited
  • Blocking............................
  • Becoming blocked
  • Deadlock
  • Priorities ...........................
  • Thread groups
  • Runnable revisited ...........
  • Too many threads..................
  • Summary .........................
  • Exercises ...........................
  • programming 15: Network
  • Identifying a machine .......
  • Servers and clients
  • within the machine................ Port: a unique place
  • Sockets..............................
  • A simple server and client
  • Serving multiple clients.....
  • Datagrams........................
  • A Web application .............
  • The server application
  • The NameSender applet........
  • this approach......................... Problems with
  • Connecting Java to CGI.....
  • Encoding data for CGI
  • The applet..............................
  • The CGI program in C++
  • What about POST?.................
  • databases with JDBC ........ Connecting to
  • Getting the example to work..
  • the lookup program............... A GUI version of
  • seems so complex................... Why the JDBC API
  • Remote methods ...............
  • Remote interfaces...................
  • remote interface..................... Implementing the
  • Creating stubs and skeletons..
  • Using the remote object
  • Alternatives to RMI
  • Summary.........................
  • Exercises...........................
  • 16: Design patterns
  • The pattern concept..........
  • The singleton
  • Classifying patterns
  • The observer pattern
  • trash recycler Simulating the
  • Improving the design
  • “Make more objects”
  • prototyping creation.............. A pattern for
  • Abstracting usage.............
  • Multiple dispatching.........
  • double dispatch...................... Implementing the
  • The “visitor” pattern
  • harmful? RTTI considered
  • Summary.........................
  • Exercises...........................
  • 17: Projects
  • Text processing
  • Extracting code listings
  • capitalization style................. Checking
  • A method lookup tool
  • Complexity theory
  • Summary.........................
  • Exercises...........................
  • non-Java code A: Using
  • Native Interface................ The Java
  • Calling a native method
  • The JNIEnv argument Accessing JNI functions:
  • Java objects Passing and using
  • JNI and Java exceptions.........
  • JNI and threading
  • code base................................ Using a pre-existing
  • The Microsoft way
  • J/Direct............................
  • The @dll.import directive