By Cay S. Horstmann, Gary Cornell
This revised version 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 actual 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 gains with completely established real-world examples. the instance courses were conscientiously crafted to be effortless to appreciate in addition to valuable in perform, so that you can depend upon them as a good place to begin to your personal code.
Volume I is designed to quick 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, 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 thoughts of the Java language, in addition to 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
widely used programming
The collections framework
For distinctive insurance of XML processing, networking, databases, internationalization, safety, complex AWT/Swing, and different complex beneficial properties, search for the impending 8th variation of Core Java™, quantity II—Advanced positive factors
A journey 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 quantity 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 let you know tips on how to obtain and set up the JDK and this system examples for this booklet. Then we advisor you thru compiling and working 3 common Java courses, a console program, a graphical program, and an applet, utilizing the apparent JDK, a Java-enabled textual content editor, and a Java IDE.
Chapter 3 begins the dialogue of the Java language. during this bankruptcy, we conceal the fundamentals: variables, loops, and easy features. when you are a C or C++ programmer, this can be soft crusing as the syntax for those language beneficial properties is basically almost like in C. in the event you come from a non-C history similar 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 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 supply suggestion on sound OOP layout. eventually, we conceal the exceptional javadoc device that codecs your code reviews as a collection of hyperlinked websites. while you're accustomed to C++, you then can flick through this bankruptcy quick. Programmers coming from a non-object-oriented history should still anticipate to spend it slow getting to know OOP recommendations 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 permits you to take an latest classification and alter it in accordance with your wishes. this can be a basic process for programming in Java. The inheritance mechanism in Java is sort of just like that during C++. once more, C++ programmers can concentrate on the diversities among the languages.
Chapter 6 exhibits you ways to take advantage of Java’s idea of an interface. Interfaces allow you to transcend the easy 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 function of Java known as internal sessions. internal periods assist in making your code purifier and extra concise.
In Chapter 7, we commence software 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, easy methods to paint on them, the right way to draw with geometric shapes, find out how 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 how one can write the code that responds to occasions like mouse clicks or key presses. alongside the way in which you’ll see tips to deal with easy GUI components like buttons and panels.
Chapter 9 discusses the Swing GUI toolkit in nice aspect. The Swing toolkit enables you to construct a cross-platform graphical consumer interface. You’ll examine all concerning the different types of buttons, textual content elements, borders, sliders, record packing containers, menus, and conversation packing containers. even if, the various extra complicated parts are mentioned in quantity II.
Chapter 10 exhibits you ways to install your courses, both as purposes or applets. We describe the best way to package deal courses in JAR records, and the way to carry purposes over the net with the Java net commence and applet mechanisms. ultimately, we clarify how Java courses can shop and retrieve configuration details when they were deployed.
Chapter 11 discusses exception dealing with, Java’s strong mechanism to accommodate the truth that undesirable issues can ensue to solid courses. Exceptions provide you with a good method of setting apart the traditional processing code from the mistake dealing with. after all, even after hardening your application via dealing with all remarkable stipulations, it nonetheless may perhaps fail to paintings as anticipated. within the moment half this bankruptcy, we provide you with lots of priceless debugging assistance. ultimately, we advisor you thru a pattern debugging session.
Chapter 12 supplies an outline of regular programming, a tremendous develop of Java SE 5.0. widespread programming makes your courses more uncomplicated to learn and more secure. We express you the way 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 appropriate with older models of Java.
The subject of Chapter 13 is the collections framework of the Java platform. everytime you are looking to acquire a number of items and retrieve them later, you'll want to use a set that's most fitted in 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....