Loading...

Messages

Proposals

Stuck in your homework and missing deadline? Get urgent help in $10/Page with 24 hours deadline

Get Urgent Writing Help In Your Essays, Assignments, Homeworks, Dissertation, Thesis Or Coursework & Achieve A+ Grades.

Privacy Guaranteed - 100% Plagiarism Free Writing - Free Turnitin Report - Professional And Experienced Writers - 24/7 Online Support

Diamond hunter java source code

29/10/2021 Client: muhammad11 Deadline: 2 Day

Java Programming

This lab continues the Zuul project.Make a copy of your Lab 1 Zuul project folder (e.g., the folder named LastName-zuul1) and save it as LastName-zuul, using your last name, e.g., Smith-zuul.
Set up a Git repository for your Zuul project by following the instructions Set Up a Repository for a Project. (Start following along at 0:25 in the video since you already have an existing project.)
In Git, create a branch called 'zuul2-refactoring' and move onto the branch. You will do all your work for this lab on this branch, committing after each exercise.git branch zuul2-refactoring git checkout zuul2-refactoring
Complete Exercises 6e: 8.5, 8.6, 8.7, 8.8, 8.11 .
After each exercise:
Test your program. The changes you make in these exercises are refactorings and should not change the behavior of the game. After each step make sure everything still works as it did before.
Don't forget to document your changes.
For any changed classes, be sure your name is in the @author list and update the version.
As you add and update methods make sure each method has a comment header that correctly describes its behavior using javadoc, including @param and @return tags.
When an exercise is complete, commit your changes in Git with a commit message indicating the exercise you just completed as well as a brief description of the changes you made. For example:git add . git commit -m"Completed exercise 8.5 - extracted method printLocationInfo"
It is critical that you commit after each exercise so that all exercises can be graded. Later exercises change the code from earlier exercises, and the instructor will be able to grade the early exercises by looking back in your commit history.
When you have completed all the exercises, make sure your branch is clean. (When you do 'git status' it should say "On branch zuul2-refactoring. nothing to commit, working tree clean")
Merge your branch into the master:git checkout master git merge zuul2-refactoring
Create a zip file of your entire project folder, and name it LastName-zuul2.zip

(Objects First with Java_ A Practical Introduction Using BlueJ 6th Edition) David J. Barnes & Michael Kölling - Objects First with Java_ A Practical Introduction Using BlueJ. 6-Pearson (2016).pdf
David J. Barnes and Michael Kölling

University of Kent

Sixth Edition

Objects First with Java™

A Practical Introduction Using BlueJ

Boston Columbus Indianapolis New York San Francisco Hoboken Amsterdam Cape Town Dubai London Madrid Milan Munich Paris Montreal Toronto

Delhi Mexico City Sao Paulo Sydney Hong Kong Seoul Singapore Taipei Tokyo

A01_BARN7367_06_SE_FM.indd 1 4/15/16 6:10 PM

Byron
Vice President, Editorial Director, ECS: Marcia Horton Executive Editor: Tracy Johnson Editorial Assistant: Kristy Alaura Vice President of Marketing: Christy Lesko Director of Field Marketing: Tim Galligan Field Marketing Manager: Demetrius Hall Marketing Assistant: Jon Bryant Director of Product Management: Erin Gregg Team Lead, Program and Project Management: Scott Disanno Program Manager: Carole Snyder Project Manager: Camille Trentacoste Senior Specialist, Program Planning and Support: Maura Zaldivar-Garcia Cover Designer: Marta Samsel Cover Art: brm1949/Fotolia Inventory Manager: Ann Lam Media Project Manager: Leslie Sumrall Full-Service Project Management, Composition, and Art: Chandrasekar Subramanian, SPi Global Printer/Bindery: R.R. Donnelley/Crawfordsville Cover printer: Phoenix Color/Hagerstown

Copyright © 2017, 2012, 2009, 2006, 2005, 2003 by Pearson Education. All rights reserved. Manufactured in the United States of America. This publication is protected by Copyright, and permission should be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, record- ing, or likewise. For information regarding permissions, request forms and the appropriate contacts within the Pearson Education Global Rights & Permissions department, please visit www.pearsoned.com/permissions/.

PEARSON, and ALWAYS LEARNING are exclusive trademarks in the U.S. and/or other countries owned by Pearson Education, Inc. or its affiliates.

