By Cay S. Horstmann, Gary Cornell
This revised variation of the vintage Core Java™, quantity I–Fundamentals , is the definitive consultant to Java for critical programmers who are looking to positioned Java to paintings on genuine projects.
Fully up-to-date for the recent Java SE 6 platform, this no-nonsense educational and trustworthy reference illuminates an important language and library beneficial properties with completely established real-world examples. the instance courses were rigorously crafted to be effortless to appreciate in addition to important in perform, so that you can depend upon them as a good place to begin to your personal code.
Volume I is designed to fast convey you on top of things on what’s new in Java SE 6 and that can assist you make the transition as successfully as attainable, even if you’re upgrading from an previous model of Java or migrating from one other language. The authors be aware of the basic recommendations of the Java language, in addition to the fundamentals of user-interface programming. You’ll locate distinct, insightful insurance of
Interfaces and internal classes
mirrored image and proxies
the development listener model
GUI programming with Swing
Logging and debugging
The collections framework
For targeted insurance of XML processing, networking, databases, internationalization, defense, complicated AWT/Swing, and different complicated positive factors, search for the approaching 8th variation of Core Java™, quantity II—Advanced good points
A travel of This Book
Chapter 1 provides an summary of the services of Java that set it except different programming languages. We clarify what the designers of the language got down to do and to what quantity they succeeded. Then, we supply a brief background of ways Java got here into being and the way it has evolved.
In Chapter 2, we let you know tips on how to obtain and set up the JDK and this system examples for this e-book. Then we consultant you thru compiling and working 3 regular Java courses, a console program, a graphical software, and an applet, utilizing the obvious JDK, a Java-enabled textual content editor, and a Java IDE.
Chapter 3 starts off the dialogue of the Java language. during this bankruptcy, we disguise the fundamentals: variables, loops, and easy features. while you are a C or C++ programmer, this is often soft crusing as the syntax for those language gains is largely just like in C. in the event you come from a non-C history resembling visible simple, you'll want to learn this bankruptcy carefully.
Object-oriented programming (OOP) is now within the mainstream of programming perform, and Java is totally item orientated.
Chapter 4 introduces encapsulation, the 1st of 2 basic development blocks of item orientation, and the Java language mechanism to enforce it, that's, periods and strategies. as well as the foundations of the Java language, we additionally provide recommendation on sound OOP layout. ultimately, we disguise the awesome javadoc software that codecs your code reviews as a suite of hyperlinked websites. while you are conversant in C++, then you definitely can flick through this bankruptcy quick. Programmers coming from a non-object-oriented historical past should still count on to spend your time learning OOP recommendations sooner than going additional with Java.
Classes and encapsulation are just one a part of the OOP tale, and Chapter 5 introduces the opposite, particularly, inheritance. Inheritance helps you to take an current category and adjust it based on your wishes. this can be a basic approach for programming in Java. The inheritance mechanism in Java is kind of just like that during C++. once more, C++ programmers can concentrate on the variations among the languages.
Chapter 6 exhibits you ways to take advantage of Java’s inspiration of an interface. Interfaces allow you to transcend the easy inheritance version of bankruptcy five. gaining knowledge of interfaces permits you to have complete entry to the ability of Java’s thoroughly object-oriented method of programming. We additionally hide an invaluable technical characteristic of Java referred to as internal sessions. internal sessions assist in making your code purifier and extra concise.
In Chapter 7, we start program programming in earnest. each Java programmer may still understand a piece approximately GUI programming, and this quantity comprises the fundamentals. We exhibit how one can make home windows, the way to paint on them, tips on how to draw with geometric shapes, tips to layout textual content in a number of fonts, and the way to exhibit images.
Chapter 8 is a close dialogue of the development version of the AWT, the summary window toolkit. You’ll see how one can write the code that responds to occasions like mouse clicks or key presses. alongside the best way you’ll see the way to deal with uncomplicated GUI parts like buttons and panels.
Chapter 9 discusses the Swing GUI toolkit in nice element. The Swing toolkit helps you to construct a cross-platform graphical person interface. You’ll research all in regards to the different types of buttons, textual content elements, borders, sliders, checklist bins, menus, and conversation packing containers. notwithstanding, the various extra complex parts are mentioned in quantity II.
Chapter 10 indicates you the way to set up your courses, both as functions or applets. We describe how one can package deal courses in JAR records, and the way to bring functions over the net with the Java net commence and applet mechanisms. ultimately, we clarify how Java courses can shop and retrieve configuration details after they were deployed.
Chapter 11 discusses exception dealing with, Java’s powerful mechanism to accommodate the truth that undesirable issues can take place to sturdy courses. Exceptions provide you with an effective approach of setting apart the traditional processing code from the mistake dealing with. after all, even after hardening your application by way of dealing with all extraordinary stipulations, it nonetheless may perhaps fail to paintings as anticipated. within the moment 1/2 this bankruptcy, we offer you numerous precious debugging assistance. ultimately, we advisor you thru a pattern debugging session.
Chapter 12 provides an outline of known programming, an incredible improve of Java SE 5.0. established programming makes your courses more straightforward to learn and more secure. We convey you the way you should use robust typing and take away unpleasant and hazardous casts, and the way you could care for the complexities that come up from the necessity to remain appropriate with older models of Java.
The subject of Chapter 13 is the collections framework of the Java platform. everytime you are looking to gather a number of items and retrieve them later, you'll want to use a suite that's most suitable on your conditions, rather than simply tossing the weather into an array. This bankruptcy indicates you ways to exploit the traditional collections which are prebuilt in your use....