Java 7 for Absolute Beginners
CHAPTER 14 ■ RECURSION Point2D.Double lowerLeft = new Point2D.Double(0, doubleHeight); Point2D.Double lowerRight = new Point2D.D ...
CHAPTER 14 ■ RECURSION ■ Note The code for drawTriangle could be made simpler by starting at the outermost layer and counting ba ...
CHAPTER 14 ■ RECURSION Drawing a Fractal Tree One of my other favorite fractals is the fractal tree because it really does resem ...
CHAPTER 14 ■ RECURSION public static void main(String[] args) { FractalTree fractalTree = new FractalTree(); fractalTree.createA ...
CHAPTER 14 ■ RECURSION if (colorValue < 0) { colorValue = 0; } g.setColor(new Color(0, colorValue, 0)); g.drawLine(x1, y1, x2 ...
CHAPTER 14 ■ RECURSION Figure 14-3. Output from the FractalTree Program Summary In this chapter, I explained the unusual but som ...
CHAPTER 14 ■ RECURSION Conversely, recursion is sometimes the best answer to a problem. Recursion can be an elegant solution to ...
C H A P T E R 1 5 279 Generics and Regular Expressions Readers who already know Java may very well ask why these two topics are ...
CHAPTER 15 ■ GENERICS AND REGULAR EXPRESSIONS Listing 15-2. A Simplified Generic LinkedList<JPanel> panelList = new Linked ...
CHAPTER 15 ■ GENERICS AND REGULAR EXPRESSIONS public static void main(String[] args) { LinkedList<GenericRole<String, Stri ...
CHAPTER 15 ■ GENERICS AND REGULAR EXPRESSIONS cost that the customer now thinks less of our software and our company. So let's a ...
CHAPTER 15 ■ GENERICS AND REGULAR EXPRESSIONS Finally, ensuring that your collections contain only the types you expect is one a ...
CHAPTER 15 ■ GENERICS AND REGULAR EXPRESSIONS sb.append(" and ending at "); sb.append(matchEnd); System.out.println(sb); } } } m ...
CHAPTER 15 ■ GENERICS AND REGULAR EXPRESSIONS In the right pane, click the AArguments tab. The Arguments tab appears, as shown ...
CHAPTER 15 ■ GENERICS AND REGULAR EXPRESSIONS Figure 15-4. Populated parameters for RegexTester To run the RegexTester program, ...
CHAPTER 15 ■ GENERICS AND REGULAR EXPRESSIONS Now that we have a testing program and know how to use it, we need to focus on the ...
CHAPTER 15 ■ GENERICS AND REGULAR EXPRESSIONS Continued Metacharacter Description $ Matches the end of the string. Z$ matches a ...
CHAPTER 15 ■ GENERICS AND REGULAR EXPRESSIONS The output of that is: Found a match for Sam Spade;Yosemite Sam;Sam Merlotte;Samwi ...
CHAPTER 15 ■ GENERICS AND REGULAR EXPRESSIONS Summary This chapter covered the things that benefit from pattern matching: generi ...
Index ■A Abstract Window Toolkit (AWT), 111 Access modifiers package-private, 27 private, 27 protected, 27 public, 27 Additive o ...
«
7
8
9
10
11
12
13
14
15
16
»
Free download pdf