Unless otherwise indicated herein, any third-party trademarks that may appear in this work are the property of their respective own- ers and any references to third-party trademarks, logos or other trade dress are for demonstrative or descriptive purposes only. Such references are not intended to imply any sponsorship, endorsement, authorization, or promotion of Pearson’s products by the owners of such marks, or any relationship between the owner and Pearson Education, Inc. or its affiliates, authors, licensees or distributors.

The programs and applications presented in this book have been included for their instructional value. They have been tested with care, but are not guaranteed for any particular purpose. The publisher does not offer any warranties or representations, nor does it accept any liabilities with respect to the programs or applications.

Library of Congress Cataloging-in-Publication Data

Names: Barnes, David J. (David John), 1959 June 7- author. | Kolling, Michael, author. Title: Objects first with Java : a practical introduction using BlueJ / David J. Barnes and Michael Kolling, University of Kent. Description: Sixth edition. | Boston : Pearson Education Inc., [2017] Identifiers: LCCN 2016009911| ISBN 9780134477367 | ISBN 0134477367 Subjects: LCSH: Object-oriented programming (Computer science) | Java (Computer program language) | Computer science—Study and teaching. Classification: LCC QA76.64 .B385 2017 | DDC 005.1/17—dc23 LC record available at http://lccn.loc.gov/2016009911

10 9 8 7 6 5 4 3 2 1

ISBN-10: 0-13-447736-7 ISBN-13: 978-0-13-447736-7

A01_BARN7367_06_SE_FM.indd 2 4/15/16 6:10 PM

http://www.pearsoned.com/permissions
http://lccn.loc.gov/2016009911
To my wife Helen,

djb

To K.W.

mk

A01_BARN7367_06_SE_FM.indd 3 4/15/16 6:10 PM

This page intentionally left blank

Foreword 14 Preface 15 List of Projects Discussed in Detail in This Book 25 Acknowledgments 28

Part 1 Foundations of Object Orientation 29

Chapter 1 Objects and Classes 31

1.1 Objects and classes 31 1.2 Creating objects 32 1.3 Calling methods 33 1.4 Parameters 34 1.5 Data types 35 1.6 Multiple instances 36 1.7 State 37 1.8 What is in an object? 38 1.9 Java code 39 1.10 Object interaction 40 1.11 Source code 41 1.12 Another example 43 1.13 Return values 43 1.14 Objects as parameters 44 1.15 Summary 45

Chapter 2 Understanding Class Definitions 49

2.1 Ticket machines 49 2.2 Examining a class definition 51 2.3 The class header 53 2.4 Fields, constructors, and methods 54 2.5 Parameters: receiving data 60 2.6 Assignment 62

Contents

A01_BARN7367_06_SE_FM.indd 5 4/15/16 6:10 PM

6 | Contents

2.7 Methods 63 2.8 Accessor and mutator methods 64 2.9 Printing from methods 67 2.10 Method summary 70 2.11 Summary of the naíve ticket machine 70 2.12 Reflecting on the design of the ticket machine 71 2.13 Making choices: the conditional statement 73 2.14 A further conditional-statement example 75 2.15 Scope highlighting 76 2.16 Local variables 77 2.17 Fields, parameters, and local variables 79 2.18 Summary of the better ticket machine 81 2.19 Self-review exercises 81 2.20 Reviewing a familiar example 83 2.21 Calling methods 85 2.22 Experimenting with expressions: the Code Pad 87 2.23 Summary 89

Chapter 3 Object Interaction 95

3.1 The clock example 95 3.2 Abstraction and modularization 96 3.3 Abstraction in software 97 3.4 Modularization in the clock example 97 3.5 Implementing the clock display 98 3.6 Class diagrams versus object diagrams 99 3.7 Primitive types and object types 100 3.8 The NumberDisplay class 100 3.9 The ClockDisplay class 108 3.10 Objects creating objects 111 3.11 Multiple constructors 112 3.12 Method calls 112 3.13 Another example of object interaction 116 3.14 Using a debugger 120 3.15 Method calling revisited 124 3.16 Summary 125

Chapter 4 Grouping Objects 129

4.1 Building on themes from Chapter 3 129 4.2 The collection abstraction 130

