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 placed Java to paintings on genuine projects.
Fully up-to-date for the hot Java SE 6 platform, this no-nonsense instructional and trustworthy reference illuminates an important language and library positive factors with completely validated 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 an excellent place to begin on your personal code.
Volume I is designed to speedy deliver you in control on what’s new in Java SE 6 and that will help you make the transition as successfully as attainable, no matter if you’re upgrading from an past model of Java or migrating from one other language. The authors pay attention to the basic options of the Java language, besides the fundamentals of user-interface programming. You’ll locate precise, 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 targeted assurance of XML processing, networking, databases, internationalization, protection, complex AWT/Swing, and different complicated good points, search for the approaching 8th variation of Core Java™, quantity II—Advanced positive factors
A journey of This Book
Chapter 1 supplies an outline 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 provide a brief historical past of the way Java got here into being and the way it has evolved.
In Chapter 2, we let you know find out how to obtain and set up the JDK and this system examples for this e-book. Then we advisor you thru compiling and working 3 general Java courses, a console program, a graphical software, 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 easy services. while you're a C or C++ programmer, this is often gentle crusing as the syntax for those language positive factors is largely almost like in C. when you come from a non-C history akin 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 construction 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 provide suggestion on sound OOP layout. ultimately, we disguise the remarkable javadoc device 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 speedy. Programmers coming from a non-object-oriented heritage may still anticipate to spend it slow gaining knowledge of OOP ideas 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 helps you to take an current classification and adjust it in line with your wishes. this can be a primary approach for programming in Java. The inheritance mechanism in Java is sort of just like that during C++. once more, C++ programmers can specialize in the diversities among the languages.
Chapter 6 indicates you the way to take advantage of Java’s thought of an interface. Interfaces allow you to transcend the straightforward inheritance version of bankruptcy five. learning interfaces enables you to have complete entry to the ability of Java’s thoroughly object-oriented method of programming. We additionally disguise an invaluable technical characteristic of Java referred to as internal sessions. internal sessions help in making your code purifier and extra concise.
In Chapter 7, we start software programming in earnest. each Java programmer may still comprehend a section approximately GUI programming, and this quantity comprises the fundamentals. We express how one can make home windows, the right way to paint on them, the best way to draw with geometric shapes, the way to structure textual content in a number of fonts, and the way to demonstrate images.
Chapter 8 is an in depth dialogue of the development version of the AWT, the summary window toolkit. You’ll see tips to write the code that responds to occasions like mouse clicks or key presses. alongside the way in which you’ll see how one can deal with uncomplicated GUI components like buttons and panels.
Chapter 9 discusses the Swing GUI toolkit in nice aspect. The Swing toolkit permits you to construct a cross-platform graphical person interface. You’ll study all in regards to the several types of buttons, textual content elements, borders, sliders, checklist bins, menus, and conversation containers. even though, a number of the extra complicated parts are mentioned in quantity II.
Chapter 10 indicates you the way to set up your courses, both as purposes or applets. We describe how you can package deal courses in JAR documents, and the way to bring purposes over the web with the Java internet begin and applet mechanisms. eventually, we clarify how Java courses can shop and retrieve configuration info after they were deployed.
Chapter 11 discusses exception dealing with, Java’s strong mechanism to accommodate the truth that undesirable issues can take place to stable courses. Exceptions provide you with a good approach of keeping apart the traditional processing code from the mistake dealing with. after all, even after hardening your software by means of dealing with all extraordinary stipulations, it nonetheless may possibly fail to paintings as anticipated. within the moment 1/2 this bankruptcy, we offer you various valuable debugging assistance. ultimately, we consultant you thru a pattern debugging session.
Chapter 12 supplies an summary of universal programming, a massive increase of Java SE 5.0. ordinary programming makes your courses more straightforward to learn and more secure. We convey you ways you should use robust typing and take away ugly and hazardous casts, and the way you could take care of the complexities that come up from the necessity to remain suitable 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 gadgets and retrieve them later, you'll want to use a suite that's most suitable on your situations, rather than simply tossing the weather into an array. This bankruptcy indicates you ways to exploit the traditional collections which are prebuilt to your use....