Introduction. Assessment Test. Part I The Programmer s Exam 1

Similar documents
The Sun s Java Certification and its Possible Role in the Joint Teaching Material

Contents. Figures. Tables. Examples. Foreword. Preface. 1 Basics of Java Programming 1. xix. xxi. xxiii. xxvii. xxix

1 OBJECT-ORIENTED PROGRAMMING 1

Contents. iii Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1998, Revision B

Application Development in JAVA. Data Types, Variable, Comments & Operators. Part I: Core Java (J2SE) Getting Started

Java Fundamentals p. 1 The Origins of Java p. 2 How Java Relates to C and C++ p. 3 How Java Relates to C# p. 4 Java's Contribution to the Internet p.

Syllabus & Curriculum for Certificate Course in Java. CALL: , for Queries

Core Java - SCJP. Q2Technologies, Rajajinagar. Course content

Introduction... xv SECTION 1: DEVELOPING DESKTOP APPLICATIONS USING JAVA Chapter 1: Getting Started with Java... 1

CONTENTS. PART 1 Structured Programming 1. 1 Getting started 3. 2 Basic programming elements 17

"Charting the Course... Java Programming Language. Course Summary

Murach s Beginning Java with Eclipse

Introduction to Programming Using Java (98-388)

[Course Overview] After completing this module you are ready to: Develop Desktop applications, Networking & Multi-threaded programs in java.

Core Java SYLLABUS COVERAGE SYLLABUS IN DETAILS

GUJARAT TECHNOLOGICAL UNIVERSITY

C ONTENTS PART I FUNDAMENTALS OF PROGRAMMING 1. and Java 3. Chapter 1 Introduction to Computers, Programs,

Java Programming Training for Experienced Programmers (5 Days)

Supporting Materials

Table of Contents. Preface... xxi

Mobile MOUSe JAVA2 FOR PROGRAMMERS ONLINE COURSE OUTLINE

Java Training JAVA. Introduction of Java

Index COPYRIGHTED MATERIAL

Software Development & Education Center. Java Platform, Standard Edition 7 (JSE 7)

Java Primer 1: Types, Classes and Operators

15CS45 : OBJECT ORIENTED CONCEPTS

Computer Programming C++ (wg) CCOs

CSC 1214: Object-Oriented Programming

A Quick Tour p. 1 Getting Started p. 1 Variables p. 3 Comments in Code p. 6 Named Constants p. 6 Unicode Characters p. 8 Flow of Control p.

Points To Remember for SCJP

Microsoft. Microsoft Visual C# Step by Step. John Sharp

Operators and Expressions

Contents Introduction 1

1 Shyam sir JAVA Notes

Java for Programmers Course (equivalent to SL 275) 36 Contact Hours

Fundamentals of the Java Programming Language

WA1278 Introduction to Java Using Eclipse

Java Programming Course Overview. Duration: 35 hours. Price: $900

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS

Core JAVA Training Syllabus FEE: RS. 8000/-

Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal

Language Features. 1. The primitive types int, double, and boolean are part of the AP

Microsoft Visual C# Step by Step. John Sharp

SYLLABUS JAVA COURSE DETAILS. DURATION: 60 Hours. With Live Hands-on Sessions J P I N F O T E C H

ощ 'ршорвшэш! цвн-эориэу ощ 'sajbpossv # PIPG DUJ 'ssjmoossv ^ PIPG pipa w н OX ЛЮН VAV

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

DOWNLOAD PDF CORE JAVA APTITUDE QUESTIONS AND ANSWERS

CS5000: Foundations of Programming. Mingon Kang, PhD Computer Science, Kennesaw State University

Training topic: OCPJP (Oracle certified professional Java programmer) or SCJP (Sun certified Java programmer) Content and Objectives

This page intentionally left blank

JAC444 - Lecture 1. Introduction to Java Programming Language Segment 4. Jordan Anastasiade Java Programming Language Course

SELF-STUDY. Glossary

Chapter 2: Using Data

Course Description. Learn To: : Intro to JAVA SE7 and Programming using JAVA SE7. Course Outline ::

Java Overview An introduction to the Java Programming Language

3. Java - Language Constructs I

OracleAS 10g R3: Java Programming

(800) Toll Free (804) Fax Introduction to Java and Enterprise Java using Eclipse IDE Duration: 5 days

Chapter 2 Using Data. Instructor s Manual Table of Contents. At a Glance. Overview. Objectives. Teaching Tips. Quick Quizzes. Class Discussion Topics

MyProgram m i ng Lab. get with the programming. Through the power of practice and immediate personalized

