freeprogrammingbooks.com

Programming with Java

By Ashik Ahmed Bhuiyan, Ph.D. & Md Amiruzzaman, Ph.D. (2025)

Programming with Java book cover

Java turned 30 in 2025 and remains one of the most widely used programming languages in enterprise environments. According to the 2026 State of Java Survey, 62% of organizations now use Java to build AI functionality, and 97% of enterprises have taken steps to reduce cloud costs through Java platform optimization.

With OpenJDK adoption surpassing 66% and Java 25 as the latest LTS release, the language continues to evolve with features like structured concurrency, virtual threads, and native compilation via GraalVM.

Java dominates in banking, insurance, government, and large-scale enterprise systems where stability and performance are non-negotiable. It also powers the data infrastructure behind Kafka, Spark, and Hadoop, and serves as the production backbone for AI systems trained in Python.

For beginners, learning Java means gaining access to one of the most extensive job markets in software development and a language that scales from Android apps to serverless cloud functions.

About the book

Programming with Java is a beginner-friendly textbook that introduces the fundamentals of Java programming without assuming any prior coding experience. Written by Ashik Ahmed Bhuiyan and Md Amiruzzaman, both computer science professors at West Chester University of Pennsylvania, the book progresses from basic concepts like variables and data types to object-oriented programming and file handling.

The text is designed for a first programming course and follows a modular structure, making it easy to follow chapter by chapter. Each section includes code examples, practical exercises, and explanations that build on previous material. The second edition reflects improvements based on classroom use and includes updated content on file I/O and exception handling.

What you will learn

  • The fundamentals of Java syntax, variables, data types, and operators
  • Control flow using if-else statements, switch-case, and loops (while, for, do-while)
  • String manipulation including methods like substring, indexOf, and charAt
  • Writing and calling methods, understanding scope, and method overloading
  • Working with arrays, including multidimensional arrays and common algorithms (sorting, duplicate removal)
  • Introduction to object-oriented programming: classes, objects, constructors, and access modifiers
  • File handling: reading and writing text files with FileReader, BufferedReader, FileWriter, and BufferedWriter
  • Exception handling and best practices for robust code

Table of contents

  1. Introduction — What is a computer, programming, Java, sample program, variables, constants, ASCII table, widening and narrowing
  2. Control Statements and Loops — If-else, switch-case, while, for, do-while, nested loops
  3. String — Declaration, input, helpful methods (length, toUpperCase, charAt, substring, indexOf), chaining, comparison
  4. Methods in Java — Defining and calling methods, types of methods, scope, common mistakes
  5. Arrays — Indexing, initialization, manipulation, copying, sorting, removing duplicates, multidimensional arrays, pitfalls
  6. Introduction to Classes and Objects — Class structure, objects, member variables, methods, access modifiers, constructors, passing objects
  7. File Handling — File classes, navigation, reading and writing text files, exception handling, best practices

Book details

  • Title: Programming with Java
  • Author(s): Ashik Ahmed Bhuiyan, Ph.D. & Md Amiruzzaman, Ph.D.
  • Publication year: 2025
  • Publisher: PA-ADOPT (The Pennsylvania Alliance for Design of Open Textbooks)
  • Pages: 159
  • PDF size: 7.38 MB
  • Estimated reading time: ~4 hours
  • Level: Beginner
  • Main category: Programming
  • Subcategory: Java
  • Language: English
  • License: CC BY-NC 4.0

More books in: Java, Programming


Legal notice: This book is shared for educational purposes only. The content is distributed under Creative Commons licenses or with explicit permission from the author. FreeProgrammingBooks may host files that comply with their respective licenses.

Want more free books?

Join our channels and receive free books, courses and tech news.