A Programmer's Guide to Java SCJP Certification: A Comprehensive Primer

Paperback
from $0.00

Author: Khalid A. Mughal

ISBN-10: 0321556054

ISBN-13: 9780321556059

Category: Java Certification

This book will help you prepare for and pass the Sun Certified Programmer for the Java Platform SE 6 (CX-310-065) Exam. It is written for any experienced programmer (with or without previous knowledge of Java) interested in mastering the Java programming language and passing the SCJP 1.6 Exam. \ A Programmer’s Guide to Java™ SCJP Certification, Third Edition, provides detailed coverage of all exam topics and objectives, readily runnable code examples, programming exercises, extensive review...

Search in google:

Th> A Programmer’s Guide to Java™ SCJP Certification, Third Edition, provides detailed coverage of all exam topics and objectives, readily runnable code examples, programming exercises, extensive review questions, and a new mock exam. In addition, as a comprehensive primer to the Java programming language, this book is an invaluable reference tool. This new edition has been thoroughly updated to focus on the latest version of the exam (CX-310-065). In particular, it contains in-depth explanations of the language features. Their usage is illustrated by way of code scenarios, as required by the exam. The companion Web site (www.ii.uib.no/~khalid/pgjc3e/) contains a version of the SCJP 1.6 Exam Simulator developed by the authors. The site also contains the complete source code for all the book’s examples, as well as solutions to the programming exercises.What you will find in this book: Extensive coverage of all the objectives defined for the Sun Certified Programmer for the Java Platform, Standard Edition 6 (CX-310-065) Exam An easy-to-follow structure with chapters organized according to the exam objectives, as laid out by Sun Microsystems Summaries that clearly state and differentiate the exam objectives and the supplementary objectives to be covered in each chapter A list of Sun’s objectives for the SCJP 1.6 Exam and a guide to taking the exam A complete mock exam with new questions (not repeats of review questions) Numerous exam-relevant review questions to test your understanding of each major topic, with annotated answers Programming exercises and solutionsat the end of each chapter Copious code examples illustrating concepts, where the code has been compiled and thoroughly tested on multiple platforms Program output demonstrating expected results from running the examples Extensive use of UML (Unified Modeling Language) for illustration purposes An introduction to basic terminology and concepts in object-oriented programming Advice on how to avoid common pitfalls in mastering the language and taking the exam Platform- and tool-independent coverage Information about the SCJP 1.6 Upgrade (CX-310-066) Exam