A01_BARN7367_06_SE_FM.indd 6 4/15/16 6:10 PM

Contents | 7

4.3 An organizer for music files 131 4.4 Using a library class 132 4.5 Object structures with collections 135 4.6 Generic classes 137 4.7 Numbering within collections 138 4.8 Playing the music files 141 4.9 Processing a whole collection 143 4.10 Indefinite iteration 148 4.11 Improving structure—the Track class 156 4.12 The Iterator type 159 4.13 Summary of the music-organizer project 163 4.14 Another example: an auction system 165 4.15 Summary 175

Chapter 5 Functional Processing of Collections (Advanced) 177

5.1 An alternative look at themes from Chapter 4 177 5.2 Monitoring animal populations 178 5.3 A first look at lambdas 182 5.4 The forEach method of collections 184 5.5 Streams 186 5.6 Summary 196

Chapter 6 More-Sophisticated Behavior 199

6.1 Documentation for library classes 200 6.2 The TechSupport system 201 6.3 Reading class documentation 206 6.4 Adding random behavior 211 6.5 Packages and import 217 6.6 Using maps for associations 218 6.7 Using sets 223 6.8 Dividing strings 223 6.9 Finishing the TechSupport system 225 6.10 Autoboxing and wrapper classes 227 6.11 Writing class documentation 229 6.12 Public versus private 232 6.13 Learning about classes from their interfaces 234 6.14 Class variables and constants 239 6.15 Class methods 242 6.16 Executing without BlueJ 244

A01_BARN7367_06_SE_FM.indd 7 4/15/16 6:10 PM

8 | Contents

6.17 Further advanced material 244 6.18 Summary 248

Chapter 7 Fixed-Size Collections—Arrays 251

7.1 Fixed-size collections 251 7.2 Arrays 252 7.3 A log-file analyzer 252 7.4 The for loop 258 7.5 The automaton project 264 7.6 Arrays of more than one dimension (advanced) 272 7.7 Arrays and streams (advanced) 279 7.8 Summary 280

Chapter 8 Designing Classes 283

8.1 Introduction 284 8.2 The world-of-zuul game example 285 8.3 Introduction to coupling and cohesion 287 8.4 Code duplication 288 8.5 Making extensions 291 8.6 Coupling 294 8.7 Responsibility-driven design 298 8.8 Localizing change 301 8.9 Implicit coupling 302 8.10 Thinking ahead 305 8.11 Cohesion 306 8.12 Refactoring 310 8.13 Refactoring for language independence 314 8.14 Design guidelines 319 8.15 Summary 320

Chapter 9 Well-Behaved Objects 323

9.1 Introduction 323 9.2 Testing and debugging 324 9.3 Unit testing within BlueJ 325 9.4 Test automation 332 9.5 Refactoring to use streams (advanced) 339 9.6 Debugging 340 9.7 Commenting and style 342 9.8 Manual walkthroughs 343

A01_BARN7367_06_SE_FM.indd 8 4/15/16 6:10 PM

Contents | 9

9.9 Print statements 348 9.10 Debuggers 352 9.11 Debugging streams (advanced) 353 9.12 Choosing a debugging strategy 354 9.13 Putting the techniques into practice 355 9.14 Summary 355

Part 2 Application Structures 357

Chapter 10 Improving Structure with Inheritance 359

10.1 The network example 359 10.2 Using inheritance 371 10.3 Inheritance hierarchies 373 10.4 Inheritance in Java 374 10.5 Network: adding other post types 377 10.6 Advantages of inheritance (so far) 379 10.7 Subtyping 380 10.8 The Object class 386 10.9 The collection hierarchy 387 10.10 Summary 388

Chapter 11 More about Inheritance 391

11.1 The problem: network’s display method 391 11.2 Static type and dynamic type 393 11.3 Overriding 396 11.4 Dynamic method lookup 398 11.5 super call in methods 401 11.6 Method polymorphism 402 11.7 Object methods: toString 402 11.8 Object equality: equals and hashCode 405 11.9 Protected access 407 11.10 The instanceof operator 409 11.11 Another example of inheritance with overriding 410 11.12 Summary 413

Chapter 12 Further Abstraction Techniques 417

12.1 Simulations 417 12.2 The foxes-and-rabbits simulation 418 12.3 Abstract classes 433

A01_BARN7367_06_SE_FM.indd 9 4/15/16 6:10 PM

10 | Contents

12.4 More abstract methods 440 12.5 Multiple inheritance 442 12.6 Interfaces 445 12.7 A further example of interfaces 453 12.8 The Class class 455 12.9 Abstract class or interface? 455 12.10 Event-driven simulations 456 12.11 Summary of inheritance 457 12.12 Summary 458

Chapter 13 Building Graphical User Interfaces 461

13.1 Introduction 461 13.2 Components, layout, and event handling 462 13.3 AWT and Swing 463 13.4 The ImageViewer example 463 13.5 ImageViewer 1.0: the first complete version 475 13.6 ImageViewer 2.0: improving program structure 489 13.7 ImageViewer 3.0: more interface components 495 13.8 Inner classes 499 13.9 Further extensions 504 13.10 Another example: MusicPlayer 506 13.11 Summary 509

Chapter 14 Handling Errors 511

14.1 The address-book project 512 14.2 Defensive programming 516 14.3 Server error reporting 519 14.4 Exception-throwing principles 523 14.5 Exception handling 529 14.6 Defining new exception classes 536 14.7 Using assertions 538 14.8 Error recovery and avoidance 541 14.9 File-based input/output 544 14.10 Summary 555

Chapter 15 Designing Applications 557

15.1 Analysis and design 557 15.2 Class design 564 15.3 Documentation 566

A01_BARN7367_06_SE_FM.indd 10 4/15/16 6:10 PM

Contents | 11

15.4 Cooperation 567 15.5 Prototyping 567 15.6 Software growth 568 15.7 Using design patterns 570 15.8 Summary 576

Chapter 16 A Case Study 579

16.1 The case study 579 16.2 Analysis and design 580 16.3 Class design 584 16.4 Iterative development 589 16.5 Another example 598 16.6 Taking things further 598

Appendix A: Working with a BlueJ Project 599

A.1 Installing BlueJ 599 A.2 Opening a project 599 A.3 The BlueJ debugger 599 A.4 Configuring BlueJ 599 A.5 Changing the interface language 600 A.6 Using local API documentation 600 A.7 Changing the new class templates 600

Appendix B: Java Data Types 601

B.1 Primitive types 601 B.2 Casting of primitive types 602 B.3 Object types 602 B.4 Wrapper classes 603 B.5 Casting of object types 603

Appendix C: Operators 605

C.1 Arithmetic expressions 605 C.2 Boolean expressions 606 C.3 Short-circuit operators 607

Appendix D: Java Control Structures 609

D.1 Control structures 609 D.2 Selection statements 609

A01_BARN7367_06_SE_FM.indd 11 4/15/16 6:10 PM

12 | Contents

D.3 Loops 611 D.4 Exceptions 613 D.5 Assertions 615

Appendix E: Running Java without BlueJ 617

E.1 Executing without BlueJ 617 E.2 Creating executable .jar files 619 E.3 Developing without BlueJ 619

Appendix F: Using the Debugger 621

F.1 Breakpoints 622 F.2 The control buttons 622 F.3 The variable displays 623 F.4 The Call Sequence display 624 F.5 The Threads display 624

Appendix G: JUnit Unit-Testing Tools 625

G.1 Enabling unit-testing functionality 625 G.2 Creating a test class 625 G.3 Creating a test method 625 G.4 Test assertions 626 G.5 Running tests 626 G.6 Fixtures 626

Appendix H: Teamwork Tools 627

H.1 Server setup 627 H.2 Enabling teamwork functionality 627 H.3 Sharing a project 627 H.4 Using a shared project 627 H.5 Update and commit 628 H.6 More information 628

Appendix I: Javadoc 629

I.1 Documentation comments 629 I.2 BlueJ support for javadoc 631

Appendix J: Program Style Guide 633

J.1 Naming 633 J.2 Layout 633

A01_BARN7367_06_SE_FM.indd 12 4/15/16 6:10 PM

J.3 Documentation 634 J.4 Language-use restrictions 635 J.5 Code idioms 636

Appendix K: Important Library Classes 637

K.1 The java.lang package 637 K.2 The java.util package 638 K.3 The java.io and java.nio.file packages 639 K.4 The java.util.function package 640 K.5 The java.net package 640 K.6 Other important packages 641

Appendix L: Concept Glossary 643

Index 649

Contents | 13

A01_BARN7367_06_SE_FM.indd 13 4/15/16 6:10 PM

Foreword

by James Gosling, creator of Java

Watching my daughter Kate and her middle-school classmates struggle through a Java course using a commercial IDE was a painful experience. The sophistication of the tool added significant complexity to the task of learning. I wish that I had understood earlier what was happening. As it was, I wasn’t able to talk to the instructor about the problem until it was too late. This is exactly the sort of situation for which BlueJ is a perfect fit.

BlueJ is an interactive development environment with a mission: it is designed to be used by students who are learning how to program. It was designed by instructors who have been in the classroom facing this problem every day. It’s been refreshing to talk to the folks who developed BlueJ: they have a very clear idea of what their target is. Discussions tended to focus more on what to leave out, than what to throw in. BlueJ is very clean and very targeting.

Nonetheless, this book isn’t about BlueJ. It is about programming.

In Java.

Over the past several years Java has become widely used in the teaching of programming. This is for a number of reasons. One is that Java has many characteristics that make it easy to teach: it has a relatively clean definition; extensive static analysis by the compiler informs students of problems early on; and it has a very robust memory model that eliminates most “mysterious” errors that arise when object boundaries or the type system are compromised. Another is that Java has become commercially very important.

This book confronts head-on the hardest concept to teach: objects. It takes students from their very first steps all the way through to some very sophisticated concepts.

It manages to solve one of the stickiest questions in writing a book about programming: how to deal with the mechanics of actually typing in and running a program. Most books silently skip over the issue, or touch it lightly, leaving the instructor with the burden of figuring out how to relate the book’s material to the actual steps that students have to go through to solve the exercises. Instead, this book assumes the use of BlueJ and is able to integrate the tasks of understanding the concepts with the mechanics of how students can explore them.

I wish it had been around for my daughter last year. Maybe next year . . .

A01_BARN7367_06_SE_FM.indd 14 4/15/16 6:10 PM

Preface

New to the sixth edition This is the sixth edition of this book, and—as always with a new edition—the content has been adapted to the latest developments in object-oriented programs. Many of the changes this time can, on the surface, be attributed to a new version of Java: Java 8. This version was released in 2014 and is now very widely used in practice. In fact, it is the fastest adoption of any new Java version ever released; so it is time also to change the way we teach novice students. The changes are, however, more than merely the addition of a few new language constructs. The most significant new aspects in Java 8 center around new constructs to support a (partial) functional programming style. And it is the growing popularity of functional programming that is driving this change. The difference is much deeper, and much more fundamental, than just adding new syntax. And it is the renaissance of the functional ideas in modern programming generally—not only the existence of Java 8—that makes it timely to cover these aspects in a modern edition of a programming textbook. The ideas and techniques of functional programming, while fairly old and well known in principle, have seen a marked boost of popularity in recent years, with new languages being developed and selected functional techniques being incorporated into existing, traditionally imperative languages. One of the primary reasons for this is the change in computing hardware available, and also the changing nature of problems we wish to tackle. Almost all programming platforms now are concurrent. Even mid-range laptops and mobile phones now have processors with multiple cores, making parallel processing a real possibil- ity on everyday devices. But, in practice this is not happening on a large scale. Writing applications that make optimal use of concurrent processing and multiple proces- sors is very, very difficult. Most applications available today do not exploit current hard- ware to a degree approaching anything that is theoretically possible. This is not going to change much: the opportunity (and challenge) of parallel hardware will remain, and programming these devices with traditional imperative languages will not get any easier. This is where functional programming enters the picture.

A01_BARN7367_06_SE_FM.indd 15 4/15/16 6:10 PM

16 | Preface

With functional language constructs, it is possible to automate some concurrency very efficiently. Programs can potentially make use of multiple cores without much effort on the side of the programmer. Functional constructs have other advantages—more elegant expression for certain problems and often clearer readability—but it is the ability to deal with parallelism that will ensure that functional aspects of programming are going to stay with us for a long time to come. Every teacher who wants to prepare their students for the future should give them some understanding of functional aspects as well. Without it, one will no longer be able to become a master programmer. A novice certainly does not have to master all of functional program- ming, but a basic understanding of what it is—and what we can achieve with it—is rapidly becoming essential. Exactly when functional techniques should be introduced is an interesting question. We do not believe that there is a single right answer for this; various sequences are possible. Functional programming could be covered as an advanced topic at the end of the traditional corpus of this book, or it could be addressed when we first encounter the topics where it is applicable, as an alternative to the imperative techniques. It could even be covered first. An additional question is how to treat the traditional style of programming in those areas where functional constructs are now available: should they be replaced, or do both need to be covered? For this book, we recognize that different teachers will have different constraints and preferences. Therefore, we have designed a structure that—we hope—allows different approaches, depending on the preference of the learner or teacher.

