Java: The Complete Reference, Ninth Edition

Java: The Complete Reference, Ninth Edition

Herbert Schildt

Language: English

Pages: 1312

ISBN: 0071808558

Format: PDF / Kindle (mobi) / ePub


The Definitive Java Programming Guide

Fully updated for Java SE 8, Java: The Complete Reference, Ninth Edition explains how to develop, compile, debug, and run Java programs. Bestselling programming author Herb Schildt covers the entire Java language, including its syntax, keywords, and fundamental programming principles, as well as significant portions of the Java API library. JavaBeans, servlets, applets, and Swing are examined and real-world examples demonstrate Java in action. New Java SE 8 features such as lambda expressions, the stream library, and the default interface method are discussed in detail. This Oracle Press resource also offers a solid introduction to JavaFX.

Coverage includes:

  • Data types, variables, arrays, and operators
  • Control statements
  • Classes, objects, and methods
  • Method overloading and overriding
  • Inheritance
  • Interfaces and packages
  • Exception handling
  • Multithreaded programming
  • Enumerations, autoboxing, and annotations
  • The I/O classes
  • Generics
  • Lambda expressions
  • String handling
  • The Collections Framework
  • Networking
  • Event handling
  • AWT and Swing
  • The Concurrent API
  • The Stream API
  • Regular expressions
  • JavaFX
  • JavaBeans
  • Applets and servlets
  • Much, much more

Web Application Defender's Cookbook: Battling Hackers and Protecting Users

Practical Packet Analysis: Using Wireshark to Solve Real-World Network Problems

The Myth of Grace: A BIT of Grace Hopper and the Invention of the Information Age

Raspberry Pi Hacks: Tips & Tools for Making Things with the Inexpensive Linux Computer

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Comparator, RandomAccess, Iterator, and ListIterator interfaces, which are described in depth later in this chapter. Briefly, Comparator defines how two objects are compared; Iterator and ListIterator enumerate the objects within a collection. By implementing RandomAccess, a list indicates that it supports efficient, random access to its elements. To provide the greatest flexibility in their use, the collection interfaces allow some methods to be optional. The optional methods enable you to

capitals.put("Indiana", "Indianapolis"); // Get a set-view of the keys. Set states = capitals.keySet(); // Show all of the states and capitals. for(Object name : states) System.out.println("The capital of " + name + " is " + capitals.getProperty((String)name) + "."); System.out.println(); // Look for state not in list -- specify default. String str = capitals.getProperty("Florida", "Not Found"); System.out.println("The capital of Florida is " + str + "."); } } The output from this program is

statements inside the block will be executed. Thus, the two statements inside the block form a logical unit, and one statement cannot execute without the other also executing. The key point here is that whenever you need to logically link two or more statements, you do so by creating a block. Let’s look at another example. The following program uses a block of code as the target of a for loop. /* Demonstrate a block of code. Call this file "BlockTest.java" */ class BlockTest { public static

for text to be aligned so that one or more of the edges of the text make a straight line. For example, most word processors can left-justify and/or right-justify text. Most can also center text. In the following program, you will see how to accomplish these actions. In the program, the string to be justified is broken into individual words. For each word, the program keeps track of its length in the current font and automatically advances to the next line if the word will not fit on the current

terminology used to describe, 765 FontMetrics class, 736, 764–766 methods, table of some, 765–766 for loop, 29–31, 93–102 enhanced. See For-each version of the for loop variations, 96–97 For-each version of the for loop, 14, 93, 97–101 and arrays, 97–101 and the break statement, 98–99 and collections, 97, 101, 456, 479–480 general form, 97 and the Iterable interface, 449, 456, 479 and maps, 482 forceTermination( ), 882 forDigit( ), 412 Fork/Join Framework, 15, 229, 257, 578,

Download sample

Download

About admin