Contents. 1 Introduction to Computers, the Internet and the World Wide Web 1. 2 Introduction to C Programming 26

Page 1

Preface... (vii) CHAPTER 1 INTRODUCTION TO COMPUTERS

Certification In Java Language Course Course Content

CONTENTS. Chapter 1 Getting Started with Java SE 6 1. Chapter 2 Exploring Variables, Data Types, Operators and Arrays 13

The Java Tutorial. A Short Course on the Basics. Raymond Gallardo. Sowmya Kannan. AAddison-Wesley. Sharon Biocca Zakhour.

Full file at


Expressions and Data Types CSC 121 Fall 2015 Howard Rosenthal

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub

JAVA REVIEW cs2420 Introduction to Algorithms and Data Structures Spring 2015

JAVA. A. Zakiuddin Ahmed. M.Sc.,M.Phil M.S.(Edn), PGDCSM, Professor in Computer Science, P. Rizwan Ahmed. MCA., M.Sc.,M.A., M.Phil.

CHAPTER 1: A GENERAL INTRODUCTION TO PROGRAMMING 1

Program Fundamentals

PESIT Bangalore South Campus

Programming in Scala Second Edition

Core Java Syllabus. Overview

Java enum, casts, and others (Select portions of Chapters 4 & 5)

Language Reference Manual simplicity

Expressions and Casting. Data Manipulation. Simple Program 11/5/2013

Compaq Interview Questions And Answers

Module 2 - Part 2 DATA TYPES AND EXPRESSIONS 1/15/19 CSE 1321 MODULE 2 1

CONTENTS. INTRODUCTION xvii

Core Java Contents. Duration: 25 Hours (1 Month)

Oracle 10g: Java Programming

E Oracle 10g Java Bootcamp I v1

Language Fundamentals Summary

Java 8 Programming for OO Experienced Developers

Expressions and Casting

SOME ASSEMBLY REQUIRED

ABOUT CORE JAVA COURSE SCOPE:

CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY JAVA

Type of Classes Nested Classes Inner Classes Local and Anonymous Inner Classes

Contents. 1 Introduction to Computers, the Internet and the Web 1

VALLIAMMAI ENGINEERING COLLEGE

MARS AREA SCHOOL DISTRICT Curriculum TECHNOLOGY EDUCATION

Table of Contents. Chapter 1 Getting Started with Java SE 7 1. Chapter 2 Exploring Class Members in Java 15. iii. Introduction of Java SE 7...

5/23/2015. Core Java Syllabus. VikRam ShaRma

This course is designed for web developers that want to learn HTML5, CSS3, JavaScript and jquery.

LTBP INDUSTRIAL TRAINING INSTITUTE

Transcription:

4276FM.fm Page ix Thursday, October 2, 2003 11:22 AM at a Glance Introduction Assessment Test xix xxv Part I The Programmer s Exam 1 Chapter 1 Language Fundamentals 3 Chapter 2 Operators and Assignments 29 Chapter 3 Modifiers 71 Chapter 4 Converting and Casting 97 Chapter 5 Flow Control, Assertions, and Exception Handling 123 Chapter 6 Objects and Classes 159 Chapter 7 Threads 193 Chapter 8 The java.lang and java.util Packages 227 Part II The Developer s Exam 261 Chapter 9 Taking the Developer s Exam 263 Chapter 10 Creating the User Interface with Swing 295 Chapter 11 Layout Managers 337 Chapter 12 Writing the Network Protocol 379 Chapter 13 Connecting Client and Server 415 Chapter 14 Enhancing and Extending the Database 439 Chapter 15 Building the Database Server 465 Appendix A Practice Exam 485 COPYRIGHTED MATERIAL Glossary 505 Index 519

4276FM.fm Page x Thursday, October 2, 2003 11:22 AM Introduction Assessment Test xix xxv Part I The Programmer s Exam 1 Chapter 1 Language Fundamentals 3 Source Files 4 Keywords and Identifiers 5 Primitive Data Types 6 Literals 9 boolean Literals 9 char Literals 9 Integral Literals 10 Floating-Point Literals 10 String Literals 10 Arrays 11 Class Fundamentals 13 The main() Method 14 Variables and Initialization 14 Argument Passing: By Reference or By Value 16 Garbage Collection 19 Summary 21 Exam Essentials 22 Key Terms 23 Review Questions 24 Answers to Review Questions 27 Chapter 2 Operators and Assignments 29 Evaluation Order 31 The Unary Operators 31 The Increment and Decrement Operators: ++ and -- 32 The Unary Plus and Minus Operators: + and - 32 The Bitwise Inversion Operator: ~ 33 The Boolean Complement Operator:! 33 The Cast Operator: (type) 34 The Arithmetic Operators 35 The Multiplication and Division Operators: * and / 35 The Modulo Operator: % 36 The Addition and Subtraction Operators: + and - 37 Arithmetic Error Conditions 40

