Foundations of Java for ABAP Programmers

216 572 6
Foundations of Java for ABAP Programmers

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Foundations of Java for ABAP Programmers

6250FM.qxd 2/22/06 4:44 PM Page i Foundations of Java for ABAP Programmers Alistair Rooney 6250FM.qxd 2/22/06 4:44 PM Page ii Foundations of Java for ABAP Programmers Copyright © 2006 by Alistair Rooney All rights reserved No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher ISBN-13: 978-1-59059-625-8 ISBN-10: 1-59059-625-0 Library of Congress Cataloging-in-Publication data is available upon request Printed and bound in the United States of America Trademarked names may appear in this book Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark Lead Editor: Steve Anglin Technical Reviewers: Gene Ames, Stefan Keuker Editorial Board: Steve Anglin, Dan Appleman, Ewan Buckingham, Gary Cornell, Jason Gilmore, Jonathan Hassell, Chris Mills, Dominic Shakeshaft, Jim Sumser Project Manager: Richard Dal Porto Copy Edit Manager: Nicole LeClerc Copy Editor: Andy Carroll Assistant Production Director: Kari Brooks-Copony Production Editor: Janet Vail Compositor: Dina Quan Proofreader: April Eddy Indexer: Toma Mulligan/Book Indexers Artist: April Milne Cover Designer: Kurt Krames Manufacturing Director: Tom Debolski Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor, New York, NY 10013 Phone 1-800-SPRINGER, fax 201-348-4505, e-mail orders-ny@springer-sbm.com, or visit http://www.springeronline.com For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219, Berkeley, CA 94710 Phone 510-549-5930, fax 510-549-5939, e-mail info@apress.com, or visit http://www.apress.com The information in this book is distributed on an “as is” basis, without warranty Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work The source code for this book is available to readers at http://www.apress.com in the Source Code section 6250FM.qxd 2/22/06 4:44 PM Page iii To Lisa, Samantha, & Justin 6250FM.qxd 2/22/06 4:44 PM Page iv Contents at a Glance About the Author xiii Acknowledgments xv Introduction xvii PART iv ■■■ Introducing Java ■LESSON Your First Java Program ■LESSON Object Orientation in a Nutshell ■LESSON The Primitive Data Types 13 ■LESSON Comments 17 ■LESSON Naming Standards and Conventions 19 ■LESSON The Java Operators 21 ■LESSON Strings with Java 29 ■LESSON Control Flow 35 ■LESSON Jump Statements 41 ■LESSON 10 Arrays and Collections in Java 43 ■LESSON 11 Object Orientation in Java 49 ■LESSON 12 More OO in Java—Interfaces and Abstract Classes 57 ■LESSON 13 Inner, Nested, and Anonymous Classes 61 ■LESSON 14 Errors and Exceptions 65 ■LESSON 15 Threads, Daemons, and Garbage Collection 71 ■LESSON 16 Basic Swing Using Default Layouts 79 ■LESSON 17 Event Handling 83 ■LESSON 18 Layout Managers and Other Components 87 6250FM.qxd 2/22/06 4:44 PM PART Page v ■■■ Enterprise Java ■LESSON 19 JDBC Technology 97 ■LESSON 20 The Java Connector (JCo) 107 ■LESSON 21 Servlets 115 ■LESSON 22 JavaServer Pages (JSP) 133 ■LESSON 23 Extensible Markup Language (XML) 145 ■LESSON 24 Java Messaging Services 165 ■LESSON 25 Enterprise JavaBeans 3.0 171 ■INDEX 193 v 6250FM.qxd 2/22/06 4:44 PM Page vi 6250FM.qxd 2/22/06 4:44 PM Page vii Contents About the Author xiii Acknowledgments xv Introduction xvii PART ■LESSON ■■■ Introducing Java Your First Java Program Hello World of Abapers ■LESSON Object Orientation in a Nutshell The Nutshell—Encapsulation Inheritance and Polymorphism The Conceptual Model (A Glimpse of UML) 10 ■LESSON The Primitive Data Types 13 Boolean 13 Byte 14 Integer 14 Long 14 Short 15 Float 15 Double 15 Char 15 Data Types Summary 16 ■LESSON Comments 17 Block Comments 17 Line Comments 18 Javadoc Comments 18 vii 6250FM.qxd viii 2/22/06 4:44 PM Page viii ■CONTENTS ■LESSON Naming Standards and Conventions 19 Legal and Illegal Names 19 Java Conventions 20 ■LESSON The Java Operators 21 Arithmetic Operators 21 Relational Operators 22 Increment Operators 22 Logical Operators 23 Bitwise Operators 24 Block Scope 26 ■LESSON Strings with Java 29 Declaring a String 30 Concatenating Strings 31 Using the String Methods 31 The charAt Method 31 The substring Method 32 The equals Method 32 The length Method 32 Using the StringBuffer Class 33 The append Method 33 The insert Method 33 Using the StringTokenizer Class 34 ■LESSON Control Flow 35 Using the if Statement 35 Using the ? and : Operators 36 Using the switch Statement 37 Looping 38 The while Loop 38 The for Loop 39 The Loop 40 6250FM.qxd 2/22/06 4:44 PM Page ix ■CONTENTS ■LESSON Jump Statements 41 The break Statement 41 The continue Statement 42 The return Statement 42 ■LESSON 10 Arrays and Collections in Java 43 Using Arrays 43 The Array Index 44 Declaring an Array 44 Creating the Array 44 Filling the Array 45 Multidimensional Arrays 46 The Vector Class 46 Using Vectors 47 ■LESSON 11 Object Orientation in Java 49 The Pillars of OO 49 Java Class Structure 50 Inheritance and Polymorphism 51 Encapsulation 53 Abstraction 56 ■LESSON 12 More OO in Java—Interfaces and Abstract Classes 57 Abstract Classes 57 Interfaces 59 ■LESSON 13 Inner, Nested, and Anonymous Classes 61 Inner Classes 61 Nested Classes 62 Anonymous Classes 63 ■LESSON 14 Errors and Exceptions 65 The Throwable Class 65 Exception Handling 66 The try catch block 66 The finally block 68 Exception Throwing 69 ix ...6250FM.qxd 2/22/06 4:44 PM Page i Foundations of Java for ABAP Programmers Alistair Rooney 6250FM.qxd 2/22/06 4:44 PM Page ii Foundations of Java for ABAP Programmers Copyright © 2006 by Alistair... SAP platform for delivering web services Make no mistake—SAP is very serious about Java It is not a passing fancy or an attempt to be fashionable When I first lectured about Java to ABAP programmers. .. Introducing Java In this first section, we will explore the basic constructs of the Java language You shouldn’t skip any of these lessons, since they will lay the foundation for the second part of the

Ngày đăng: 21/08/2012, 09:30

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan