Library Home

Java, Java, Java: Object-Oriented Problem Solving

(4 reviews)

java java java object oriented problem solving

Ralph Morelli, Trinity College

Ralph Walde, Trinity College

Copyright Year: 2016

Publisher: Ralph Morelli, Ralph Walde

Language: English

Formats Available

Conditions of use.

Attribution

Learn more about reviews.

java java java object oriented problem solving

Reviewed by Onyeka Emebo, Assistant Professor, Virginia Tech on 12/28/21

The text adequately addresses areas under Object Oriented Programming using Java as a Programming Language for Introduction to Computer Science courses. It gently introduces basic concepts in computer, objects and java using problem solving... read more

Comprehensiveness rating: 5 see less

The text adequately addresses areas under Object Oriented Programming using Java as a Programming Language for Introduction to Computer Science courses. It gently introduces basic concepts in computer, objects and java using problem solving approaches and gradually builds up to more advanced Java technologies in such a simplified manner that can be easily understood. The text also provides a table of content at the beginning and a summary of points for each chapter with exercises.

Content Accuracy rating: 4

The text content is accurate, without errors and unbiased. There is however some links that needs to be updated.

Relevance/Longevity rating: 4

While the field of computer science with particular emphasis to programming as it relates to this text is constantly evolving, the approach taken by this text to teach the essentials is likely to persist. The code, tested in Java 8, should continue to work with new Java releases. Updates to the text can be done easily by the way it has been written.

Clarity rating: 5

The text is written in a clear and easy to understand manner. The objectives, explanations, examples and exercises are clear and easy to follow. The codes are well commented to aid readability.

Consistency rating: 4

The text is highly consistent in both structure and terminology. It starts each chapter with objectives and outline and concludes with summary, exercises and solutions. However, some codes within the chapters are put in figures while others are not, this could be confusing.

Modularity rating: 5

The text is divided in 17 chapters (0 - 16) and 8 appendices (A – H). Each chapter is further divided into sections and subsections. This breakdown makes it easier for instructors to apportion sections to students at different times within the course.

Organization/Structure/Flow rating: 5

The text is organized in a manner that is logical and it flows well from section to section. The structure makes navigation from chapter to chapter easier.

Interface rating: 3

I reviewed the PDF version and it looks good to a large extent. The links in the table of contents are working properly. There are clickable links within the text to different figures, sections, such as appendices, and external websites. However, there are some issues with some figure titles, e.g., figure 12, 1.10, 2.7, 2.10, 2.14, etc. are cut off. Some hyperlinks for some figures missing e.g., figure 2.8 and some figures don’t have titles.

Grammatical Errors rating: 5

The text contains no grammatical errors.

Cultural Relevance rating: 5

The text is culturally neutral. The examples are unbiased in the way it has been presented.

Reviewed by Ghaith Husari, Assistant Professor, East Tennessee State University on 4/17/20

This book covers Object-Oriented Programming under JAVA. It introduces the concepts of object-oriented programming and they are used for problem-solving. This book covers all the relevant areas of Object-Oriented Programming under Java. Also, it... read more

This book covers Object-Oriented Programming under JAVA. It introduces the concepts of object-oriented programming and they are used for problem-solving. This book covers all the relevant areas of Object-Oriented Programming under Java. Also, it covers more advanced topics such as socket programming and algorithms.

Content Accuracy rating: 5

The Object-Oriented concepts and implementation example shown in code samples are accurate and easy to learn as the code samples are aligned with the concept being discussed. Some links and URLs are out-dated but they have little to no impact on student learning. However, I would add a note that says "some of the links and URLs might not up-to-date. However, they can be found using search engines if necessary"

Programming languages get updated regularly to include new and easier functions to use. While it is impossible for a textbook to include every function, this textbook provides a great learning opportunity that allows students to build the muscle to be able to learn more about Java online. When it comes to Object-Oriented concepts, the book is extremely relevant and up-to-date

The textbook is very easy to understand and the code sample is both clear (code readability) and relevant.

Consistency rating: 5

The text and the terms it contains are consistent. Also, the textbook follows a consistent theme.

The textbook chapters are divided into sections and subsections that are shown also in the table of contents which can be used to visit each section.

The textbook consists of seventeen chapters that are organized in a logical manner. The more general concepts such as problem-solving and programing are placed at the beginning, then the chapters introduce the discuss Object-Oriented Programming come after the general chapters. The more advanced topics such as socket programming and data structures and algorithms come towards the end. This made a lot of sense to me.

Interface rating: 5

The textbook is easily accessible online and it can be downloaded to open with Edge or Adobe Reader without any problems.

No grammar issues have been noticed.

This textbook is neutral and unbiased.

Reviewed by Guanyu Tian, Assistant Professor, Fontbonne University on 6/19/18

This textbook covers Object-Oriented Programming with Java programming language pretty well. It starts with the concept of Objects and problem solving skills and then dive into Java programming language syntax. Overall, it appropriately covers all... read more

Comprehensiveness rating: 4 see less

This textbook covers Object-Oriented Programming with Java programming language pretty well. It starts with the concept of Objects and problem solving skills and then dive into Java programming language syntax. Overall, it appropriately covers all areas of the subject including the main principles of Object-Oriented Programming and Java programming language. In the later chapters, this textbook also introduces advanced topics such as concurrent programming, network/socket programming and data structures. The textbook provides table of contents at the beginning and index of terms at the end. Each chapter also provides a list of key words and a list of important concepts and technique terms.

Content Accuracy rating: 3

The content of the textbook is mostly accurate. Many URLs linked to Java documentations and APIs are not up-to-date.

Many URLs to Java references are not up-to-date and many online samples are not accessible. Nonetheless, the concepts of Object-Oriented Programming and Java programming language syntax are mostly current. Any updates to the contents of the textbook can be implemented with minimal effort.

The text is easy to understand. However, some of the texts are not displayed on adobe reader.

Consistency rating: 3

The text is consistent in terms of framework. Each chapter starts with introduction to a problem, and then discussion and design of the solution with UML diagrams; then Java is used to implement the solution(s). However, there is some level of inconsistency in terms of Java code samples. For example, some Java code examples use appropriate indentations and new lines, but some examples do not. This may confuse students.