■ We have not replaced the “old-style” techniques. We cover the new, functional approach in addition to the existing material. Functional constructs in Java are most prominent when working with collections of objects, and the mastering traditional approach—using loops and explicit iteration—is still essential for any programmer. Not only are there millions of lines of code out there that are written in this style—and will be continued to be written in this style—but there are also specific cases where it is necessary to use these techniques even if one generally favors the new functional constructs. Mastering both is the goal.

■ We present the new functional-construct-oriented material in the book where we discuss the problems that these constructs address. For example, we address functional collection processing as soon as we encounter collections.

■ Chapters and sections covering this new material are, however, clearly marked as “advanced,” and are structured in a manner that they can safely be skipped on first read- ing (or left out altogether).

■ The previous two points enable different approaches to studying this book: if time per- mits, it can be read in the sequence it is presented, covering the full scope of material— including functional approaches as alternatives to imperative ones—as the problems are encountered which they address. If time is short, these advanced sections can be skipped, and emphasis can be placed on a thorough grounding in imperative, object-oriented programming. (We should emphasize that functional is not a contradiction to object- oriented: whether the functional material is included in the study, or the course emphasis

A01_BARN7367_06_SE_FM.indd 16 4/15/16 6:10 PM

Preface | 17

is largely on imperative techniques, every reader of this book will emerge with a good understanding of object orientation!) Yet another way to approach the material is to skip the advanced sections initially, and cover them as a separate unit at a later time. They present alternative approaches to other constructs and can be covered independently.

We hope this makes clear that this book provides flexibility where readers want it, but also guidance where a reader has no clear preference: just read it in the sequence it is written. Apart from the major changes described so far, this edition also presents numerous minor improvements. The overall structure, tone, and approach of the book is unchanged; it has worked very well in the past, and there is no reason to deviate from it. However, we continuously re-evaluate and seek to improve where we see opportunities. We now have almost 15 years of continuous experience teaching with this book, and this is reflected in the many minor improvements throughout. This book is an introduction to object-oriented programming for beginners. The main focus of the book is general object-oriented and programming concepts from a software engineer- ing perspective. While the first chapters are written for students with no programming experience, later chapters are suitable for more advanced or professional programmers as well. In particular, programmers with experience in a non-object-oriented language who wish to migrate their skills into object orientation should also be able to benefit from the book. We use two tools throughout the book to enable the concepts introduced to be put into prac- tice: the Java programming language and the Java development environment BlueJ.

Java Java was chosen because of both its language design and its popularity. The Java programming language itself provides a clean implementation of most of the important object-oriented concepts, and serves well as an introductory teaching language. Its popularity ensures an immense pool of support resources. In any subject area, having a variety of sources of information available is very helpful, for teachers and students alike. For Java in particular, countless books, tutorials, exercises, compilers, environments, and quizzes already exist, in many different kinds and styles. Many of them are online and many are available free of charge. The huge amount of high quality support material makes Java an excellent choice as an introduction to object-oriented programming. With so much Java material already available, is there still room for more to be said about it? We think there is, and the second tool we use is one of the reasons . . .

BlueJ BlueJ deserves much comment. This book is unique in its completely integrated use of the BlueJ environment. BlueJ is a Java development environment that is being developed and maintained by the Computing Education Research Group at the University of Kent in Canterbury, UK,

A01_BARN7367_06_SE_FM.indd 17 4/15/16 6:10 PM

18 | Preface

explicitly as an environment for teaching introductory object-oriented programming. It is better suited to introductory teaching than other environments for a variety of reasons:

■ The user interface is much simpler. Beginning students can typically use the BlueJ environment in a competent manner after 20 minutes of introduction. From then on, instruction can concentrate on the important concepts at hand—object orientation and Java—and no time needs to be wasted talking about environments, file systems, class paths, or DLL conflicts.