4276FM.fm Page xi Thursday, October 2, 2003 11:22 AM xi The Shift Operators: <<, >>, and >>> 41 Fundamentals of Shifting 41 Shifting Negative Numbers 42 Reduction of the Right Operand 45 Arithmetic Promotion of Operands 46 The Comparison Operators 47 Ordinal Comparisons with <, <=, >, and >= 47 The instanceof Operator 48 The Equality Comparison Operators: == and!= 50 The Bitwise Operators: &, ^, and 51 Boolean Operations 54 The Short-Circuit Logical Operators 56 The Conditional Operator:?: 58 The Assignment Operators 59 An Assignment Has Value 60 Summary 61 Exam Essentials 63 Key Terms 64 Review Questions 65 Answers to Review Questions 68 Chapter 3 Modifiers 71 Modifier Overview 72 The Access Modifiers 72 public 73 private 73 Default 75 protected 76 Subclasses and Method Privacy 78 Summary of Access Modes 79 Other Modifiers 79 final 79 abstract 80 static 82 Static Initializers 85 native 85 transient 86 synchronized 87 volatile 87 Modifiers and Features 87 Summary 88 Exam Essentials 89 Key Terms 89 Review Questions 90 Answers to Review Questions 95

4276FM.fm Page xii Thursday, October 2, 2003 11:22 AM xii Chapter 4 Converting and Casting 97 Explicit and Implicit Type Changes 98 Primitives and Conversion 99 Primitive Conversion: Assignment 99 Assignment Conversion, Narrower Primitives, and Literal Values 102 Primitive Conversion: Method Call 103 Primitive Conversion: Arithmetic Promotion 103 Primitives and Casting 105 Object Reference Conversion 107 Object Reference Assignment Conversion 108 Object Method-Call Conversion 110 Object Reference Casting 111 Summary 115 Exam Essentials 115 Key Terms 116 Review Questions 117 Answers to Review Questions 121 Chapter 5 Flow Control, Assertions, and Exception Handling 123 The Loop Constructs 124 The while() Loop 124 The do Loop 126 The for() Loop 126 The break and continue Statements in Loops 129 The Selection Statements 131 The if()/else Construct 131 The switch() Construct 132 Exceptions 133 Flow of Control in Exception Conditions 133 Throwing Exceptions 137 Assertions 143 Assertions and Compilation 144 Runtime Enabling of Assertions 144 Using Assertions 144 Summary 146 Exam Essentials 147 Key Terms 148 Review Questions 149 Answers to Review Questions 156 Chapter 6 Objects and Classes 159 Benefits of Object-Oriented Implementation 160

4276FM.fm Page xiii Thursday, October 2, 2003 11:22 AM xiii Encapsulation 160 Re-use 162 Implementing Object-Oriented Relationships 162 Overloading and Overriding 163 Overloading Method Names 164 Method Overriding 166 Constructors and Subclassing 170 Overloading Constructors 172 Inner Classes 173 The Enclosing this Reference and Construction of Inner Classes 175 Member Classes 176 Classes Defined Inside Methods 177 Summary 183 Exam Essentials 183 Key Terms 184 Review Questions 185 Answers to Review Questions 190 Chapter 7 Threads 193 Thread Fundamentals 194 What a Thread Executes 195 When Execution Ends 197 Thread States 197 Thread Priorities 198 Controlling Threads 199 Yielding 199 Suspending 201 Sleeping 201 Blocking 202 Monitor States 204 Scheduling Implementations 204 Monitors, wait(), and notify() 205 The Object Lock and Synchronization 207 wait() and notify() 208 The Class Lock 213 Beyond the Pure Model 213 Deadlock 215 Another Way to Synchronize 217 Summary 218 Exam Essentials 219

4276FM.fm Page xiv Thursday, October 2, 2003 11:22 AM xiv Key Terms 220 Review Questions 221 Answers to Review Questions 225 Chapter 8 The java.lang and java.util Packages 227 The Object Class 228 The Math Class 229 The Wrapper Classes 231 Strings 234 The String Class 235 The StringBuffer Class 238 String Concatenation the Easy Way 240 The Collections API 241 Collection Types 242 Collections, Equality, and Sorting 244 The hashcode() Method 245 Collection Implementations in the API 246 Collections and Code Maintenance 247 Summary 253 Summary of Collections 254 Exam Essentials 254 Key Terms 255 Review Questions 256 Answers to Review Questions 259 Part II The Developer s Exam 261 Chapter 9 Taking the Developer s Exam 263 Are You Ready for the Exam? 264 Formalities of the Exam 266 Downloading the Assignment 266 Taking the Follow-up Exam 267 What the Assignment Covers 267 How the Assignment and Exam Are Graded 268 Structure of the Assignment 268 Code and APIs Provided 269 Example Assignment: Build a Trouble-Ticket System 270 GUI Development 272 Database/Server Development 273 Client-Server Logic 274 Coding Tips 275 Adhere to Supplied Naming 275