Each chapter is divided into different sections and subsections. A student can go to each section of a chapter by clicking it in the Table of Contents.

Organization/Structure/Flow rating: 3

The topics in this text book are organized in a reasonable order. It starts with general concepts of computer and program design, then Objects and Java Programming Language, and then advanced topics in computer programming. It would be better if the textbook starts with Java programming language and then principles of Object Oriented programming.

Some of the texts are not displayed in the reviewer's adobe reader. Many diagrams and figures are poorly drawn. Overall, the interface of the book is one area that needs improvement.

No major grammar issues has been noticed.

The text of this textbook is a neutral and unbiased.

Overall, this textbook covers materials of Object-Oriented Programming with Java taught in first or second-year computer science course. However, the contents of Java programming language has not been up-to-date and the interface of the book is very poor compare to similar books the reviewer has used for learning and teaching the same materials. Some sample codes are not well written or inconsistent in terms of the use of indentation and new lines. Many URLs are obsolete and the web pages are not accessible.

Reviewed by Homer Sharafi, Adjunct Faculty Member, Northern Virginia Community College on 6/20/17

The textbook includes the material that is typically covered in a college-level CS1 course. Using an “early objects” approach and Java as the programming language, the authors go over problem-solving techniques based on object-oriented... read more

The textbook includes the material that is typically covered in a college-level CS1 course. Using an “early objects” approach and Java as the programming language, the authors go over problem-solving techniques based on object-oriented programming principles. In addition to an Index of terms towards the end of the text, each chapter summary includes the technical terms used, along with a bulleted-list of important points discussed in that chapter.

The computer science concepts and the accompanying sample code are accurate and error-free; however, the only issue is the fact that the URLs that make references to various aspects of Java, such as API documentation, JDK, and the Java Language Specification, have not been updated to reflect the fact that Sun Microsystems was acquired by Oracle back in 2010.

Like other software systems, Java is updated on a regular basis; nonetheless, the computer science concepts discussed in the textbook are based on standard undergraduate curriculum taught in a CS1 course. Therefore, any updates to the textbook would need to be with regard to the version of Java with minimal effort.

Clarity rating: 4

The authors deliver clear explanations of the computer science concepts and the accompanying Java language features.

There is a consistent theme throughout much of the text: A topic is introduced and discussed within the context of a problem. Its solution is then designed and explained using UML diagrams; finally, Java is used to illustrate how the solution is implemented on the computer.

Each chapter is divided into sections that can easily be identified within the table of contents. Therefore, it’s fairly easy for a student to pick and choose a section in a chapter and work on the other sections later. Throughout each chapter, there are self-study exercises to incrementally test understanding of the covered material. Solutions to those self-study exercises are then provided towards the end of the chapter. In addition, each chapter includes end-of-chapter exercises that can be used to assess one’s understanding of the computer science concepts as well as the various features of Java.

The book consists of seventeen chapters; however, a typical CS1 course would need the material in the first ten chapters only, and those chapters are set up in a logical manner, allowing one to go through the material sequentially. Depending on how fast he first ten chapters are covered during the course of a semester, an instructor may choose from the last seven chapters in the text to introduce more advanced topics in computer science and/or Java.

Interface rating: 1

The textbook can be accessed online or opened using Acrobat Reader with no problem. There are no issues, as long as navigation is done one page after another manually. However, when browsing through the table of contents (TOC) or the Index, the entries are not set up using any live links. That is, you cannot click on a page number associated with an item within the TOC or the Index to go directly to that page.

Grammatical Errors rating: 3

This reviewer did not come across any such issues, while going through the text.

This is a computing textbook, where the contents are presented using technical terms. Culturally, the textbook is completely neutral and unbiased in terms of how the material is presented.

Table of Contents

  • 0 Computers, Objects, and Java
  • 1 Java Program Design and Development
  • 2 Objects: Defining, Creating, and Using
  • 3 Methods: Communicating with Objects
  • 4 Input/Output: Designing the User Interface
  • 5 Java Data and Operators
  • 6 Control Structures
  • 7 Strings and String Processing
  • 8 Inheritance and Polymorphism
  • 9 Arrays and Array Processing
  • 10 Exceptions: When Things Go Wrong
  • 11 Files and Streams
  • 12 Recursive Problem Solving
  • 13 Graphical User Interfaces
  • 14 Threads and Concurrent Programming
  • 15 Sockets and Networking
  • 16 Data Structures: Lists, Stacks, and Queues

Ancillary Material

  • Ralph Morelli, Ralph Walde

About the Book

We have designed this third edition of Java, Java, Java to be suitable for a typical Introduction to Computer Science (CS1) course or for a slightly more advanced Java as a Second Language course. This edition retains the “objects first” approach to programming and problem solving that was characteristic of the first two editions. Throughout the text we emphasize careful coverage of Java language features, introductory programming concepts, and object-oriented design principles.

The third edition retains many of the features of the first two editions, including:

  • Early Introduction of Objects
  • Emphasis on Object Oriented Design (OOD)
  • Unified Modeling Language (UML) Diagrams
  • Self-study Exercises with Answers
  • Programming, Debugging, and Design Tips.
  • From the Java Library Sections
  • Object-Oriented Design Sections
  • End-of-Chapter Exercises
  • Companion Web Site, with Power Points and other Resources

The In the Laboratory sections from the first two editions have been moved onto the book's Companion Web Site. Table 1 shows the Table of Contents for the third edition.

About the Contributors

Ralph Morelli, Professor of Computer Science Emeritus. Morelli has been teaching at Trinity College since 1985, the same year the computer science major was first offered. More recently, he was one of the Principal Investigators (PIs) for the Humanitarian Free and Open Source Software (HFOSS) project, an NSF-funded effort to get undergraduates engaged in building free and open source software that benefits the public.  In summer 2011 a team of Trinity HFOSS students and faculty traveled to Haiti to build an open source mobile application that helps manage beneficiaries for a humanitarian aid organization. Currently Morelli is the PI of the Mobile CSP project, an NSF-funded effort to train high school teachers in CT and elsewhere to teach the emerging Advanced Placement CS Principles course that is being created by the College Board. The main goal of this NSF initiative is to increase access to computer science among underrepresented groups, including girls, African Americans, and Hispanic Americans.  The Mobile CSP course teaches students to create mobile apps to serve their community.  In summer 2014, a group of 20 Mobile CSP students spent their summer building mobile apps for the city of Hartford. 