■ The environment supports important teaching tools not available in other environments. One of them is visualization of class structure. BlueJ automatically displays a UML-like diagram representing the classes and relationships in a project. Visualizing these impor- tant concepts is a great help to both teachers and students. It is hard to grasp the concept of an object when all you ever see on the screen is lines of code! The diagram notation is a simple subset of UML, tailored to the needs of beginning students. This makes it easy to understand, but also allows migration to full UML in later courses.

■ One of the most important strengths of the BlueJ environment is the user’s ability to directly create objects of any class, and then to interact with their methods. This creates the opportunity for direct experimentation with objects, with little overhead in the envi- ronment. Students can almost “feel” what it means to create an object, call a method, pass a parameter, or receive a return value. They can try out a method immediately after it has been written, without the need to write test drivers. This facility is an invaluable aid in understanding the underlying concepts and language details.

■ BlueJ includes numerous other tools and characteristics that are specifically designed for students of software development. Some are aimed at helping with understanding fundamental concepts (such as the scope highlighting in the editor), some are designed to introduce additional tools and techniques, such as integrated testing using JUnit, or teamwork using a version control system, such as Subversion, once the students are ready. Several of these features are unique to the BlueJ environment.

BlueJ is a full Java environment. It is not a cut-down, simplified version of Java for teach- ing. It runs on top of Oracle’s Java Development Kit, and makes use of the standard com- piler and virtual machine. This ensures that it always conforms to the official and most up-to-date Java specification. The authors of this book have many years of teaching experience with the BlueJ environ- ment (and many more years without it before that). We both have experienced how the use of BlueJ has increased the involvement, understanding, and activity of students in our courses. One of the authors is also the development lead of the BlueJ system.

Real objects first One of the reasons for choosing BlueJ was that it allows an approach where teachers truly deal with the important concepts first. “Objects first” has been a battle cry for many text- book authors and teachers for some time. Unfortunately, the Java language does not make this noble goal very easy. Numerous hurdles of syntax and detail have to be overcome before

A01_BARN7367_06_SE_FM.indd 18 4/15/16 6:10 PM

Preface | 19

the first experience with a living object arises. The minimal Java program to create and call an object typically includes

■ writing a class;

■ writing a main method, including concepts such as static methods, parameters, and arrays in the signature;

■ a statement to create the object (“new”);

■ an assignment to a variable;

■ the variable declaration, including variable type;

■ a method call, using dot notation;

■ possibly a parameter list.

As a result, most textbooks typically either

■ have to work their way through this forbidding list, and only reach objects somewhere around the fourth chapter; or

■ use a “Hello, world”-style program with a single static main method as the first example, thus not creating any objects at all.

With BlueJ, this is not a problem. A student can create an object and call its methods as the very first activity! Because users can create and interact with objects directly, con- cepts such as classes, objects, methods, and parameters can easily be discussed in a con- crete manner before looking at the first line of Java syntax. Instead of explaining more about this here, we suggest that the curious reader dip into Chapter 1—things will quickly become clear then.

Homework is Completed By:

Writer Writer Name Amount Client Comments & Rating
Instant Homework Helper

ONLINE

Instant Homework Helper

$36

She helped me in last minute in a very reasonable price. She is a lifesaver, I got A+ grade in my homework, I will surely hire her again for my next assignments, Thumbs Up!

Order & Get This Solution Within 3 Hours in $25/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 3 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 6 Hours in $20/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 6 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 12 Hours in $15/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 12 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

6 writers have sent their proposals to do this homework:

Quality Homework Helper
Professional Accountant
Engineering Mentor
Quick Finance Master
Quality Assignments
Financial Assignments
Writer Writer Name Offer Chat
Quality Homework Helper

ONLINE

Quality Homework Helper

I can assist you in plagiarism free writing as I have already done several related projects of writing. I have a master qualification with 5 years’ experience in; Essay Writing, Case Study Writing, Report Writing.

$27 Chat With Writer
Professional Accountant

ONLINE

Professional Accountant

I have read your project details and I can provide you QUALITY WORK within your given timeline and budget.

$46 Chat With Writer
Engineering Mentor

ONLINE

Engineering Mentor

