Java Programming 24 Hour Trainer 1st Edition Yakov Fain download
Java Programming 24 Hour Trainer 1st Edition Yakov Fain download
https://ebookfinal.com/download/java-programming-24-hour-
trainer-1st-edition-yakov-fain/
https://ebookfinal.com/download/c-24-hour-trainer-2nd-edition-rod-
stephens/
https://ebookfinal.com/download/wordpress-24-hour-trainer-3rd-edition-
george-plumley/
https://ebookfinal.com/download/iphone-and-ipad-app-24-hour-
trainer-1st-edition-abhishek-mishra/
https://ebookfinal.com/download/knight-s-microsoft-business-
intelligence-24-hour-trainer-1st-edition-brian-knight/
Simply Java An Introduction to Java Programming
Programming Series 1st Edition James Levenick
https://ebookfinal.com/download/simply-java-an-introduction-to-java-
programming-programming-series-1st-edition-james-levenick/
https://ebookfinal.com/download/java-programming-exercises-volume-two-
java-standard-library-1st-edition-christian-ullenboom/
https://ebookfinal.com/download/java-servlet-programming-second-
edition-jason-hunter/
https://ebookfinal.com/download/learn-java-fundamentals-a-primer-for-
java-development-and-programming-1st-edition-jeff-friesen/
https://ebookfinal.com/download/wireless-java-programming-
with-j2me-1st-edition-yu-feng/
Java Programming 24 Hour Trainer 1st Edition Yakov
Fain Digital Instant Download
Author(s): Yakov Fain
ISBN(s): 9781118058190, 1118058194
Edition: 1
File Details: PDF, 12.38 MB
Year: 2011
Language: english
Java® Programming 24-Hour Trainer
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxix
Continues
Lesson 25 Remote Method Invocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Lesson 26 Java EE 6 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Lesson 27 Programming with Servlets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
Lesson 28 JavaServer Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
Lesson 29 Developing Web Applications with JSF. . . . . . . . . . . . . . . . . . . . . . . . . . 323
Lesson 30 Introducing JMS and MOM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
Lesson 31 Introducing JNDI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
Lesson 32 Introduction to Enterprise JavaBeans . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
Lesson 33 Introduction to the Java Persistence API. . . . . . . . . . . . . . . . . . . . . . . . . 375
Lesson 34 Working with RESTful Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
Lesson 35 Introduction to Spring MVC Framework . . . . . . . . . . . . . . . . . . . . . . . . . 399
Lesson 36 Introduction to Hibernate Framework. . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
Lesson 37 Bringing JavaFX to the Mix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
Lesson 38 Java Technical Interviews. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
Appendix What’s on the DVD?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
Java® Programming
24-Hour Trainer
Java® Programming
24-Hour Trainer
Yakov Fain
Java® Programming 24-Hour Trainer
Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright © 2011 by Wiley Publishing, Inc., Indianapolis, Indiana
ISBN: 978-0-470-88964-0
ISBN: 978-1-118-05817-6 (ebk)
ISBN: 978-1-118-05818-3 (ebk)
ISBN: 978-1-118-05819-0 (ebk)
10 9 8 7 6 5 4 3 2 1
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, elec-
tronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the
1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through
payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923,
(978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions
Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or
online at http://www.wiley.com/go/permissions.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with
respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including
without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or pro-
motional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold
with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services.
If professional assistance is required, the services of a competent professional person should be sought. Neither the pub-
lisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to
in this work as a citation and/or a potential source of further information does not mean that the author or the publisher
endorses the information the organization or Web site may provide or recommendations it may make. Further, readers
should be aware that Internet Web sites listed in this work may have changed or disappeared between when this work was
written and when it is read.
For general information on our other products and services please contact our Customer Care Department within the
United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard
print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD
or DVD that is not included in the version you purchased, you may download this material at http://booksupport
.wiley.com. For more information about Wiley products, visit www.wiley.com.
Library of Congress Control Number: 2010942181
Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress
are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other
countries, and may not be used without written permission. Java is a registered trademark of Oracle, Inc. All other trade-
marks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or vendor
mentioned in this book.
In memory of my friend, Felix Rubinchik.
About the Author
Elliotte Rusty Harold is originally from New Orleans, to which he returns periodically in search
of a decent bowl of gumbo. However, he currently resides in the Prospect Heights neighborhood
of Brooklyn with his wife Beth, dog Thor, and cat Marjorie. He is the author of numerous books
including Refactoring HTML, Java Network Programming, Java I/O, and Processing XML with
Java. His open source projects include the XOM Library for processing XML with Java and the
Amateur media player.
Credits
First of all I want to thank my family for understanding that stealing time from family to write a
computer book is OK.
I’d also like to thank Elliotte Rusty Harold from Google for his valuable comments during a
technical edit of this book. Elliotte himself has authored more than 20 computer books (see
http://www.elharo.com) and is respected in the Java community around the world. His
comments on my lessons ranged from the philosophical to a simple “I don’t agree with this
solution.” I have addressed all of them.
Three people volunteered to help me with the book: Nick Golubyev (Singapore), Dmitry Danileyko
(Russia), and Viktor Gamov (USA). They wrote several code samples for the book, which really
saved me time! Thank you, guys!
Big thanks to the Wiley editors for doing a great job of editing and for not cursing me for not meet-
ing deadlines.
Contents
Introduction xxix
Program Comments 21
First Useful Program 22
Conditional Statement if 25
switch Statement 26
Inheritance 26
Method Overriding 27
Try It 28
Lesson Requirements 28
Hints 28
Step-by-Step 28
Method Arguments 31
Method Overloading 31
Constructors 32
The Keyword super 34
The Keyword this 34
Passing by Value or by Reference 36
Variable Scopes 37
The Keyword static 37
Try It 38
Lesson Requirements 38
Step-by-Step 39
Arrays 41
Loops 42
Debugging Java Programs 46
More about if and switch Statements 48
The Flavors of if Statements 49
The switch Statement 50
Command-Line Arguments 51
Try It 52
Lesson Requirements 52
Step-by-Step 52
Java Packages 55
Encapsulation 56
Access Levels 57
xvi
CONTENTS
Abstract Classes 65
Assignment 65
Solution with an Abstract Class 66
Polymorphism 68
Making the Interface Solution Polymorphic 69
Interfaces versus Abstract Classes 70
Try It 71
Lesson Requirements 71
Step-by-Step 71
Swing Basics 75
Layout Managers 77
A Simple Calculator with FlowLayout 77
A Brief Introduction to Layout Managers 79
FlowLayout 79
GridLayout 79
BorderLayout 81
Combining Layout Managers 81
BoxLayout 84
GridBagLayout 84
CardLayout 86
Containers with Absolute Layout 86
More about Swing Widgets 86
Swing GUI Builders 87
Try It 87
Lesson Requirements 87
Step-by-Step 88
xvii
CONTENTS
xviii
Discovering Diverse Content Through
Random Scribd Documents
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.
• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookfinal.com