4276FM.fm Page xv Thursday, October 2, 2003 11:22 AM xv Stress Readability 275 Use Standard Design Patterns 276 Submission Requirements 276 Using javadoc 278 File Structure 279 Writing the README file 281 Using the JAR Tool 282 Preparation for the Follow-up Exam 284 What Are the Choices for Data Structures? 284 Is Implementing Runnable Better Than Extending Thread? 284 How Elaborate Should an Exception Class Structure Get? 285 How Many Ways Can You Set Up Listener Relationships? Which One Is Best? 285 How Do I Know Which Layout Manager to Use? 286 Which Design Patterns Are Most Useful in This Kind of Project? 287 When Does It Make Sense to Use protected and default Scope? 287 Doesn t an Abstract Class Let the Developer Specify More Behavior Than an Interface? 289 Summary 290 Exam Essentials 291 Key Terms 291 Review Questions 292 Answers to Review Questions 293 Chapter 10 Creating the User Interface with Swing 295 Defining the GUI s Requirements 297 Identifying Needed Components 297 Sketching the GUI 298 Isolating Regions of Behavior 299 Choosing Layout Managers 300 Common Swing Methods 300 getsize() and setsize() 301 getlocation() and setlocation() 301 setforeground() and setbackground() 301 setfont() 301 setenabled() 301 Basic Swing Components 302 Container Components 302 Ordinary Components 305 Menu Components 314 Building a JTable 316 Using AbstractTableModel 319

4276FM.fm Page xvi Thursday, October 2, 2003 11:22 AM xvi Building a JTree 323 JMenus and Actions 327 Panes 329 JSplitPane 330 JOptionPane 331 Summary 332 Exam Essentials 333 Key Terms 333 Review Questions 334 Answers to Review Questions 335 Chapter 11 Layout Managers 337 Layout Manager Theory 338 Component Size and Position 341 Layout Policies 343 The Flow Layout Manager 343 The Grid Layout Manager 345 The Border Layout Manager 347 The Card Layout Manager 354 The GridBag Layout Manager 359 Other Layout Options 374 Summary 375 Exam Essentials 375 Key Terms 376 Review Questions 377 Answers to Review Questions 378 Chapter 12 Writing the Network Protocol 379 Client-Server from Scratch 381 Server Operation 381 Connecting Clients to the Server 384 Communication Protocol 384 The Client Request Structure 387 Limitations of the Model 394 Remote Method Invocation (RMI) 395 A Model RMI Transaction 396 Implementing RMI 397 Limitations of RMI 401 More on Threads 402 Sharing Threads 403 Summary 410 Exam Essentials 410 Key Terms 411

4276FM.fm Page xvii Thursday, October 2, 2003 11:22 AM xvii Review Questions 412 Answers to Review Questions 413 Chapter 13 Connecting Client and Server 415 Events Basics 416 Event Naming Conventions 417 Event Notification 417 Using Java Bean Conventions 420 Java Beans and the MVC Design Pattern 423 Listeners 425 Remote Notification 432 Using Distributed Notification 434 Summary 435 Exam Essentials 435 Key Terms 436 Review Questions 437 Answers to Review Questions 438 Chapter 14 Enhancing and Extending the Database 439 Two-Tier Databases 440 Designing a Basic Scheme 441 Using Interfaces 442 Using Abstract Classes 447 Issues in Implementation 451 Exception Handling 451 Design Impediments 454 Thread Safety 456 Supporting New Features 459 Summary 460 Exam Essentials 460 Key Terms 461 Review Questions 462 Answers to Review Questions 463 Chapter 15 Building the Database Server 465 Database Requirements 466 Implementing RMI 467 Exporting with UnicastRemoteObject 471 Exporting an Activatable Object 475 Record Locking 479 Summary 481 Exam Essentials 482 Key Terms 482

4276FM.fm Page xviii Thursday, October 2, 2003 11:22 AM xviii Review Questions 483 Answers to Review Questions 484 Appendix A Practice Exam 485 Answers to Practice Exam 500 Glossary 505 Index 519