List of Figures xxiiiList of Tables xxviiList of Examples xxixForeword xxxvPreface xxxviiChapter 1: Basics of Java Programming 11.1 Introduction 21.2 Classes 21.3 Objects 41.4 Instance Members 61.5 Static Members 71.6 Inheritance 101.7 Aggregation 121.8 Tenets of Java 131.9 Java Programs 151.10 Sample Java Application 15Chapter 2: Language Fundamentals 192.1 Basic Language Elements 202.2 Primitive Data Types 282.3 Variable Declarations 312.4 Initial Values for Variables 33Chapter Summary 37Programming Exercise 37Chapter 3: Declarations 393.1 Class Declarations 403.2 JavaBeans Standard 413.3 Method Declarations 443.4 Constructors 483.5 Enumerated Types 543.6 Arrays 693.7 Parameter Passing 813.8 Variable Arity Methods 90Chapter Summary 100Programming Exercises 101Chapter 4: Access Control 1034.1 Java Source File Structure 1044.2 Packages 1054.3 Searching for Classes 1174.4 The JAR Utility 1204.5 System Properties 1224.6 Scope Rules 1294.7 Accessibility Modifiers for Top-Level Type Declarations 1324.8 Other Modifiers for Classes 1354.9 Member Accessibility Modifiers 1384.10 Other Modifiers for Members 146Chapter Summary 157Programming Exercise 157Chapter 5: Operators and Expressions 1595.1 Conversions 1605.2 Type Conversion Contexts 1635.3 Precedence and Associativity Rules for Operators 1665.4 Evaluation Order of Operands 1685.5 The Simple Assignment Operator = 1695.6 Arithmetic Operators: *, /,%, +, - 1745.7 The Binary String Concatenation Operator + 1855.8 Variable Increment and Decrement Operators: ++, -- 1865.9 Boolean Expressions 1905.10 Relational Operators: <, <=, >, >= 1905.11 Equality 1915.12 Boolean Logical Operators: !, ^, &, 1945.13 Conditional Operators: &&, 1965.14 The Conditional Operator: ?: 2015.15 Other Operators: new, [], instanceof 201Chapter Summary 202Programming Exercise 202Chapter 6: Control Flow 2036.1 Overview of Control Flow Statements 2046.2 Selection Statements 2046.3 Iteration Statements 2166.4 Transfer Statements 2236.5 Stack-Based Execution and Exception Propagation 2356.6 Exception Types 2396.7 Exception Handling: try, catch, and finally 2456.8 The throw Statement 2556.9 The throws Clause 2576.10 Assertions 265Chapter Summary 279Programming Exercises 279Chapter 7: Object-Oriented Programming 2837.1 Single Implementation Inheritance 2847.2 Overriding Methods 2887.3 Hiding Members 2947.4 The Object Reference super 2957.5 Chaining Constructors Using this() and super() 3027.6 Interfaces 3097.7 Arrays and Subtyping 3177.8 Reference Values and Conversions 3197.9 Reference Value Assignment Conversions 3207.10 Method Invocation Conversions Involving References 3237.11 Reference Casting and the instanceof Operator 3277.12 Polymorphism and Dynamic Method Lookup 3407.13 Inheritance Versus Aggregation 3427.14 Basic Concepts in Object-Oriented Design 345Chapter Summary 349Programming Exercises 349Chapter 8: Nested Type Declarations 3518.1 Overview of Nested Type Declarations 3528.2 Static Member Types 3558.3 Non-Static Member Classes 3598.4 Local Classes 3718.5 Anonymous Classes 377Chapter Summary 386Programming Exercise 386Chapter 9: Object Lifetime 3899.1 Garbage Collection 3909.2 Reachable Objects 3909.3 Facilitating Garbage Collection 3929.4 Object Finalization 3969.5 Finalizer Chaining 3979.6 Invoking Garbage Collection Programmatically 3989.7 Initializers 4069.8 Field Initializer Expressions 4069.9 Static Initializer Blocks 4109.10 Instance Initializer Blocks 4139.11 Constructing Initial Object State 416Chapter Summary 422Chapter 10: Fundamental Classes 42310.1 Overview of the java.lang Package 42410.2 The Object Class 42410.3 The Wrapper Classes 42810.4 The String Class 43910.5 The StringBuilder and the StringBuffer Classes 456Chapter Summary 464Programming Exercises 465Chapter 11: Files and Streams 46711.1 Input and Output 46811.2 The File Class 46811.3 Byte Streams: Input Streams and Output Streams 47511.4 Character Streams: Readers and Writers 48811.5 The Console class 50011.6 Object Serialization 510Chapter Summary 529Programming Exercise 530Chapter 12: Localization, Pattern Matching, and Formatting 53112.1 The java.util.Locale Class 53212.2 The java.util.Date Class 53512.3 The java.util.Calendar Class 53612.4 The java.text.DateFormat Class 54112.5 The java.text.NumberFormat Class 54612.6 String Pattern Matching Using Regular Expressions 55412.7 Formatting Values 593Chapter Summary 610Programming Exercises 610Chapter 13: Threads 61313.1 Multitasking 61413.2 Overview of Threads 61413.3 The Main Thread 61513.4 Thread Creation 61513.5 Synchronization 62613.6 Thread Transitions 634Chapter Summary 658Programming Exercises 659Chapter 14: Generics 66114.1 Introducing Generics 66214.2 Generic Types and Parameterized Types 66314.3 Collections and Generics 67214.4 Wildcards 67314.5 Using References of Wildcard Parameterized Types 67814.6 Bounded Type Parameters 68414.7 Implementing a Simplified Generic Stack 69514.8 Generic Methods and Constructors 69714.9 Wildcard Capture 70314.10 Flexibility with Wildcard Parameterized Types 70514.11 Type Erasure 71414.12 Implications for Overloading and Overriding 71614.13 Limitations and Restrictions on Generic Types 722Chapter Summary 744Programming Exercises 745Chapter 15: Collections and Maps 74715.1 Comparing Objects 74815.2 The Java Collections Framework 77715.3 Collections 78415.4 Sets 79615.5 The SortedSet<E> and NavigableSet<E> Interfaces 80015.7 Queues 80915.8 Maps 82115.9 Map Implementations 82315.10 The SortedMap<K,V> and NavigableMap<K,V> Interfaces 82615.11 Working with Collections 838Chapter Summary 849Programming Exercises 850Appendix A: Taking the SCJP 1.6 Exam 851A.1 Preparing for the Programmer Exam 851A.2 Registering for the Exam 852A.3 How the Examination Is Conducted 853A.4 The Questions 854A.5 Moving on to Other Java Technology Exams 856Appendix B: Objectives for the SCJP 1.6 Exam 857Appendix C: Objectives for the SCJP 1.6 Upgrade Exam 863Appendix D: Annotated Answers to Review Questions 869Appendix E: Solutions to Programming Exercises 935Appendix F: Mock Exam 959Appendix G: Number Systems and Number Representation 1005G.1 Number Systems 1005G.2 Relationship between Binary, Octal, and Hexadecimal Numbers 1007G.3 Converting Decimals 1008G.4 Representing Integers 1010Index 1013