[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-670910-105":59,"doc-detail-670910-en":130},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","fourth-ap-edition-object-oriented-programming-and-data-structures-preface-xiii","Fourth AP Edition - Object-Oriented Programming and Data Structures - Preface xiii","","Fourth AP Edition focuses on object-oriented programming and data structures for Java. It guides learners through core software engineering ideas, Java syntax and style, classes and inheritance, primitive and reference data types, control flow with boolean logic, and iterative algorithm design. The book progresses from strings and arrays to defining and using classes, collections such as ArrayList, class hierarchies, searching and sorting, streams and files, and graphical user interfaces.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":30,"@type":76,"position":81},"https://docshare.wps.com/document/technology/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/fourth-ap-edition-object-oriented-programming-and-data-structures-preface-xiii/670910/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/fourth-ap-edition-object-oriented-programming-and-data-structures-preface-xiii/670910.png","ImageObject",300,407,{"name":92,"@type":93},"Rizky","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-03","2026-11-01",true,{"@type":102,"interactionType":103,"userInteractionCount":14},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What programming topics are covered in the book’s early chapters?","Question",{"text":112,"@type":113},"The early chapters introduce software engineering basics, Java syntax and style, and the foundations of objects and classes. They also cover data types, variables, arithmetic, and control flow using boolean expressions and if-else statements.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"How does the book build from algorithms to iteration and recursion?",{"text":117,"@type":113},"It develops algorithm properties and loop constructs in the algorithms and iterations chapter, then later includes topics like searching and sorting and recursion (including a recursion revisited chapter).",{"name":119,"@type":110,"acceptedAnswer":120},"Which chapters focus on strings and working with collections or files?",{"text":121,"@type":113},"Strings are covered in the dedicated strings chapter. Collections and other related tools appear in later chapters such as java.util.ArrayList, and files and streams are addressed in the streams and files chapter.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},670910,1793572671,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":14,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":139,"language":140,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":67,"update_tm":129,"read_time":144},962085564807,"https://ap-avatar.wpscdn.com/davatar_6f874abed73319feea01a86fa6f0fab8","Fourth AP Edition  \nObject-Oriented Programming  \nand  \nData Structures  \nMaria Litvin  \nPhillips Academy, Andover, Massachusetts  \nGary Litvin Skylight Software, Inc.  \nSkylight Publishing  \nAndover, Massachusetts  \nSkylight Publishing  \n14 Lincoln Street Andover, MA 01810  \nweb: [http://www.skylit.com](http://www.skylit.com)  \ne-mail: [sales@skylit.com](sales@skylit.com)  \n[support@skylit.com](support@skylit.com)  \nLibrary of Congress Control Number: 2021944689 ISBN 978-0-9972528-2-8  \nCopyright © 2022 by Maria Litvin, Gary Litvin, and Skylight Publishing  \nThis book is licensed under the Creative Commons  \nAttribution-NonCommercial-ShareAlike 4.0 International License  \nYou are free to:  \nShare—copy and redistribute the material in any medium or format Adapt—remix, transform, and build upon the material  \nThe licensor cannot revoke these freedoms as long as you follow the license terms.  \nUnder the following terms:  \nAttribution—You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.  \nNonCommercial—You may not use the material for commercial purposes.  \nShareAlike—If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.  \nNo additional restrictions—You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.  \n*  \nAP and Advanced Placement are registered trademarks of The College Board, which was not involved in the production of and does not endorse this book.  \nPreface xiii  \nHow to Use This Book xvii Chapter 1 Hardware, Software, and the Internet 1  \nChapter 2 An Introduction to Software Engineering 11  \nChapter 3 Java Syntax and Style 43  \nChapter 4 Objects and Classes 65  \nChapter 5 Data Types, Variables, and Arithmetic 95  \nChapter 6 Boolean Expressions and if-else Statements 133 Chapter 7 Algorithms and Iterations 177  \nChapter 8 Strings 207  \nChapter 9 Arrays 235  \nChapter 10 Implementing and Using Classes 271  \nChapter 11 java .util .ArrayList 319  \nChapter 12 Class Hierarchies 341  \nChapter 13 Algorithms and Recursion 365  \nChapter 14 Searching and Sorting 383  \nChapter 15 Streams and Files 413  \nChapter 16 Graphics 429  \nChapter 17 GUI Components and Events 435  \nChapter 18 Mouse, Keyboard, Sounds, and Images 443  \nChapter 19 Recursion Revisited 447  \nChapter 20 Sets and Maps 475  \nChapter 21 Computing in Context 495  \nAppendices 􀀅  \nSolutions to Selected Exercises 􀀅 Index 499  \n12. Class Hierarchies  \n16. Graphics 􀀅  \n17. GUI / Events 􀀅  \n19. Recursion Revisited  \n20. Sets and Maps  \n21. In Context / Ethics 􀀅  \n18. Mouse/Sounds/Images 􀀅  \nOOP Graphics GUI  \nStart  \nContents  \n\n| Preface xiii\u003Cbr>How to Use This Book xvii\u003Cbr>Chapter 1. Hardware, Software, and the Internet 1 |  |  |\n| --- | --- | --- |\n| 1.1 Prologue 2\u003Cbr>1.2 Hardware Overview\u003Cbr>1.2.1 The CPU\u003Cbr>1.2.2 Memory | 􀀅 [www.skylit.com/javamethods4/](www.skylit.com/javamethods4/)[ ](www.skylit.com/javamethods4/)[JM-Chapter01-www.pdf](JM-Chapter01-www.pdf) |  |\n| 1.2.3 Secondary Storage Devices |  |  |\n| 1.2.4 Input and Output Devices |  |  |\n| 1.3 Software Overview |  |  |\n| 1.4 What Do Software Engineers Do? |  |  |\n| 1.5 Representation of Information in Computer Memory |  |  |\n| 1.5.1 Numbers |  |  |\n| 1.5.2 Characters |  |  |\n| 1.6 The Internet |  |  |\n| 1.7 Summary   Exercises 5 |  |  |\n| Chapter 2. An Introduction to Software Engineering 11 |  |  |\n\n2.1 Prologue 12  \n2.2 Compilers and Interpreters 14  \n2.3 Software Components and Packages 21  \n2.4 Lab: Three Ways to Say Hello 22  \n2.5 Object-Oriented Programming 29  \n2.6 Lab: More Ways to Say Hello 32  \n2.7 Summary 37  \nExercises 38  \nChapter 3. Java Syntax and Style 43  \n3.1 Prologue 44  \n3.2 An Example of a Class 45  \n3.3 Using Comments 48  \n3.4 Reserved Words and Programmer-Defined Names 50  \n3.5 Syntax vs","cbCaicP9YhM5WOwd","https://ap.wps.com/l/cbCaicP9YhM5WOwd","pdf",2796133,528,"English","# Preface\n# How to Use This Book\n# Chapter 1. Hardware, Software, and the Internet\n## 1.1 Prologue\n## 1.2 Hardware Overview\n## 1.3 Software Overview\n## 1.4 What Do Software Engineers Do?\n## 1.5 Representation of Information in Computer Memory\n## 1.6 The Internet\n## 1.7 Summary and Exercises\n# Chapter 2. An Introduction to Software Engineering\n## 2.1 Prologue\n## 2.2 Compilers and Interpreters\n## 2.3 Software Components and Packages\n## 2.4 Lab: Three Ways to Say Hello\n## 2.5 Object-Oriented Programming\n## 2.6 Lab: More Ways to Say Hello\n## 2.7 Summary and Exercises\n# Chapter 3. Java Syntax and Style\n## 3.1 Prologue\n## 3.2 An Example of a Class\n## 3.3 Using Comments\n## 3.4 Reserved Words and Programmer-Defined Names\n## 3.5 Syntax vs. Style\n## 3.6 Statements, Blocks, Indentation\n## 3.7 Lab: Correcting Syntax Errors\n## 3.8 Summary and Exercises\n# Chapter 4. Objects and Classes\n## 4.1 Prologue\n## 4.2 Case Study: A Drawing Program\n## 4.3 Classes\n## 4.4 Fields, Constructors, and Methods\n## 4.5 Inheritance\n## 4.6 Case Study and Lab: Balloons of All Kinds\n## 4.7 Summary and Exercises\n# Chapter 5. Data Types, Variables, and Arithmetic\n## 5.1 Prologue\n## 5.2 Declaring Fields and Local Variables\n## 5.3 Primitive Data Types\n## 5.4 Strings\n## 5.5 Constants\n## 5.6 Scope of Variables\n## 5.7 Arithmetic Expressions\n## 5.8 Compound Assignment and Increment Operators\n## 5.9 Avoiding Division by Zero Errors\n## 5.10 Converting Numbers and Objects into Strings\n## 5.11 Lab: Pie Chart\n## 5.12 The Math Class\n## 5.13 Calling a Method from main\n## 5.14 Summary and Exercises\n# Chapter 6. Boolean Expressions and if-else Statements\n## 6.1 Prologue\n## 6.2 if-else Statements\n## 6.3 boolean Data Type\n## 6.4 Relational Operators\n## 6.5 Logical Operators\n## 6.6 Order of Operators\n## 6.7 Short-Circuit Evaluation\n## 6.8 if-else-if and Nested if-else\n## 6.9 Case Study and Lab: Rolling Dice\n## 6.10 The switch Statement\n## 6.11 Enumerated Data Types\n## 6.12 Case Study and Lab: Rolling Dice Concluded\n## 6.13 Summary and Exercises\n# Chapter 7. Algorithms and Iterations\n## 7.1 Prologue\n## 7.2 Properties of Algorithms\n## 7.3 The while and for Loops\n## 7.4 The do-while Loop\n## 7.5 return and break in Loops\n## 7.6 Nested Loops\n## 7.7 Case Study: Euclid’s GCF Algorithm\n## 7.8 Lab: Perfect Numbers\n## 7.9 Summary and Exercises\n# Chapter 8. Strings\n## 8.1 Prologue\n## 8.2 Literal Strings\n## 8.3 String Constructors and Immutability\n## 8.4 String Methods\n## 8.5 Formatting Numbers into Strings\n## 8.6 Extracting Numbers from Strings\n## 8.7 Character Methods\n## 8.8 Lab: Lipograms","[{\"question\":\"What programming topics are covered in the book’s early chapters?\",\"answer\":\"The early chapters introduce software engineering basics, Java syntax and style, and the foundations of objects and classes. They also cover data types, variables, arithmetic, and control flow using boolean expressions and if-else statements.\"},{\"question\":\"How does the book build from algorithms to iteration and recursion?\",\"answer\":\"It develops algorithm properties and loop constructs in the algorithms and iterations chapter, then later includes topics like searching and sorting and recursion (including a recursion revisited chapter).\"},{\"question\":\"Which chapters focus on strings and working with collections or files?\",\"answer\":\"Strings are covered in the dedicated strings chapter. Collections and other related tools appear in later chapters such as java.util.ArrayList, and files and streams are addressed in the streams and files chapter.\"}]","Fourth AP Edition - Object-Oriented Programming and Data Structures - Preface xiii | PDF",1331]