Share E-Book

Java Essentials Volume 2 Object-Oriented Programming and Beyond (Vibrant Publishers etc.)(Z-Library)

Author Vibrant Publishers, Lawrence G. Decamora III

Java
Language English

No Description

Format PDF
Size 32.7 MB
19
Views
0
Downloads
0.00
Total Donations
(First 20 pages)

Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Page 1
(This page has no text content)
Page 2
Exclusive Online Resources for You As our valued reader, your purchase of this book includes access to exclusive online resources designed to enhance your learning experience. These resources can be downloaded from our website, www.vibrantpublishers.com, and are created to help you apply Java® concepts effectively. Online resources for this book include the following: 1. Java codes used in the book 2. Additional coding tasks Why are these online resources valuable: ● Practical application: The downloadable codes are provided for easy testing and use. ● Enhanced learning experience: The additional coding tasks will provide hands-on experience and help you apply the knowledge learned from the book in practical scenarios. How to access your online resources: 1. Visit the website: Go to www.vibrantpublishers.com 2. Find your book: Navigate to the book’s product page via the “Shop” menu or by searching for the book title in the search bar. 3. Request the resources: Scroll down to the "Request Sample Book/Online Resource" section. 4. Enter your details: Enter your preferred email ID and select "Online Resource" as the resource type. Lastly, select “user type” and submit the request.
Page 3
Alternatively, for quick access: simply scan the QR code below to go directly to the product page and request the online resources by filling in the required details. Happy learning! 5. Check your inbox: The resources will be delivered directly to your email.
Page 4
Master object-oriented Java programming for professional application development VOLUME : OBJECT-ORIENTED PROGRAMMING2 AND BEYOND SELF-LEARNING MANAGEMENT SERIES LAWRENCE G. DECAMORA III, PH.D. ®
Page 5
JAVA ESSENTIALS VOLUME 2: OBJECT-ORIENTED PROGRAMMING AND BEYOND Copyright © 2026, by Vibrant Publishers LLC, USA. All rights reserved. No part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior permission of the publisher. Published by Vibrant Publishers LLC, USA, www.vibrantpublishers.com Paperback ISBN 13: 978-1-63651-656-1 Ebook ISBN 13: 978-1-63651-657-8 Hardback ISBN 13: 978-1-63651-658-5 This publication is designed to provide accurate and authoritative information regarding the subject matter covered. The Author has made every effort in the preparation of this book to ensure the accuracy of the information. However, information in this book is sold without warranty, either expressed or implied. The Author or the Publisher will not be liable for any damages caused or alleged to be caused either directly or indirectly by this book. All trademarks and registered trademarks mentioned in this publication are the property of their respective owners. These trademarks are used for editorial and educational purposes only, without intent to infringe upon any trademark rights. This publication is independent and has not been authorized, endorsed, or approved by any trademark owner. Vibrant Publishers’ books are available at special quantity discounts for sales promotions, or for use in corporate training programs. For more information, please write to bulkorders@vibrantpublishers.com Please email feedback/corrections (technical, grammatical, or spelling) to spellerrors@vibrantpublishers.com Vibrant 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 in print-on-demand. To access the complete catalog of Vibrant Publishers, visit www.vibrantpublishers.com
Page 6
SELF-LEARNING MANAGEMENT SERIES TITLE PAPERBACK* ISBN BUSINESS AND ENTREPRENEURSHIP BUSINESS COMMUNICATION ESSENTIALS 9781636511634 BUSINESS ETHICS ESSENTIALS 9781636513324 BUSINESS LAW ESSENTIALS 9781636511702 BUSINESS PLAN ESSENTIALS 9781636511214 BUSINESS STRATEGY ESSENTIALS 9781949395778 ENTREPRENEURSHIP ESSENTIALS 9781636511603 INTERNATIONAL BUSINESS ESSENTIALS 9781636513294 PRINCIPLES OF MANAGEMENT ESSENTIALS 9781636511542 COMPUTER SCIENCE AND TECHNOLOGY BLOCKCHAIN ESSENTIALS 9781636513003 CYBERSECURITY ESSENTIALS 9781636514888 MACHINE LEARNING ESSENTIALS 9781636513775 PYTHON ESSENTIALS 9781636512938 DATA SCIENCE FOR BUSINESS BUSINESS ANALYTICS ESSENTIALS 9781636514154 BUSINESS INTELLIGENCE ESSENTIALS 9781636513362 DATA ANALYTICS ESSENTIALS 9781636511184 FINANCIAL LITERACY AND ECONOMICS COST ACCOUNTING & MANAGEMENT ESSENTIALS 9781636511030 FINANCIAL ACCOUNTING ESSENTIALS 9781636510972 FINANCIAL MANAGEMENT ESSENTIALS 9781636511009 MACROECONOMICS ESSENTIALS 9781636511818 MICROECONOMICS ESSENTIALS 9781636511153 PERSONAL FINANCE ESSENTIALS 9781636511849 PRINCIPLES OF ECONOMICS ESSENTIALS 9781636512334 *Also available in Hardback & Ebook formats
Page 7
SELF-LEARNING MANAGEMENT SERIES TITLE PAPERBACK* ISBN HR, DIVERSITY, AND ORGANIZATIONAL SUCCESS DIVERSITY, EQUITY, AND INCLUSION ESSENTIALS 9781636512976 DIVERSITY IN THE WORKPLACE ESSENTIALS 9781636511122 HR ANALYTICS ESSENTIALS 9781636510347 HUMAN RESOURCE MANAGEMENT ESSENTIALS 9781949395839 ORGANIZATIONAL BEHAVIOR ESSENTIALS 9781636512303 ORGANIZATIONAL DEVELOPMENT ESSENTIALS 9781636511481 LEADERSHIP AND PERSONAL DEVELOPMENT DECISION MAKING ESSENTIALS 9781636510026 INCLUSIVE LEADERSHIP ESSENTIALS 9781636514765 INDIA’S ROAD TO TRANSFORMATION: WHY LEADERSHIP MATTERS 9781636512273 LEADERSHIP ESSENTIALS 9781636510316 TIME MANAGEMENT ESSENTIALS 9781636511665 MODERN MARKETING AND SALES CONSUMER BEHAVIOR ESSENTIALS 9781636513263 DIGITAL MARKETING ESSENTIALS 9781949395747 MARKETING MANAGEMENT ESSENTIALS 9781636511788 MARKET RESEARCH ESSENTIALS 9781636513744 MODERN ADVERTISING ESSENTIALS 9781636514857 SALES MANAGEMENT ESSENTIALS 9781636510743 SERVICES MARKETING ESSENTIALS 9781636511733 SOCIAL MEDIA MARKETING ESSENTIALS 9781636512181 *Also available in Hardback & Ebook formats
Page 8
SELF-LEARNING MANAGEMENT SERIES TITLE PAPERBACK* ISBN OPERATIONS MANAGEMENT AGILE ESSENTIALS 9781636510057 OPERATIONS & SUPPLY CHAIN MANAGEMENT ESSENTIALS 9781949395242 PRODUCT MANAGEMENT ESSENTIALS 9781636514796 PROJECT MANAGEMENT ESSENTIALS 9781636510712 STAKEHOLDER ENGAGEMENT ESSENTIALS 9781636511511 CURRENT AFFAIRS DIGITAL SHOCK 9781636513805 *Also available in Hardback & Ebook formats
Page 9
To Odette, my wonderful mom, who inspired me to always reach for the stars. To Michelle, my wife, who inspired me to always do better. To Danielle and Elisha, our wonderful daughters and our bundle of joy. To our Lord Jesus Christ, who sustained me and gave us everything that we need according to His riches and Glory.
Page 10
About the Author Lawrence G. Decamora III, Ph.D., is an accomplished computer science educator, author, and industry professional with extensive experience in software development and academia. Holding prestigious certifications including Sun Certified Java Programmer (SCJP) and Oracle Certified Professional Java Programmer (OCPJP), he has contributed significantly to the field of information technology. Dr. Decamora has been a dedicated instructor in computer science, information systems, and information technology for over two decades. He has taught at renowned institutions such as the University of Santo Tomas, De La Salle-College of Saint Benilde, and Mapua Institute of Technology. His academic leadership includes serving as the Acting ITE Program Director and an Academic Head, mentoring countless students and aspiring IT professionals. In the industry, Dr. Decamora has collaborated with leading organizations like Sun Microsystems Philippines, Phoenix One Knowledge Solutions Inc. , and ActiveLearning Inc., providing Java training and software development solutions. His expertise spans Java programming, enterprise applications, and web technologies. Beyond teaching, Dr. Decamora is a sought-after speaker and trainer, having conducted seminars and workshops on Java programming, software engineering,
Page 11
and emerging technologies. His passion for knowledge sharing is evident in his commitment to empowering learners through practical insights and real-world applications. This book is a testament to his dedication to making Java accessible to learners at all levels. Through clear explanations and hands-on examples, Dr. Decamora continues to inspire and guide the next generation of developers.
Page 12
What Experts Say About This Book! Java Essentials Volume 2 is a well-crafted text that sets clear learning objectives for each chapter. It leads students through the material with clear, well-coded examples. I support the focus on design and engineering, not “programming.” – John McManus, Ph.D. Associate Professor of Computer Science Randolph-Macon College Having interviewed, technically assessed, mentored, and worked alongside engineers at every level in both start-ups and larger organisations, I’ve seen how easy it is to drift away from core Java best practices over time. This book is a valuable reference to the fundamentals and a strong guide to staying current with the modern language features, benefiting developers at all stages of their careers. – Shay Brennan-Kelly Principal Software Engineer Finally, a Java book that respects my experience while challenging my complacency. The conversational flow keeps you engaged, the curveball exercises keep you honest, and the depth keeps you coming back. This is technical writing done right. – Dineshotham Kumar K Software Engineer Candescent Technologies
Page 13
(This page has no text content)
Page 14
Table of Contents 0 0 The Bridge to Volume 2: Bridging Fundamentals with Object- Oriented Programming 1 0.1 Looking Back: What You Already Know 2 0.2 A Preview of What’s Ahead 5 0.3 Why Object-Oriented Programming? 6 Chapter Summary 9 Multiple Choice Questions 11 Further Reflection 14 1 1 The Reference Data Types 15 1.1 The Reference Data Types 16 1.2 Assigning References to Variables 20 1.3 The this Reference 26 1.4 Local Variables 30 Chapter Summary 40 Multiple Choice Questions 41 Coding Task 45 2 2 An Introduction to Object-Oriented Concepts 47 2.1 Objects vs Classes 48 2.2 Object Instantiation 52 2.3 Encapsulation - AKA Data Hiding and Implementation 53 2.4 The Constructor 60 2.5 Instance Methods and Static Methods 62 2.6 The Java Source File Layout 63 2.7 Introduction of modules 69 2.8 The JAR (Java Archive) File 71 2.9 The Manifest File 73 2.10 Java API Documentation 73
Page 15
Chapter Summary 76 Multiple Choice Questions 78 Coding Task 82 3 3 Inheritance 87 3.1 Introduction to Inheritance 88 3.2 Classes, Superclasses, and Subclasses 89 3.3 The "is-a" Relationship 91 3.4 Single Inheritance 93 3.5 The Java Access Modifiers 96 3.6 Method Overriding 97 3.7 Rules for Overriding a Method 98 3.8 The super Keyword 100 3.9 Overloading Methods 102 3.10 Rules for Method Overloading 104 3.11 Inheritance and Constructors 109 3.12 Overloading Constructors 112 3.13 The Object Class 115 Chapter Summary 123 Multiple Choice Questions 125 Coding Task 130 4 4 Polymorphism 135 4.1 Introduction to the Concept of Polymorphism 136 4.2 Virtual Method Invocation: The getDetails() method 140 4.3 Heterogeneous Array 143 4.4 Methods with Polymorphic Arguments 145 4.5 The instanceof Operator 150 4.6 Casting of Objects 153 Chapter Summary 155 Multiple Choice Questions 157 Coding Task 163
Page 16
5 5 Other Class Features 169 5.1 Revisiting the static Keyword 170 5.2 How do we access/call a static variable or a static method? 172 5.3 The Math Class and the System Classes 173 5.4 The static Imports 174 5.5 The Wrapper Classes 175 5.6 The final Keyword 178 5.7 The record Keyword 180 5.8 The enum Keyword 185 5.9 The abstract Keyword 188 5.10 Java Interfaces 195 5.11 The Interface default Methods 202 5.12 The use of default methods in implementing multiple interfaces 206 5.13 The Interface static Methods 208 5.14 Private Methods in Interfaces (JDK 9) 209 5.15 Sealed Classes (JDK 17+) 211 5.16 The Functional Interface and the Lambda (->) Operator 214 Chapter Summary 217 Multiple Choice Questions 220 Coding Task 225 6 6 Exceptions and Assertions 233 6.1 The Exception Class and the Error Class 234 6.2 Java’s Approach: The Call Stack Mechanism 236 6.3 General Syntax of an Exception-Handling Block 241 6.4 The Exception Hierarchy in Java 249 6.5 Multiple Exceptions in a catch Block 251 6.6 The Parameterized try Block (Try-With-Resources) 252 6.7 The Handle or Declare Rule 255 6.8 Improved Final or Effectively Final Variable Rethrow (JDK 11+) 256 6.9 Rules on Overriding Methods and Exceptions 258
Page 17
6.10 Create Your Own Exception 260 6.11 Creating your own unchecked RuntimeException 262 6.12 Assertions 264 Chapter Summary 269 Multiple Choice Questions 271 Coding Task 275 7 7 Building Java Text-Based Applications 277 7.1 I/O Stream Fundamentals 278 7.2 Fundamental Stream Classes 279 7.3 Data Within Streams 279 7.4 I/O Stream Chaining 281 7.5 Java I/O 282 7.6 Reading Input via Keyboard 283 7.7 The File class and the File Object 289 7.8 Reading Inputs From a File 293 7.9 Writing Inputs to a File 294 Chapter Summary 297 Multiple Choice Questions 299 Coding Task 302 8 8 Introduction to Java Collection and the Generics Framework 305 8.1 The Collection Interface 306 8.2 The Set Interface 311 8.3 The List Interface 315 8.4 The Map Interface 318 8.5 The Iterator Interface 322 8.6 An Introduction to the Generics Framework 328 8.7 The Diamond (<>) Operator 331 8.8 Factory Methods for Immutable Collections (JDK 9) 333 8.9 Revisiting Local Variable Type Inference using var (JDK 10) 333 8.10 Collectors.toUnmodifiableList/Set/Map (JDK 10) 334
Page 18
8.11 Sequenced Collections (JDK 21) 336 Chapter Summary 338 Multiple Choice Questions 340 Coding Task 344 9 9 Building Graphical User Interfaces (GUI) in Java 347 9.1 Introducing the java.awt Package 348 9.2 Things to Consider While Building Your GUI Application 351 9.3 Java Layout Managers 357 9.4 Understanding Layout Managers While Creating Your SimpleCalculator App 370 Chapter Summary 379 Multiple Choice Questions 380 Coding Task 386 10 10 Event Handling Techniques 387 10.1 Fundamentals Of Event Handlers 388 10.2 Event Handling Techniques 390 10.3 Building a SimpleCalculator App with Event Handlers 404 Chapter Summary 410 Multiple Choice Questions 411 Coding Task 415 11 11 Building a Swing Desktop App 417 11.1 AWT vs. Swing 418 11.2 Converting Your AWT App to a Swing-Based App 420 11.3 Common Swing Components 431 11.4 Packaging Your Application to a Java ARchive (JAR) File 458 Chapter Summary 465 Multiple Choice Questions 466 Coding Task 470
Page 19
Preface Java Essentials Volume 2: Object Oriented Programming and Beyond is a natural continuation of the foundational topics introduced in Volume 1. While the first volume focused on building a solid grasp of Java fundamentals—covering syntax, control structures, arrays, strings, and the basic building blocks of Java programs—this second volume shifts the focus to more advanced, structured, and professional programming concepts using object-oriented programming (OOP) as the central theme. This volume is written for learners who are ready to move beyond writing simple programs and begin understanding the true power of Java—encapsulation, inheritance, polymorphism, and the wide array of tools that make Java a platform for building scalable, maintainable, and modular software applications. Starting with a bridge chapter that connects the procedural programming mindset to the object-oriented paradigm, each chapter builds on the previous one, reinforcing understanding through well-structured explanations, sample code, real-world analogies, coding tasks, and review quizzes. From mastering Java’s reference data types to understanding class design, method overloading, inheritance structures, exception handling, and the collection framework, this book is designed to equip students with both theoretical concepts and practical skills. You will also explore Graphical User Interfaces (GUI) and the foundations of event-driven programming, ultimately culminating in building full- fledged desktop applications using Java Swing. Whether you’re a computer science student, a self-taught programmer, or an instructor looking for a structured
Page 20
resource, Volume 2 serves as a guide to help you think like a Java developer and write code the way professionals do. I hope that this volume not only helps solidify your Java skills but also inspires confidence in creating applications that are elegant, reusable, and scalable. Let this be your stepping stone toward becoming a proficient Java programmer. – Dr. Lawrence Decamora Author & Instructor
The above is a preview of the first 20 pages. Register to read the complete e-book.

Recommended for You

Loading recommended books...
Failed to load, please try again later

Tip the Site

Scan the WeChat Pay or Alipay code to tip. No login required.

WeChat Pay
Alipay
Back to List