This project is my strength and I can fulfill your requirements properly within your given deadline. I always give plagiarism-free work to my clients at very competitive prices.

$21 Chat With Writer
Quick Finance Master

ONLINE

Quick Finance Master

I have written research reports, assignments, thesis, research proposals, and dissertations for different level students and on different subjects.

$41 Chat With Writer
Quality Assignments

ONLINE

Quality Assignments

I am an elite class writer with more than 6 years of experience as an academic writer. I will provide you the 100 percent original and plagiarism-free content.

$47 Chat With Writer
Financial Assignments

ONLINE

Financial Assignments

I am a professional and experienced writer and I have written research reports, proposals, essays, thesis and dissertations on a variety of topics.

$33 Chat With Writer

Let our expert academic writers to help you in achieving a+ grades in your homework, assignment, quiz or exam.

Similar Homework Questions

Read write think timeline - Elie wiesel's the perils of indifference speech commonlit answers - Santa barbara city college - Hkdse practice paper english - Ethical Decision-Making - What is single segment concentration - Commonwealth bank merchant services - Mat 240 snhu - Multilit word attack skills recording booklet - Answer Question - Artist gallery consignment agreement - Who am i speech outline - Basis point value calculation caiib - TOPIC: Atrial Fibrillation disease detection using Convolutional neural networks - In india skin whitening creams reflect old biases - Ask hr la trobe - What are assessment conditions in a unit of competency - Reading lolitha in teheran pdf - Birch and swinnerton dyer conjecture - Rita hayworth and shawshank redemption questions and answers - Outline - Homework and design inc gardena ca - Persuasive speech on mental health - Martin pullin - How to calculate capital gains yield on stock - Crime and punishment part 4 chapter 5 summary - Preschool appropriate practices participant's guide answers - Bbc bitesize the periodic table - Calculate the overapplied or underapplied overhead for the year - Harvey norman moran furniture - Week 8 part 1 plagiarism free - Public Traded Company - East end market adelaide - 12 angry men study questions - DiscussionB 8 - Immune system disorder - Writing Assignment - What is my size based on height and weight - Netherplace works newton mearns - For my father janice mirikitani - Walt disney human resources case study - Rosary primary school camden - Assignment Due Monday 09/14/2020 at 9 am - Lingual arch space maintainer indications - Amoeba sisters mitosis and meiosis - On august 31 2016 merchandise inventory was - Ati active learning template therapeutic procedure - Robert b marks origins of the modern world - Discussion, Assignments - Paper pcr worksheet answers - 30000 milliliters to liters - Glyby intelligent 3d printing pen - How do elizabeth and darcy change throughout the novel - Should cellphones be banned in educational institutions - Effect of light on plants - Would each of the following transactions be included - Etl service manager port 9001 - Phet ph scale answer key - 3 pages and 2 pages #30 - Charpy impact test 1018 steel - The case of the pricing predicament - Latex caption package download - Assume that in a particular audit the cpas were negligent - Discussion : Global Wireless - 3 parts of hamilton's financial plan - Develop a hypothesis relating to the amount of dissolved oxygen - Rhizobium inoculant suppliers australia - Landgate current turnaround times - Elie tahari janine driver flats - Vicente y francisco jugar al vóleibol los domingos - Gcse french writing holidays example - Slope intercept form - Signature Assignment: Recruitment - Managerial Economics: Professional Assignment - List all essential equipment and utensils - Juice bar business plan - Biological species concept advantages and disadvantages - The real cost of cheap fashion worksheet answers - Aldi distribution centre minchinbury - On january boston enterprises issues bonds - Pepsico foundation excel awards program - The price of pens and pencils falls dramatically - The rainbow chapter summary - Nurse drug diversion and nursing leader's responsibilities - Assignment - Read and Finish! Simple, easy, need finish in 18 hrs - Sbi net banking saral - 1. did this series of questions correctly organize each organism? why or why not? - Arranged marriage definition sociology - Activity based costing and Master budgeting - Castle of Otranto - Principles of information security chapter 9 review questions - In interactive leadership, the leader favors a consensual and collaborative process. - Aunt jemima ain t yo mama vine - Anz branches brisbane northside - Price and Channel Strategy - Combining form for gland - How do all members of the phylum ciliophora move - The stock brokerage firm of blank leibowitz - U.S History