Ralph Walde.  Dr. Walde has given Trinity 28 years of distinguished service, first as a Professor of Mathematics and now as a Professor of Computer Science. He was instrumental in helping to establish and nourish computing at Trinity and was one of the founding members of the Computer Science Department.

Contribute to this Page

java java java object oriented problem solving

  • Computers & Technology

Amazon prime logo

Enjoy fast, free delivery, exclusive deals, and award-winning movies & TV shows with Prime Try Prime and start saving today with fast, free delivery

Amazon Prime includes:

Fast, FREE Delivery is available to Prime members. To join, select "Try Amazon Prime and start saving today with Fast, FREE Delivery" below the Add to Cart button.

  • Cardmembers earn 5% Back at Amazon.com with a Prime Credit Card.
  • Unlimited Free Two-Day Delivery
  • Streaming of thousands of movies and TV shows with limited ads on Prime Video.
  • A Kindle book to borrow for free each month - with no due dates
  • Listen to over 2 million songs and hundreds of playlists
  • Unlimited photo storage with anywhere access

Important:  Your credit card will NOT be charged when you start your free trial or if you cancel during the trial period. If you're happy with Amazon Prime, do nothing. At the end of the free trial, your membership will automatically upgrade to a monthly membership.

Buy new: .savingPriceOverride { color:#CC0C39!important; font-weight: 300!important; } .reinventMobileHeaderPrice { font-weight: 400; } #apex_offerDisplay_mobile_feature_div .reinventPriceSavingsPercentageMargin, #apex_offerDisplay_mobile_feature_div .reinventPricePriceToPayMargin { margin-right: 4px; } -83% $34.95 $ 34 . 95 FREE delivery Monday, May 13 on orders shipped by Amazon over $35 Ships from: Amazon Sold by: summerbreezebooks

Return this item for free.

Free returns are available for the shipping address you chose. You can return the item for any reason in new and unused condition: no shipping charges

  • Go to your orders and start the return
  • Select the return method

Save with Used - Good .savingPriceOverride { color:#CC0C39!important; font-weight: 300!important; } .reinventMobileHeaderPrice { font-weight: 400; } #apex_offerDisplay_mobile_feature_div .reinventPriceSavingsPercentageMargin, #apex_offerDisplay_mobile_feature_div .reinventPricePriceToPayMargin { margin-right: 4px; } $8.38 $ 8 . 38 FREE delivery May 13 - 14 Ships from: ThriftBooks-Atlanta Sold by: ThriftBooks-Atlanta

Kindle app logo image

Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required .

Read instantly on your browser with Kindle for Web.

Using your mobile phone camera - scan the code below and download the Kindle app.

QR code to download the Kindle App

Image Unavailable

Java, Java, Java: Object-Oriented Problem Solving

  • To view this video download Flash Player

Follow the author

R. Morelli

Java, Java, Java: Object-Oriented Problem Solving Bk&CD Rom Edition

There is a newer edition of this item:.

Java, Java, Java: Object-Oriented Problem Solving

Purchase options and add-ons

  • ISBN-10 0130113328
  • ISBN-13 978-0130113320
  • Edition Bk&CD Rom
  • Publisher Prentice Hall
  • Publication date January 1, 1999
  • Language English
  • Dimensions 7.95 x 1.42 x 10 inches
  • Print length 976 pages
  • See all details

Amazon First Reads | Editors' picks at exclusive prices

Editorial Reviews

From the inside flap.

In Chapters 1 to 3 students are given the basic building blocks for constructing a Java program from scratch. Although the programs at this stage have limited functionality in terms of control structures and data types, the priority is placed on how objects are constructed and how they interact with each other through method calls and parameter passing.

From the Back Cover

Offers an emphasis on design and problem solving through instruction and examples Emphasizes OO design concepts such as inheritance and information hiding early on and presents them as an essential component of using an OO language Features GUI elements and applets to captivate and maintain the reader's interest while introducing them to real-world examples Incorporates action learning tools such as "In the Laboratory" sections, "CyberPet" examples, and drop-in boxes on effective design, programming and debugging tips, and Java language rules Covers advanced features of the Java: GUIs, graphics and drawing; exceptions; recursive problem solving; threads and concurrent programming; files, streams, and input/output techniques; sockets and networking; and data structures Includes a Companion Website-with extensive supplementary resources such as a Study Guide, Power Point slides, Java code-and a CD-ROM that includes the Java code for all the examples in the text, and Java® 2 SDK, Standard Edition, Borland JBuilder 3, University Edition, and NetBeans

About the Author

Product details.

  • Publisher ‏ : ‎ Prentice Hall; Bk&CD Rom edition (January 1, 1999)
  • Language ‏ : ‎ English
  • Paperback ‏ : ‎ 976 pages
  • ISBN-10 ‏ : ‎ 0130113328
  • ISBN-13 ‏ : ‎ 978-0130113320
  • Item Weight ‏ : ‎ 3.81 pounds
  • Dimensions ‏ : ‎ 7.95 x 1.42 x 10 inches

About the author

Discover more of the author’s books, see similar authors, read author blogs and more

Customer reviews

Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.

To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.

  • Sort reviews by Top reviews Most recent Top reviews

Top reviews from the United States

There was a problem filtering reviews right now. please try again later..

java java java object oriented problem solving

Top reviews from other countries

java java java object oriented problem solving

  • Amazon Newsletter
  • About Amazon
  • Accessibility
  • Sustainability
  • Press Center
  • Investor Relations
  • Amazon Devices
  • Amazon Science
  • Sell on Amazon
  • Sell apps on Amazon
  • Supply to Amazon
  • Protect & Build Your Brand
  • Become an Affiliate
  • Become a Delivery Driver
  • Start a Package Delivery Business
  • Advertise Your Products
  • Self-Publish with Us
  • Become an Amazon Hub Partner
  • › See More Ways to Make Money
  • Amazon Visa
  • Amazon Store Card
  • Amazon Secured Card
  • Amazon Business Card
  • Shop with Points
  • Credit Card Marketplace
  • Reload Your Balance
  • Amazon Currency Converter
  • Your Account
  • Your Orders
  • Shipping Rates & Policies
  • Amazon Prime
  • Returns & Replacements
  • Manage Your Content and Devices
  • Recalls and Product Safety Alerts
  • Conditions of Use
  • Privacy Notice
  • Consumer Health Data Privacy Disclosure
  • Your Ads Privacy Choices

java java java object oriented problem solving

  • Computing & Internet
  • Programming
  • Introduction to Programming

Buy new: .savingPriceOverride { color:#CC0C39!important; font-weight: 300!important; } .reinventMobileHeaderPrice { font-weight: 400; } #apex_offerDisplay_mobile_feature_div .reinventPriceSavingsPercentageMargin, #apex_offerDisplay_mobile_feature_div .reinventPricePriceToPayMargin { margin-right: 4px; } £41.01 £ 41 . 01 Dispatches from: Amazon US Sold by: Amazon US

Amazon global store.

  • International products have separate terms, are sold from abroad and may differ from local products, including fit, age ratings, and language of product, labeling or instructions.
  • Manufacturer warranty will not apply. Please review Amazon’s return policy, which usually offers free returns within 30 days of receipt.
  • Learn more about Amazon Global Store.

Save with Used - Good .savingPriceOverride { color:#CC0C39!important; font-weight: 300!important; } .reinventMobileHeaderPrice { font-weight: 400; } #apex_offerDisplay_mobile_feature_div .reinventPriceSavingsPercentageMargin, #apex_offerDisplay_mobile_feature_div .reinventPricePriceToPayMargin { margin-right: 4px; } £6.00 £ 6 . 00 £2.80 delivery 9 - 10 May Dispatches from: Phatpocket Book Shoppe Sold by: Phatpocket Book Shoppe

Kindle app logo image

Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet or computer – no Kindle device required .

Read instantly on your browser with Kindle for Web.

Using your mobile phone camera - scan the code below and download the Kindle app.

QR code to download the Kindle App

Image Unavailable

Java, Java, Java: Object-oriented Problem Solving

  • To view this video download Flash Player

Follow the author

R. Morelli

Java, Java, Java: Object-oriented Problem Solving Paperback – 1 Dec. 1999

There is a newer edition of this item:.

Java, Java, Java, Object-Oriented Problem Solving

Purchase options and add-ons

  • ISBN-10 0130113328
  • ISBN-13 978-0130113320
  • Publisher Pearson Education (US)
  • Publication date 1 Dec. 1999
  • Language English
  • Dimensions 20.2 x 3.6 x 25.4 cm
  • Print length 973 pages
  • See all details

Product description

From the back cover, about the author, product details.

  • Publisher ‏ : ‎ Pearson Education (US) (1 Dec. 1999)
  • Language ‏ : ‎ English
  • Paperback ‏ : ‎ 973 pages
  • ISBN-10 ‏ : ‎ 0130113328
  • ISBN-13 ‏ : ‎ 978-0130113320
  • Dimensions ‏ : ‎ 20.2 x 3.6 x 25.4 cm

About the author

Discover more of the author’s books, see similar authors, read author blogs and more

Customer reviews

Customer Reviews, including Product Star Ratings, help customers to learn more about the product and decide whether it is the right product for them.

To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyses reviews to verify trustworthiness.

  • Sort reviews by Top reviews Most recent Top reviews

Top reviews from United Kingdom

There was a problem filtering reviews right now. please try again later..

java java java object oriented problem solving

Open Educational Resources Repository

Jordan university of science and technology.

  •   JUST OER Repository Home
  • Faculty of Computer & Information Technology
  • Computer Science
  • Digital Learning Materials - CS

Java, Java, Java: Object-Oriented Problem Solving

Description, collections.

The following license files are associated with this item:

  • Creative Commons
  • Material Detail: Java, Java, Java: Object-Oriented Problem Solving

Material Detail

Java, Java, Java: Object-Oriented Problem Solving

Java, Java, Java: Object-Oriented Problem Solving

We have designed this third edition of Java, Java, Java to be suitable for a typical Introduction to Computer Science (CS1) course or for a slightly more advanced Java as a Second Language course. This edition retains the “objects first” approach to programming and problem solving that was characteristic of the first two editions. Throughout the text we emphasize careful coverage of Java language features, introductory programming concepts, and...

  • Science and Technology  / Computer Science  / Programming & Programming Languages

rate this material with 1 stars

  • Peer Review
  • User Rating
  • Learning Exercises
  • Bookmark Collection   (1) Bookmark Collections
  • Course ePortfolios
  • Accessibility Info
  • Report Broken Link
  • Report as Inappropriate

More about this material

Asian American, Native American, Pacific Islander Serving Institution

Disciplines with similar materials as Java, Java, Java: Object-Oriented Problem Solving

People who viewed this also viewed.

"Introduction to Programming in Java" icon

Other materials like Java, Java, Java: Object-Oriented Problem Solving

Java, Java, Java: Object-Oriented Problem Solving icon

Full Description

We have designed this third edition of Java, Java, Java to be suitable for a typical Introduction to Computer Science (CS1) course or for a slightly more advanced Java as a Second Language course. This edition retains the “objects first” approach to programming and problem solving that was characteristic of the first two editions. Throughout the text we emphasize careful coverage of Java language features, introductory programming concepts, and object-oriented design principles.

The third edition retains many of the features of the first two editions, including:

  • Early Introduction of Objects
  • Emphasis on Object Oriented Design (OOD)
  • Unified Modeling Language (UML) Diagrams
  • Self-study Exercises with Answers
  • Programming, Debugging, and Design Tips.
  • From the Java Library Sections
  • Object-Oriented Design Sections
  • End-of-Chapter Exercises
  • Companion Web Site, with Power Points and other Resources 

The In the Laboratory sections from the first two editions have been moved onto the book’s Companion Web Site. Table 1 shows the Table of Contents for the third edition.

Edit Comment

Edit comment for material Java, Java, Java: Object-Oriented Problem Solving

Delete Comment

This will delete the comment from the database. This operation is not reversible. Are you sure you want to do it?

Report a Broken Link

Thank you for reporting a broken "Go to Material" link in MERLOT to help us maintain a collection of valuable learning materials.

Would you like to be notified when it's fixed?

Do you know the correct URL for the link?

Link Reported as Broken

Link report failed, report an inappropriate material.

If you feel this material is inappropriate for the MERLOT Collection, please click SEND REPORT, and the MERLOT Team will investigate. Thank you!

Material Reported as Inappropriate

Material report failed, comment reported as inappropriate, leaving merlot.

You are being taken to the material on another site. This will open a new window.

Do not show me this again

Rate this Material

rate this material with 1 stars

Search by ISBN?

It looks like you have entered an ISBN number. Would you like to search using what you have entered as an ISBN number?

Searching for Members?

You entered an email address. Would you like to search for members? Click Yes to continue. If no, materials will be displayed first. You can refine your search with the options on the left of the results page.

Object-Oriented Programming in Java – A Beginner's Guide

Patrick Cyubahiro

Hi, folks! Today we are going to talk about object-oriented programming in Java.

This article will help give you a thorough understanding of the underlying principles of object-oriented programming and its concepts.

Once you understand these concepts, you should have the confidence and ability to develop basic problem-solving applications using object-oriented programming principles in Java.

What is Object-Oriented Programming?

Object-oriented programming (OOP) is a fundamental programming paradigm based on the concept of “ objects ” . These objects can contain data in the form of fields (often known as attributes or properties) and code in the form of procedures (often known as methods).

The core concept of the object-oriented approach is to break complex problems into smaller objects.

In this article, we will be looking at the following OOP concepts:  

What is Java?

  • What is a class?
  • What is an object?
  • What is a Java Virtual Machine (JVM)?
  • How access modifiers work in Java.
  • How constructors work in Java.
  • How methods work in Java.
  • Key principles of OOP.
  • Interfaces in Java.

Java is a general-purpose, class-based, object-oriented programming language, which works on different operating systems such as Windows, Mac, and Linux.

You can use Java to develop:

  • Desktop applications
  • Web applications
  • Mobile applications (especially Android apps)
  • Web and application servers
  • Big data processing
  • Embedded systems

And much more.

In Java, every application starts with a class name, and this class must match the file name. When saving a file, save it using the class name and add “ .java ” to the end of the file name.

Let's write a Java program that prints the message “ Hello freeCodeCamp community. My name is ... ” .

We are going to start by creating our first Java file called Main.java, which can be done in any text editor. After creating and saving the file, we are going to use the below lines of code to get the expected output.

Don't worry if you don't understand the above code at the moment. We are going to discuss, step by step, each line of code just below.

For now, I want you to start by noting that every line of code that runs in Java must be in a class.

You may also note that Java is case-sensitive. This means that Java has the ability to distinguish between upper and lower case letters. For example, the variable “ myClass ” and the variable “ myclass ” are two totally different things.

Alright, let's see what that code's doing:

Let's first look at the main()  method: public static void main(String[] args) .

This method is required in every Java program, and it is the most important one because it is the entry point of any Java program.

Its syntax is always public static void main(String[] args) . The only thing that can be changed is the name of the string array argument. For example, you can change args to myStringArgs .

What is a Class in Java?

A class is defined as a collection of objects. You can also think of a class as a blueprint from which you can create an individual object.

To create a class, we use the keyword   class .

Syntax of a class in Java:

In the above syntax, we have fields (also called variables) and methods, which represent the state and behavior of the object, respectively.

Note that in Java, we use fields to store data, while we use methods to perform operations.

Let's take an example:

We are going to create a class named “ Main ” with a variable “ y ” . The variable “ y ” is going to store the value 2.

Note that a class should always start with an uppercase first letter, and the Java file should match the class name.

What is an Object in Java?

An object is an entity in the real world that can be distinctly identified. Objects have states and behaviors. In other words, they consist of methods and properties to make a particular type of data useful.

An object consists of:

  • A unique identity: Each object has a unique identity, even if the state is identical to that of another object.
  • State/Properties/Attributes: State tells us how the object looks or what properties it has.
  • Behavior: Behavior tells us what the object does.

Examples of object states and behaviors in Java:

Let's look at some real-life examples of the states and behaviors that objects can have.

  • Object: car.
  • State: color, brand, weight, model.
  • Behavior: break, accelerate, turn, change gears.
  • Object: house.
  • State: address, color, location.
  • Behavior: open door, close door, open blinds.

Syntax of an object in Java:

What is the java virtual machine (jvm).

The Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs.

The JVM has two primary functions, which are:

  • To allow Java programs to run on any device or operating system (this is also known as the "Write once, run anywhere" principle).
  • And, to manage and optimize program memory.

How Access Modifiers Work in Java

In Java, access modifiers are keywords that set the accessibility of classes, methods, and other members.

These keywords determine whether a field or method in a class can be used or invoked by another method in another class or sub-class.

Access modifiers may also be used to restrict access.

In Java, we have four types of access modifiers, which are:

Let's look at each one in more detail now.

Default Access Modifier

The default access modifier is also called package-private. You use it to make all members within the same package visible, but they can be accessed only within the same package.

Note that when no access modifier is specified or declared for a class, method, or data member, it automatically takes the default access modifier.

Here is an example of how you can use the default access modifier:

Now let's see what this code is doing:

void output() : When there is no access modifier, the program automatically takes the default modifier.

SampleClass obj = new SampleClass(); :  This line of code allows the program to access the class with the default access modifier.

obj.output(); : This line of code allows the program to access the class method with the default access modifier.

The output is: Hello World! This is an Introduction to OOP - Beginner's guide. .

Public Access Modifier

The public access modifier allows a class, a method, or a data field to be accessible from any class or package in a Java program. The public access modifier is accessible within the package as well as outside the package.

In general, a public access modifier does not restrict the entity at all.

Here is an example of how the public access modifier can be used:

Now let's see what's going on in that code:

In the above example,

  • The public class Car is accessed from the Main class.
  • The public variable tireCount is accessed from the Main class.
  • The public method display() is accessed from the Main class.

Private Access Modifier

The private access modifier is an access modifier that has the lowest accessibility level. This means that the methods and fields declared as private are not accessible outside the class. They are accessible only within the class which has these private entities as its members.

You may also note that the private entities are not visible even to the subclasses of the class.

Here is an example of what would happen if you try accessing variables and methods declared private, outside the class:

Alright, what's going on here?

  • private String activity : The private access modifier makes the variable “activity” a private one.
  • SampleClass task = new SampleClass(); : We have created an object of SampleClass.
  • task.activity = "We are learning the core concepts of OOP."; : On this line of code we are trying to access the private variable and field from another class (which can never be accessible because of the private access modifier).

When we run the above program, we will get the following error:

This is because we are trying to access the private variable and field from another class.

So, the best way to access these private variables is to use the getter and setter methods.

Getters and setters are used to protect your data, particularly when creating classes. When we create a getter method for each instance variable, the method returns its value while a setter method sets its value.

Let's have a look at how we can use the getters and setters method to access the private variable.

When we run the above program, this is the output:

As we have a private variable named task in the above example, we have used the methods getTask() and setTask() in order to access the variable from the outer class. These methods are called getter and setter in Java.

We have used the setter method ( setTask() ) to assign value to the variable and the getter method ( getTask() ) to access the variable.

To learn more about the this keyword, you can read this article here .

Protected Access Modifier

When methods and data members are declared protected , we can access them within the same package as well as from subclasses.

We can also say that the   protected access modifier is somehow similar to the default access modifier. It is just that it has one exception, which is its visibility in subclasses.

Note that classes cannot be declared protected. This access modifier is generally used in a parent-child relationship.

Let's have a look at how we can use the protected access modifier:

What's this code doing?

In this example, the class   Test which is present in another package is able to call the   multiplyTwoNumbers() method, which is declared protected.

The method is able to do so because the Test class extends class Addition and the protected modifier allows the access of protected members in subclasses (in any packages).

What are Constructors in Java?

A constructor in Java is a method that you use to initialize newly created objects.

Syntax of a constructor in Java:

So what's going on in this code?

  • We have started by creating the Main class.
  • After that, we have created a class attribute, which is the variable a .
  • Third, we have created a class constructor for the Main class.
  • After that, we have set the initial value for variable a that we have declared. The variable a will have a value of 9. Our program will just take 3 times 3, which is equal to 9. You are free to assign any value to the variable a . (In programming, the symbol “*” means multiplication).

Every Java program starts its execution in the main() method. So, we have used the public static void main(String[] args) , and that is the point from where the program starts its execution. In other words, the main() method is the entry point of every Java program.

Now I'll explain what every keyword in the main() method does.

The public keyword.

The public keyword is an access modifier . Its role is to specify from where the method can be accessed, and who can access it. So, when we make the main() method public, it makes it globally available. In other words, it becomes accessible to all parts of the program.

The static keyword.

When a method is declared with a static keyword, it is known as a static method. So, the Java main() method is always static so that the compiler can call it without or before the creation of an object of the class.

If the main() method is allowed to be non-static, then the Java Virtual Machine will have to instantiate its class while calling the main() method.

The static keyword is also important as it saves unnecessary memory wasting which would have been used by the object declared only for calling the main() method by the Java Virtual Machine.

The Void keyword.

The void keyword is a keyword used to specify that a method doesn’t return anything. Whenever the main() method is not expected to return anything, then its return type is void. So, this means that as soon as the main() method terminates, the Java program terminates too.

Main is the name of the Java main method. It is the identifier that the Java Virtual Machine looks for as the starting point of the java program.

The String[] args .

This is an array of strings that stores Java command line arguments.

The next step is to create an object of the class Main. We have created a function call that calls the class constructor.

The last step is to print the value of a , which is 9.

How Methods Work in Java

A method is a block of code that performs a specific task. In Java, we use the term method, but in some other programming languages such as C++, the same method is commonly known as a function.

In Java, there are two types of methods:

  • User-defined Methods : These are methods that we can create based on our requirements.
  • Standard Library Methods : These are built-in methods in Java that are available to use.

Let me give you an example of how you can use methods in Java.

Java methods example 1:

In the above example, we have created a method named divideNumbers() . The method takes two parameters x and y, and we have called the method by passing two arguments firstNumber and secondNumber .

Now that you know some Java basics, let's look at object-oriented programming principles in a bit more depth.

Key Principles of Object-Oriented Programming.

There are the four main principles of the Object-Oriented Programming paradigm. These principles are also known as the pillars of Object-Oriented Programming.

The four main principles of Object-Oriented Programming are:

  • Encapsulation (I will also touch briefly on Information Hiding)
  • Inheritance
  • Abstraction
  • Polymorphism

Encapsulation and Information Hiding in Java

Encapsulation is when you wrap up your data under a single unit. In simple terms, it is more or less like a protective shield that prevents the data from being accessed by the code outside this shield.

A simple example of encapsulation is a school bag. A school bag can keep all your items safe in one place, such as your books, pens, pencils, ruler, and more.

Information hiding or data hiding in programming is about protecting data or information from any inadvertent change throughout the program. This is a powerful Object-Oriented Programming feature, and it is closely associated with encapsulation.

The idea behind encapsulation is to ensure that " sensitive " data is hidden from users. To achieve this, you must:

  • Declare class variables/attributes as private .
  • Provide public get and set methods to access and update the value of a private variable.

As you remember, private variables can only be accessed within the same class and an external class cannot access them. However, they can be accessed if we provide public get and set methods.

Let me give you an additional example that demonstrates how the get and set methods work:

Inheritance in Java

Inheritance allows classes to inherit attributes and methods of other classes. This means that parent classes extend attributes and behaviors to child classes. Inheritance supports reusability.

A simple example that explains the term inheritance is that human beings (in general) inherit certain properties from the class "Human" such as the ability to speak, breathe, eat, drink, and so on.

We group the "inheritance concept" into two categories:

  • subclass (child) - the class that inherits from another class.
  • superclass (parent) - the class being inherited from.

To inherit from a class, we use the extends keyword.

In the below example, the JerryTheMouse class is created by inheriting the methods and fields from the Animal class.

JerryTheMouse is the subclass and Animal is the superclass.

Abstraction in Java

Abstraction is a concept in object-oriented programming that lets you show only essential attributes and hides unnecessary information in your code. The main purpose of abstraction is to hide unnecessary details from your users.

A simple example to explain abstraction is to think about the process that comes into play when you send an email. When you send an email, complex details such as what happens as soon as it is sent and the protocol that the server uses are hidden from you.

When you send an e-mail, you just need to enter the email address of the receiver, the email subject, type the content, and click send.

You can abstract stuff by using abstract classes or interfaces .

The abstract keyword is a non-access modifier, used for classes and methods:

  • Abstract class: is a restricted class that cannot be used to create objects. To access it, it must be inherited from another class.
  • Abstract method: A method that doesn't have its body is known as an abstract method. We use the same abstract keyword to create abstract methods.

The body of an abstract method is provided by the subclass (inherited from).

Polymorphism in Java

Polymorphism refers to the ability of an object to take on many forms. Polymorphism normally occurs when we have many classes that are related to each other by inheritance.

Polymorphism is similar to how a person can have different characteristics at the same time.

For instance, a man can be a father, a grandfather, a husband, an employee, and so forth – all at the same time. So, the same person possesses different characteristics or behaviors in different situations.

We are going to create objects Cow and Cat, and call the animalSound() method on each of them.

Inheritance and polymorphism are very useful for code reusability. You can reuse the attributes and methods of an existing class when you create a new class.

Interfaces in Java

An interface is a collection of abstract methods. In other words, an interface is a completely " abstract class " used to group related methods with empty bodies.

An interface specifies what a class can do but not how it can do it.

We have looked at some of the main object-oriented programming concepts in this article. Having a good understanding of these concepts is essential if you want to use them well and write good code.

I hope this article was helpful.

My name is Patrick Cyubahiro, I am a software & web developer, UI/UX designer, technical writer, and Community Builder.

Feel free to connect with me on Twitter: @ Pat_Cyubahiro , or to write to: ampatrickcyubahiro[at]gmail.com

Thanks for reading and happy learning!

Community Builder, Software & web developer, UI/IX Designer, Technical Writer.

If you read this far, thank the author to show them you care. Say Thanks

Learn to code for free. freeCodeCamp's open source curriculum has helped more than 40,000 people get jobs as developers. Get started

Logo image

Java, Java, Java: Object-Oriented Problem Solving, 2022E

Ralph Morelli, Ralph Walde, Beryl Hoffman

Search Results:

java java java object oriented problem solving

CS1 Open Source Textbook

Downloads and online content, instructor resources.

  • Solutions Manual for the back-of-chapter exercises.
  • Powerpoint Slides (3rd edition)
  • HTML Lecture Notes (1st edition only)
  • Solutions Laboratory Assignments

Github Repository

The Online Books Page

Java, java, java: object-oriented problem solving.

Help with reading books -- Report a bad link -- Suggest a new listing

Home -- Search -- New Listings -- Authors -- Titles -- Subjects -- Serials

Books -- News -- Features -- Archives -- The Inside Story

Edited by John Mark Ockerbloom (onlinebooks@pobox.upenn.edu) Data for this curated collection listing is CC0. See OBP copyrights and licenses .

IMAGES

  1. Morelli, Java, Java, Java Object-Oriented Problem Solving, 2nd Edition

    java java java object oriented problem solving

  2. Java, Java, Java: Object-Oriented Problem Solving by R. Morelli (2000

    java java java object oriented problem solving

  3. Object Oriented Programming in Java

    java java java object oriented problem solving

  4. Basic Concepts of Object Oriented Programming (JAVA)

    java java java object oriented problem solving

  5. JAVA, JAVA, JAVA Object-Oriented Problem Solving Ralph Morelli

    java java java object oriented problem solving

  6. learn Java as it is, Object-Oriented Principles of Java

    java java java object oriented problem solving

VIDEO

  1. How To Create Object In Java

  2. Core Java Tutorial for Beginners

  3. ООП, классы и объекты

  4. 25. Master Java's OOPS Concept : #oops#objectorientedobject oriented programming, #shorts

  5. Java Object Oriented Programming 14

  6. Java Professional Day 4

COMMENTS

  1. Java, Java, Java: Object-Oriented Problem Solving

    We have designed this third edition of Java, Java, Java to be suitable for a typical Introduction to Computer Science (CS1) course or for a slightly more advanced Java as a Second Language course. This edition retains the "objects first" approach to programming and problem solving that was characteristic of the first two editions. Throughout the text we emphasize careful coverage of Java ...

  2. PDF Java, Java, Java

    "objects first" approach to programming and problem solving that was characteristic of the first two editions. Throughout the text we emphasize careful coverage of Java language features, introductory programming concepts, and object-oriented design principles. The third edition retains many of the features of the first two editions ...

  3. Java, Java, Java: Object-Oriented Problem Solving

    Functional and flexible, this guide takes an objects-first approach to Java programming and problem using games and puzzles. Updated to cover Java version 1.5 features, such as generic types, enumerated types, and the Scanner class. Offers independent introductions to both a command-line interface and a graphical user interface (GUI).

  4. Java, Java, Java Object-Oriented Problem Solving (2nd Edition)

    This second edition of Java, Java, Java offers a robust, accessible, and flexible problem-solving perspective. The use of Unified Modeling Language (UML) diagrams throughout the text, strongly emphasizes object-oriented design. This book assists students and professionals with their most challenging problem as beginning programmers: object abstraction, or how to use interacting objects and ...

  5. Java, Java, Java: Object-Oriented Problem Solving

    There is a newer edition of this item: Java, Java, Java: Object-Oriented Problem Solving. $89.98. (23) Only 1 left in stock - order soon. Offers a robust, accessible, and flexible problem-solving approach to Java programming by introducing objects early, to ensure that readers can benefit from a big picture perspective. Softcover.

  6. Java, Java, Java : Object-oriented Problem Solving

    Functional and flexible, this guide takes an objects-first approach to Java programming and problem using games and puzzles. Updated to cover Java version 1.5 features, such as generic types, enumerated types, and the Scanner class. Offers independent introductions to both a command-line interface and a graphical user interface (GUI). Features coverage of Unified Modeling Language (UML), the ...

  7. Java, Java, Java: Object-Oriented Problem Solving

    Java, Java, Java: Object-Oriented Problem Solving. Ralph Morelli, Ralph Walde. Available electronically from https: / /hdl.handle.net /1969.1 /188646. The following license files are associated with this item: Creative Commons; Except where otherwise noted, this item's license is described as Attribution-NonCommercial-ShareAlike 4.0 ...

  8. Java, Java, Java: Object-oriented Problem Solving Paperback

    Java, Java, Java- Object-Oriented Problem Solving offers a robust, accessible, and flexible problem-solving approach to Java programming by introducing objects early to ensure that readers can benefit from a "big picture" perspective. This book assists students and professionals with their most challenging problem as beginning programmers ...

  9. Java, Java, Java!: Object-oriented Problem Solving

    Java, Java, Java!: Object-oriented Problem Solving, Volume 1. The text uses a top-down approach to focus on problem decomposition and program design from the beginning. It is this methodology-along with its lucid and engaging exercises and analogies- that sets this book apart. Morelli introduces some of Javas advanced features including GUIs (e ...

  10. Java, Java, Java! : Object-oriented Problem Solving

    Object-oriented Problem Solving. Ralph Morelli. Prentice Hall, 2003 - Computers - 862 pages. The author takes an objects early approach to teaching Java, with the assumption that teaching beginners the big picture early gives them more time to master the principles of object-oriented programming. The text focuses on the motivation behind Java's ...

  11. Java, Java, Java: Object-Oriented Problem Solving

    Description. We have designed this third edition of Java, Java, Java to be suitable for a typical Introduction to Computer Science (CS1) course or for a slightly more advanced Java as a Second Language course. This edition retains the "objects first" approach to programming and problem solving that was characteristic of the first two editions.

  12. Java, Java, Java! : object-oriented problem solving : Morelli, R

    Java, Java, Java! : object-oriented problem solving by Morelli, R. (Ralph) Publication date 2003 Topics Object-oriented programming (Computer science), Java (Computer program language) Publisher Upper Saddle River, NJ : Prentice Hall Collection inlibrary; printdisabled; internetarchivebooks Contributor Internet Archive Language

  13. Java, Java, Java: Object-Oriented Problem Solving

    Java, Java, Java: Object-Oriented Problem Solving. We have designed this third edition of Java, Java, Java to be suitable for a typical Introduction to Computer Science (CS1) course or for a slightly more advanced Java as a Second Language course. This edition retains the "objects first" approach to programming and problem solving that was ...

  14. Object-Oriented Programming in Java

    Hi, folks! Today we are going to talk about object-oriented programming in Java. This article will help give you a thorough understanding of the underlying principles of object-oriented programming and its concepts. Once you understand these concepts, you should have the confidence and ability to develop basic problem-solving applications

  15. PDF Java, Java, Java Object-Oriented Problem Solving

    "objects first" approach to programming and problem solving that was characteristic of the first two editions. Throughout the text we emphasize careful coverage of Java language features, introductory programming concepts, and object-oriented design principles. The third edition retains many of the features of the first two editions ...

  16. Java, Java, Java

    Java, Java, Java: Object-Oriented Problem Solving, 2022E. Ralph Morelli, Ralph Walde, Beryl Hoffman Contents ... 5.11 Problem Solving = Representation + Action. 5.12 Chapter Summary. 5.12.1 Technical Terms. 5.12.2 Summary of Important Points. 5.12.3 Solutions to Self-Study Exercises.

  17. JJJ, 3e

    JJJ, 3e. CS1 Open Source Textbook. Java, Java, Java: Object-Oriented Problem Solving, 3/E Ralph Morelli Ralph Walde Original Publisher: 2006, Pearson Education, Inc. (Prentice-Hall) Third Edition Published: 12/22/2005 Open Source Edition Published: 2/5/2012 Format: PDF, 849 pages This work is licensed under a Creative Commons Attribution 4.0 ...

  18. Java, Java, Java: Object-Oriented Problem Solving

    Title:: Java, Java, Java: Object-Oriented Problem Solving: Author:: Morelli, R. (Ralph) Author:: Walde, Ralph: Note: Creative Commons-licensed third edition; 2017

  19. [PDF] Java, Java, Java Object-Oriented Problem Solving

    This version of a popular book focuses on Java's strengths and object-oriented problem solving, and provides a solid understanding of objects and methods, concentrating on problem decomposition and program design. From the Publisher: In this version of a popular book, the author takes an objects early approach to teaching Java, with the assumption that teaching beginners the big picture early ...

  20. Java, Java, Java Object-Oriented Problem Solving : R. Walde : Free

    Java, Java, Java Object-Oriented Problem Solving by R. Walde; R. Morelli. Publication date 2012 Topics computer-science, java, computer science Publisher Pearson Education, Inc. Collection opensource_textbooks; additional_collections Contributor hst Language English Rights

  21. Java, Java, Java! : object-oriented problem solving : Morelli, R

    Java, Java, Java! : object-oriented problem solving by Morelli, R. (Ralph) Publication date 2000 Topics Object-oriented programming (Computer science), Java (Computer program language), Programmation orientée objets (informatique), Java (langage de programmation), Langages orientés objets

  22. Java Programming Fundamentals: Problem Solving Through Object Oriented

    Written by an expert with 19 experience teaching computer programming, Java Programming Fundamentals presents object-oriented programming by employing examples taken from everyday life. Provides a foundation in object-oriented design principles and UML notation. Describes common pitfalls and good programming practices.

  23. Java, Java, Java: Object-Oriented Problem Solving

    The disc that came with the book "Java, Java, Java: Object-Oriented Problem Solving" by Ralph Morelli. Published by Prentice Hall. ISBN: -13-011332-8. Software included: Source code from the book; Inprise (Borland) JBuilder 3; NetBeans DeveloperX2 2.1; Java 2 Standard Edition 1.2.1; Netscape 4.61;