For years, Murach’s Java Programming has been one of our best-selling college books...but its fast pace can make it a challenging book for beginners. That’s why we designed Murach’s Beginning Java with Eclipse specifically for a first course in programming or a first course in Java.
Like Murach’s Java Programming, we expect our Beginning Java book to become a favorite of instructors and students because of the clear, concise way it teaches Java and OO programming. Beyond that, though, this new book has didactic features that make it much more effective for beginners.
You are currently on the Murach site for instructors. To buy this book, please visit our retail site.
At long last, a Java book written with understandable text, ready-to-run code, and some of the best exercises in print! This book has a no-nonsense style, with an expert perspective on the big picture.”
Section 1 presents a 6-chapter Java course that gets your students off to a great start. This section works for a first course in programming or in Java because it lets you set the right pace. For a first programming course, you can have your students move slowly and do all the exercises. For a first Java course, they’ll move more quickly and do the exercises that you select.
From the start, your students will be using the Eclipse IDE because that will help them learn faster. Then, by chapter 3, they’ll be developing applications that use classes from the Java API. By chapter 4, they’ll be creating and using their own classes. By chapter 5, they’ll be using a 3-tier architecture to structure object-oriented applications like a professional. And by chapter 6, they’ll be using the best practices for testing and debugging their applications.
Once your students master the skills of section 1, the hard work is done. Then, you can add to their core skills by covering the chapters in sections 2, 3, and 4. At that point, they’ll have all the Java prerequisites they need for web or Android courses.
And if you have time, you can give them a good look at the real world of Java programming by using section 5. This section introduces them to coding desktop applications using Swing to create GUI interfaces and using MySQL to handle database data.
In section 2, your students will expand upon what they learned in section 1 by mastering more of the core Java skills that they’ll use all the time. That means that they’ll learn new skills, like how to work with strings and arrays. But they’ll also learn more about topics that were introduced in section 1, like working with primitive types and operators and coding control statements. These are the essentials that your students need for section 3.
In section 1, your students learned how to develop their first object-oriented programs. Now, after section 2, they have the core skills for learning more about OOP.
Then, section 3 cuts through the mysteries of inheritance, interfaces, polymorphism, and the factory pattern so your students learn how to create and use more sophisticated business and data access classes. When your students finish this section, they will know how to develop real-world, object-oriented, business applications.
Like section 2, section 4 lets your students expand their core Java skills in new ways. To be specific, it covers how to work with collections, generics, lambdas, dates, times, exceptions, file I/O, and threads. However, because each chapter in this section is an independent module, you don’t have to assign these chapters in sequence and you don’t have to assign all of them. Instead, you can use the sequence and content that works best for your class.
When your students complete sections 1-4, they will have all the perquisite Java skills they need for courses on Java web programming, Android programming, or advanced Java. But there’s a bonus section!
The 4 chapters in section 5 are designed to give your students a better appreciation for what real-world programming is like. As a result, they introduce your students to the skills for developing desktop applications. To start, these chapters show how to create a MySQL database and how to write the Java code that works with the data in this database. Then, these chapters show how to develop a graphical user interface (GUI) for the application.
Of course, you don’t have to assign the chapters in this section. You can also assign them as information only: no exercises. But we think that this section will provide an aha! moment for many students, showing them where their Java skills can take them… and that’s important in any first programming course.
Like all of our books, this one has the distinctive features that make Murach books so effective. But here are a few of the benefits that are specific to this book:
For the past 13 years, we’ve often had true beginners tell us that they like our Java book overall, but they also find it overwhelming at times. (As one reviewer of the first edition put it, “It’s not for the faint of heart!”) Students and would-be professionals alike have requested more explanation of certain topics, more examples, and a more relaxed pace.
So that’s what Murach’s Beginning Java delivers:
In short, we now have the ideal book for your students who are taking their first courses in programming and Java.
Unlike many Java books, this book shows how to use an IDE for developing Java applications. That’s how Java programming is done in the real world because an IDE is loaded with time-saving development tools. So that by itself will help your students learn faster.
For this book, we’ve chosen the Eclipse IDE because it’s free, widely used, and easy for beginners to get started with. Then, chapter 1 shows the basics of using this IDE, and subsequent chapters present new Eclipse skills whenever they’re useful.
Note, however, that we also have an NetBeans version of this book. So if you prefer to use that IDE, please get a review copy of that book. The only difference between the two books is the IDE.
Unlike many Java books, this one gets you going with object-oriented programming (OOP) from the start (call it “early objects”). By chapter 3, your students will be developing applications that use the classes from the Java API. By chapter 4, they’ll be creating and using their own classes. And by chapter 5, they’ll be using a 3-tier architecture to structure their object-oriented applications the way professionals do.
From that point on, your students will be doing and thinking objects throughout the rest of the book.
Unlike many Java books, this one focuses on the core Java features that are needed every day on the job. As a result, it doesn’t waste your students’ time by presenting skills that they probably won’t ever need.
This also means that all of the examples in this book are drawn from real-world applications. This is especially apparent in the object-oriented chapters, where most competing books resort to “animal”, “vehicle”, and “toy” applications that misrepresent what OOP is really like.
One of the goals of this book is to present all of the Java skills that your students will need to start learning web and Android programming. That’s why we made sure that this book covers all the prerequisites that are needed for Murach’s Java Servlets and JSP (our Java web programming book) and Murach’s Android Programming.
But regardless of what web programming or Android book you use, we haven’t seen another beginning Java book that prepares students so thoroughly for advanced courses.
Java SE 8 is the current version of Java and the one that this book shows how to use. However, since all versions of Java are backwards compatible, the code and skills presented in this book will work with later versions too.
As you can tell from its title, this book shows how to use the Eclipse IDE to code, test, and debug applications. We chose Eclipse because we think it’s a great tool that is easy for beginners to use and runs on all operating systems.
Your students can download Java and its documentation for free from the Oracle website. Likewise, they can download Eclipse for free from the Eclipse website. To make this easier, Appendix A (for Windows) and Appendix B (for the Mac) explain the procedures that they will use to download and install both pieces of software.
If you prefer to use NetBeans for your Java course, please note that we have an NetBeans version of this book called Murach’s Beginning Java with NetBeans. The only difference between that book and this one is the IDE.
After we published our Beginning Java texts, we updated our longtime core Java book, and the latest edition is Murach’s Java Programming (5th Edition).
It differs from this Beginning Java book in that (1) it goes into more depth and breadth on some subjects, especially GUI and database handling, (2) it covers up through Java 9 instead of Java 8, and (3) it uses NetBeans as the IDE (but we provide all the source code in Eclipse format, along with a PDF on using Eclipse instead of NetBeans with the book). It differs, too, from the 4th edition in that we integrated much of what we learned from the Beginning books to make this edition more beginner-friendly.
So you might want to take a look at the table of contents to see if you prefer it to the Beginning Java book. It’s true, you probably won’t be able to cover everything in it unless you offer multiple courses in Java. But by the end of your first course, students will be confident about using the book to learn additional skills on their own…a great resource for those who become professional Java developers.
“This is a great book for someone new to programming or just new to the Java language.
“The authors slowly walk the reader through the basics: what Java is, OO basics, how to use an IDE, and how to test and debug. The core Java constructs are covered: control statements (if/else, loops and exception handling), strings and arrays. Proper detail is given to key concepts needed to work with Java, including inheritance, how to use collections, and working with lambdas. [And] the book does a complete job instructing the reader on how to use the free and open source IDE, Eclipse.”
- Erik Weibust, Java MUG (Metroplex Users Group)
“I really liked the intro including types of applications and keywords. I liked the covering Eclipse as needed for specific concepts, including perspectives, code completion, and the debugger. Similarly, good programming idioms are covered so readers can see patterns. I particularly liked how the code listings highlight the relevant parts.”
“Great for learning both Java and your first IDE.”
- Jeanne Boyarsky, JavaRanch.com
“At the end of every chapter, there are a set of hands-on exercises that let you practice the concepts in that chapter. So many other books either don't have practice problems at all, or if they do, they are so open-ended and time-consuming that it is hard to know if you got them right. Murach provides practice code that you download from their website. The problems typically involve using the IDE to make simple code modifications, and then running and debugging your changes. This is an important hands-on approach, since it is not enough to learn a new language just by reading about it.”
- Bruce Alspaugh, St. Louis Java Users Group
“The text rightly uses console applications to focus on the actions described in code. Creating a user interface takes a back seat and is only discussed in the last two chapters, which keeps the focus on the Java code itself. Too many introductory texts focus on the UI at the expense of the code. A great beginner’s text for learning Java.”
- Eric Notheisen, Enterprise Developers Guild
View the table of contents for this book in a PDF: Table of Contents (PDF)
Click on any chapter title to display or hide its content.
Java timeline
Java editions
How Java compares to C++ and C#
Two types of desktop applications
Two types of web applications
Mobile apps
The code for a console application
How Java compiles and interprets code
Introduction to IDEs for Java development
How to select a workspace
How to import a project into a workspace
How to open a file in the code editor
How to compile and run a project
How to enter input for a console application
How to work with two or more projects
How to remove a project from a workspace
How to code a class
How to code a main method
How to code statements
How to code comments
How to print output to the console
How to create a new project
How to create a new class
How to work with Java source code and files
How to use the code completion feature
How to detect and correct syntax errors
How to declare and initialize variables
How to assign values to a variable
How to code arithmetic expressions
How to declare and initialize String variables
How to join strings
How to include special characters in strings
The user interface
The CodeTesterApp class
How to import classes
How to create an object from a class
How to call a method from an object
How to call a method from a class
How to view the documentation for the Java API
How to use the Scanner class to get input
How to convert strings to numbers
A class that reads input from the console
How to convert numbers to formatted strings
A class that prints formatted numbers to the console
How to compare numbers
How to compare strings
How to code a while loop
How to code an if/else statement
The user interface
The code
The user interface
The code
How encapsulation works
The relationship between a class and its objects
The Product class
How to code instance variables
How to code constructors
How to code methods
How to create an object from a class
How to call the methods of an object
The ProductDB class
How to code and call static fields and methods
When to use static fields and methods
The user interface
The ProductApp class
Reference types compared to primitive types
How to overload methods
How to use the this keyword
The Product class with overloading
How the three-tier architecture works
How to work with packages
How to use Eclipse to work with packages
The user interface
The class diagram
The LineItem class
The LineItemApp class
Typical test phases
The three types of errors
Common Java errors
How to determine the cause of an error
A simple way to trace code execution
How to set and remove breakpoints
How to step through code
How to inspect variables
How to inspect the stack trace
The eight primitive data types
How to declare and initialize variables
How to declare and initialize constants
How to use the binary operators
How to use the unary operators
How to use the compound assignment operators
How to work with the order of precedence
How to work with casting
How to use the Math class
How to use the BigDecimal class
How to fix rounding errors
The user interface
The code
How to compare primitive data types
How to use the logical operators
How to code if/else statements
How to code switch statements
A new if/else statement for the Invoice application
How to code while loops
How to code do-while loops
How to code for loops
How to code break and continue statements
How exceptions work
How to catch exceptions
The user interface
The code
How to create strings
How to join strings
How to append data to a string
How to compare strings
How to work with string indexes
How to modify strings
How to create a StringBuilder object
How to append data to a string
How to modify strings
The user interface
The StringUtil class
The Main class
How to create an array
How to assign values to the elements of an array
How to use for loops with arrays
How to use enhanced for loops with arrays
How to work with two-dimensional arrays
How to fill an array
How to sort an array
How to search an array
How to create a reference to an array
How to copy an array
How to compare two arrays
The user interface
The Main class
How inheritance works
How the Object class works
How to create a superclass
How to create a subclass
How polymorphism works
The console
The Product, Book, and Software classes
The ProductDB class
The ProductApp class
How to cast objects
How to compare objects
How to work with the abstract keyword
How to work with the final keyword
A simple interface
Interfaces compared to abstract classes
How to code an interface
How to implement an interface
How to inherit a class and implement an interface
How to use an interface as a parameter
How to use inheritance with interfaces
How to work with default methods
How to work with static methods
The console
The ProductReader interface
The ProductDB class
The ProductApp class
An introduction to GUI programming
How to code an inner class
How to code an anonymous class
How to declare an enumeration
How to use an enumeration
How to enhance an enumeration
How to work with static imports
How to add javadoc comments to a class
How to use HTML and javadoc tags in javadoc comments
How to use Eclipse to generate documentation
How to view the documentation
A comparison of arrays and collections
An overview of the Java collection framework
An introduction to generics
How to create an array list
How to add and get elements
How to replace, remove, and search for elements
How to store primitive types in an array list
The user interface
The Invoice class
The InvoiceApp class
An introduction to lambdas
A method that doesn’t use a lambda expression
A method that uses a lambda expressions
How to use the Predicate interface
The date/time API prior to Java 8
The date/time API for Java 8 and later
How to create date and time objects
How to get date and time parts
How to compare dates and times
How to adjust date/time objects
How to add or subtract a period of time
How to format dates and times
An Invoice class that includes an invoice date
The exception hierarchy
How exceptions are propagated
How to use the try statement
How to use the try-with-resources statement
How to use the methods of an exception
How to use a multi-catch block
How to use the throws clause
How to use the throw statement
How to create your own exception class
How to use exception chaining
A package for working with directories and files
Code examples that work with directories and files
How files and streams work
A file I/O example
How to work with I/O exceptions
How to connect a character output stream to a file
How to write to a text file
How to connect a character input stream to a file
How to read from a text file
A class that works with a text file
The console
The Main class
How threads work
Typical uses for threads
Classes and interfaces for working with threads
The life cycle of a thread
Constructors and methods of the Thread class
How to extend the Thread class
How to implement the Runnable interface
How to use synchronized methods
When to use synchronized methods
How a table is organized
How the tables in a database are related
How the columns in a table are defined
What MySQL provides
Ways to interact with MySQL
How to open a database connection
How to enter and execute a SQL statement
How to drop, create, and select a database
How to create a table and insert data
How to create a user and grant privileges
How to select data from a table
How to insert, update, and delete rows
An introduction to database drivers
How to connect to a database
How to return a result set and move the cursor through it
How to get data from a result set
How to insert, update, and delete data
How to work with prepared statements
The DBUtil class
The ProductDB class
Code that uses the ProductDB class
A summary of GUI toolkits
The inheritance hierarchy for Swing components
How to display a frame
How to add a panel to a frame
How to add buttons to a panel
How to handle a button event
A summary of layout managers
How to use the FlowLayout manager
How to use the BorderLayout manager
How to create a model for a table
The ProductTableModel class
How to create a table
How to get the selected row or rows
How to add scrollbars to a table
How to display a message
How to confirm an operation
The user interface
The ProductManagerFrame class
How to work with labels
How to work with text fields
An introduction to the GridBagLayout manager
How to lay out components in a grid
How to add padding
How to avoid a common pitfall
How to create a custom dialog
How to pass data between a dialog and its parent
The user interface
The ProductForm class
Two methods that use the ProductForm class
A common problem
How to solve the problem
How to install the JDK
How to install Eclipse
How to install the source code for this book
How to install MySQL and MySQL Workbench
How to create the database for this book
How to restore the database for this book
How to install the JDK
How to install Eclipse
How to install the source code for this book
How to install the MySQL Community Server
How to install MySQL Workbench
How to create the databases for this book
How to restore the databases
How to update the password for the root user
If you aren’t already familiar with the supporting courseware that we provide for a book, please go to About our Courseware. As you will see, our courseware consists of the end-of-chapter activities in the book, the files in the student download at our retail site, and the instructor’s materials. These components provide everything that other publishers provide in a way that delivers better results.
If you are familiar with our courseware, here’s a quick summary of the courseware for this book. For a detailed description in PDF format, please read the Instructor’s Summary.
In the book, appendix A (for Windows) and appendix B (for Mac) give your students complete instructions for downloading and installing these items on their own systems.
On this page, we’ll be posting answers to the questions that come up most often about this book. So if you have any questions that you haven’t found answered here at our site, please e-mail us. Thanks!
To view the corrections for this book in a PDF, just click on this link: View the corrections
Then, if you find any other errors, please email us so we can correct them in the next printing of the book. Thank you!
This is our site for college instructors. To buy Murach books, please visit our retail site.