By Cay S. Horstmann, Gary Cornell
This revised variation of the vintage Core Java™, quantity I–Fundamentals , is the definitive consultant to Java for severe programmers who are looking to positioned Java to paintings on actual projects.
Fully up to date for the recent Java SE 6 platform, this no-nonsense instructional and trustworthy reference illuminates an important language and library positive factors with completely verified real-world examples. the instance courses were rigorously crafted to be effortless to appreciate in addition to worthy in perform, so that you can depend upon them as a superb place to begin to your personal code.
Volume I is designed to speedy convey you on top of things on what’s new in Java SE 6 and that will help 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 elemental techniques of the Java language, in addition to the fundamentals of user-interface programming. You’ll locate distinct, insightful assurance of
Interfaces and internal classes
mirrored image and proxies
the development listener model
GUI programming with Swing
Logging and debugging
The collections framework
For distinctive assurance of XML processing, networking, databases, internationalization, protection, complex AWT/Swing, and different complex beneficial properties, search for the impending 8th version of Core Java™, quantity II—Advanced positive factors
A travel of This Book
Chapter 1 offers an outline of the functions of Java that set it except different programming languages. We clarify what the designers of the language got down to do and to what volume they succeeded. Then, we provide a quick heritage of the way Java got here into being and the way it has evolved.
In Chapter 2, we inform you find out how to obtain and set up the JDK and this system examples for this ebook. Then we advisor you thru compiling and working 3 usual Java courses, a console software, a graphical program, and an applet, utilizing the apparent 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 conceal the fundamentals: variables, loops, and easy capabilities. when you are a C or C++ programmer, this is often soft crusing as the syntax for those language gains is largely almost like in C. if you happen to come from a non-C heritage corresponding to 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 principles of the Java language, we additionally supply recommendation on sound OOP layout. eventually, we hide the remarkable javadoc device that codecs your code reviews as a suite of hyperlinked websites. when you are accustomed to C++, you then can flick thru this bankruptcy speedy. Programmers coming from a non-object-oriented heritage should still count on to spend it slow studying OOP recommendations prior to going extra with Java.
Classes and encapsulation are just one a part of the OOP tale, and Chapter 5 introduces the opposite, specifically, inheritance. Inheritance permits you to take an current category and adjust it in line with your wishes. this can be a primary procedure for programming in Java. The inheritance mechanism in Java is kind of just like that during C++. once more, C++ programmers can specialize in the diversities among the languages.
Chapter 6 indicates you ways to take advantage of Java’s concept of an interface. Interfaces allow you to transcend the straightforward inheritance version of bankruptcy five. gaining knowledge of interfaces lets you have complete entry to the ability of Java’s thoroughly object-oriented method of programming. We additionally conceal an invaluable technical characteristic of Java known as internal periods. internal periods assist in making your code purifier and extra concise.
In Chapter 7, we commence software programming in earnest. each Java programmer should still understand a section approximately GUI programming, and this quantity includes the fundamentals. We express how one can make home windows, find out how to paint on them, the way to draw with geometric shapes, how one can layout textual content in a number of fonts, and the way to show images.
Chapter 8 is an in depth dialogue of the development version of the AWT, the summary window toolkit. You’ll see the way to write the code that responds to occasions like mouse clicks or key presses. alongside the way in which you’ll see the way to deal with easy GUI parts like buttons and panels.
Chapter 9 discusses the Swing GUI toolkit in nice element. The Swing toolkit enables you to construct a cross-platform graphical person interface. You’ll research all concerning the different types of buttons, textual content elements, borders, sliders, checklist containers, menus, and conversation bins. even if, a few of the extra complex parts are mentioned in quantity II.
Chapter 10 exhibits you ways to install your courses, both as functions or applets. We describe the best way to package deal courses in JAR records, and the way to bring purposes over the net with the Java net commence and applet mechanisms. eventually, we clarify how Java courses can shop and retrieve configuration details when they were deployed.
Chapter 11 discusses exception dealing with, Java’s powerful mechanism to accommodate the truth that undesirable issues can occur to sturdy courses. Exceptions offer you a good means of keeping apart the conventional processing code from the mistake dealing with. in fact, even after hardening your application by way of dealing with all unprecedented stipulations, it nonetheless may perhaps fail to paintings as anticipated. within the moment half this bankruptcy, we offer you a number of worthwhile debugging tips. ultimately, we advisor you thru a pattern debugging session.
Chapter 12 offers an outline of standard programming, a tremendous develop of Java SE 5.0. wide-spread programming makes your courses more uncomplicated to learn and more secure. We express you the way you should use powerful typing and take away unpleasant and dangerous casts, and the way you could care for the complexities that come up from the necessity to remain suitable with older types 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 set that's most fitted to your situations, rather than simply tossing the weather into an array. This bankruptcy indicates you the way to use the traditional collections which are prebuilt in your use....