Example: air traffic controller

Think Java: How to Think Like a Computer Scientist

Think JavaHow to Think Like a Computer Scientist2nd Edition, Version JavaHow to Think Like a Computer Scientist2nd Edition, Version B. Downey and Chris MayfieldGreen Tea PressNeedham, MassachusettsCopyright 2020 Allen B. Downey and Chris Tea Press9 Washburn AveNeedham, MA 02492 Permission is granted to copy, distribute, and/or modify this work under theterms of the Creative Commons Attribution-NonCommercial-ShareAlike License, which is available original form of this book is LATEX source code. Compiling this code hasthe effect of generating a device-independent representation of the book, whichcan be converted to other formats and LATEX source for this book is available Computer Is a Computer ?

You can’t write Java programs (even Hello World) without encountering object-oriented features. In some cases we explain a feature brie y when it rst appears, and then explain it more deeply later on. If you read the entire book, you will see nearly every topic required for Java SE Programmer I certi cation.

Tags:

  Programmer, Java

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Think Java: How to Think Like a Computer Scientist

1 Think JavaHow to Think Like a Computer Scientist2nd Edition, Version JavaHow to Think Like a Computer Scientist2nd Edition, Version B. Downey and Chris MayfieldGreen Tea PressNeedham, MassachusettsCopyright 2020 Allen B. Downey and Chris Tea Press9 Washburn AveNeedham, MA 02492 Permission is granted to copy, distribute, and/or modify this work under theterms of the Creative Commons Attribution-NonCommercial-ShareAlike License, which is available original form of this book is LATEX source code. Compiling this code hasthe effect of generating a device-independent representation of the book, whichcan be converted to other formats and LATEX source for this book is available Computer Is a Computer ?

2 Is Programming? .. Hello World Program .. java Programs .. Two Messages .. Source Code .. Escape Sequences .. Is Computer Science? .. Programs ..142 Variables and Variables .. Variables .. Diagrams .. Variables .. Operators .. Numbers .. Errors .. for Strings .. Error Messages .. Types of Errors ..313 Input and System Class .. Scanner Class .. Elements .. and Constants .. Output .. Error Messages .. Cast Operators .. Operator .. It All Together .. Scanner Bug ..474 Methods and New Methods .. of Execution .. and Arguments .. Parameters .. Diagrams .. Methods .. Values .. Development ..665 Conditionals and Operators.

3 If-else Statement .. and Nesting .. switch Statement .. Operators .. Morgan s Laws .. Variables .. Methods .. Input .. Program ..856 Loops and while Statement .. and Decrement .. for Statement .. Loops .. Loop to Use .. Iteration .. indexOf Method .. Comparison .. Formatting .. 1037 Arrays and Arrays .. Elements .. Arrays .. Arrays .. Arrays .. Numbers .. a Histogram .. Enhanced for Loop .. Characters .. 1228 Recursive Void Methods .. Stack Diagrams .. Methods .. Leap of Faith .. Up Recursively .. Number System .. Binary Method .. Problems.

4 1419 Immutable vs Objects .. null Keyword .. Are Immutable .. Classes .. Arguments .. Validation .. Arithmetic .. Design .. Generalization .. 16110 Mutable Objects .. as Parameters .. as Return Values .. Are Mutable .. Revisited .. Library Source .. Diagrams .. Revisited .. Collection .. Mutable vs Immutable .. StringBuilder Objects .. Vocabulary .. Exercises .. 18011 Designing Time Class .. Constructors .. and Setters .. Objects .. toString Method .. equals Method .. Times .. Exercises .. 19712 Arrays of Objects.

5 ToString .. Variables .. compareTo Method .. Are Immutable .. of Cards .. Search .. Search .. the Code .. Vocabulary .. Exercises .. 21413 Objects of of Cards .. Decks .. Sort .. Sort .. Decks .. Recursion .. Context .. of Cards .. Playing War .. Vocabulary .. Exercises .. 23114 Extending .. Cards .. Player Class .. Eights Class .. Relationships .. 24915 Arrays of s Game of Life .. Cell Class .. Arrays .. GridCanvas Class .. Grid Methods .. the Game .. Simulation Loop .. Handling.

6 Neighbors .. Updating the Grid .. Vocabulary .. Exercises .. 26516 Reusing s Ant .. Classes .. Diagram .. 277 CONTENTS xiii17 Advanced Objects .. Color .. Polygons .. Constructors .. Initial Drawing .. Polygons .. Listeners .. Vocabulary .. Exercises .. 297A DrJava .. Interactions .. Interface .. Testing .. Checkstyle .. with a Debugger .. with JUnit .. 309B Documentation .. Documentation .. Tags .. Source File .. 320C Graphics .. Methods .. Drawing .. 326D Errors .. Errors .. Errors.

7 337 Index343 PrefaceThink Javais an introduction to Computer science and programming intendedfor readers with little or no experience. We start with the most basic conceptsand are careful to define all terms when they are first used. The book presentseach new idea in a logical progression. Larger topics, like control flow state-ments and object-oriented programming, are divided into smaller examplesand introduced over the course of several book is intentionally concise. Each chapter is 12 14 pages and covers thematerial for one week of a college course. It is not meant to be a comprehensivepresentation of java , but rather, an initial exposure to programming constructsand techniques.

8 We begin with small problems and basic algorithms and workup to object-oriented design. In the vocabulary of Computer science pedagogy,this book uses the objects late Philosophy Behind the BookHere are the guiding principles that make the book the way it is:One concept at a time:We break down topics that give beginners troubleinto a series of small steps, so that they can exercise each new conceptin isolation before of java and concepts:The book is not primarily about java ; ituses code examples to demonstrate Computer science. Most chaptersstart with language features and end with :An important goal of the book is to be small enough so thatstudents can read and understand the entire text in a one-semester col-lege or AP on vocabulary:We try to introduce the minimum number ofterms and define them carefully when they are first used.

9 We also orga-nize them in glossaries at the end of each development:There are many strategies for writing programs,including bottom-up, top-down, and others. We demonstrate multipleprogram development techniques, allowing readers to choose methodsthat work best for learning curves:To write a program, you have to understand thealgorithm, know the programming language, and be able to debug discuss these and other aspects throughout the book and summarizeour advice in Appendix ProgrammingSome java books introduce classes and objects immediately; others begin withprocedural programming and transition to object-oriented more of java s object-oriented features are motivated by problems with previ-ous languages, and their implementations are influenced by this history.

10 Someof these features are hard to explain when people aren t familiar with theproblems they get to object-oriented programming as quickly as possible (beginning withChapter 9). But we introduce concepts one at a time, as clearly as possible,in a way that allows readers to practice each idea in isolation before movingon. So it takes some time to get can t write java programs (even Hello World) without encountering object-oriented features. In some cases we explain a feature briefly when it firstappears, and then explain it more deeply later you read the entire book, you will see nearly every topic required for java SEProgrammer I certification. Supplemental lessons are available in the officialJava tutorials on Oracle s website ( ).


Related search queries