By Cay S. Horstmann, Gary Cornell
This revised variation of the vintage Core Java™, quantity I–Fundamentals , is the definitive advisor to Java for severe programmers who are looking to placed Java to paintings on genuine projects.
Fully up-to-date for the recent Java SE 6 platform, this no-nonsense instructional and trustworthy reference illuminates crucial language and library good points with completely verified real-world examples. the instance courses were conscientiously crafted to be effortless to appreciate in addition to important in perform, so that you can depend on them as a superb place to begin in your personal code.
Volume I is designed to speedy convey you up to the mark 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 past model of Java or migrating from one other language. The authors pay attention to the basic thoughts of the Java language, besides 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 certain insurance of XML processing, networking, databases, internationalization, safety, complex AWT/Swing, and different complex good points, search for the approaching 8th version of Core Java™, quantity II—Advanced gains
A travel of This Book
Chapter 1 provides an summary 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 ways Java got here into being and the way it has evolved.
In Chapter 2, we let you know the way to obtain and set up the JDK and this system examples for this e-book. Then we advisor you thru compiling and working 3 average 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 disguise the fundamentals: variables, loops, and straightforward capabilities. when you are a C or C++ programmer, this is often gentle crusing as the syntax for those language gains is largely almost like in C. when you come from a non-C history akin to visible uncomplicated, 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 primary construction 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 supply suggestion on sound OOP layout. ultimately, we disguise the brilliant javadoc instrument that codecs your code reviews as a collection of hyperlinked websites. while you're acquainted with C++, then you definately can flick through this bankruptcy fast. Programmers coming from a non-object-oriented historical past should still count on to spend a while gaining knowledge of OOP options prior to going additional with Java.
Classes and encapsulation are just one a part of the OOP tale, and Chapter 5 introduces the opposite, specifically, inheritance. Inheritance allows you to take an current category and regulate it in accordance with your wishes. it is a basic strategy for programming in Java. The inheritance mechanism in Java is kind of just like that during C++. once more, C++ programmers can specialise in the diversities among the languages.
Chapter 6 indicates you the way to exploit 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 disguise an invaluable technical function of Java referred to as internal sessions. internal periods help in making your code cleanser and extra concise.
In Chapter 7, we commence software programming in earnest. each Java programmer should still comprehend a piece approximately GUI programming, and this quantity comprises the fundamentals. We express how one can make home windows, the right way to paint on them, find out how to draw with geometric shapes, find out how to 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 right way to write the code that responds to occasions like mouse clicks or key presses. alongside the best way you’ll see tips to deal with uncomplicated 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 consumer interface. You’ll examine all concerning the several types of buttons, textual content elements, borders, sliders, record containers, menus, and conversation bins. despite the fact that, a few of the extra complicated elements are mentioned in quantity II.
Chapter 10 indicates you ways to install your courses, both as functions or applets. We describe tips on how to package deal courses in JAR documents, and the way to convey purposes over the web with the Java internet begin and applet mechanisms. eventually, 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 house the truth that undesirable issues can ensue to strong courses. Exceptions provide you with an effective method of keeping apart the conventional processing code from the mistake dealing with. in fact, even after hardening your application by means of dealing with all remarkable stipulations, it nonetheless may possibly fail to paintings as anticipated. within the moment half this bankruptcy, we provide you with plenty of invaluable debugging tips. eventually, we consultant you thru a pattern debugging session.
Chapter 12 provides an outline of normal programming, an important boost of Java SE 5.0. ordinary programming makes your courses more uncomplicated to learn and more secure. We exhibit you ways you should use powerful typing and take away unpleasant and dangerous casts, and the way you could take care of the complexities that come up from the necessity to remain appropriate 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 suitable on your situations, rather than simply tossing the weather into an array. This bankruptcy indicates you ways to use the normal collections which are prebuilt on your use....