Java for Programmers

with Generative AI

Harvey Deitel author Paul Deitel author

Format:Paperback

Publisher:Pearson Education (US)

Published:16th May '25

£44.99

Supplier delay - available to order, but may take longer than usual.

Java for Programmers cover

The professional programmer's Deitel® guide to Java with integrated generative AI

Written for programmers with a background in another high-level language, in Java for Programmers: with Generative AI, Fifth Edition, you'll learn modern Java development hands on using the latest Java idioms and features and genAIs.

In the context of 200+ real-world code examples, you'll quickly master Java fundamentals then move on to arrays, strings, regular expressions, JSON/CSV processing with the Jackson library, private- and public-key cryptography, classes, inheritance, polymorphism, interfaces, dependency injection, exceptions, generic collections, custom generics, functional programming with lambdas and streams, JavaFX GUI, graphics and multimedia, platform threads, virtual threads, structured concurrency, scoped values, building API-based Java genAI apps, database with JDBC and SQLite, the Java Platform Module System and JShell for Python-like interactivity.

Features:

  • GenAI Prompt Engineering, API Calls, 600 GenAI Exercises
  • ChatGPT, Gemini, Claude, Perplexity
  • Multimodal: Text, Code, Images, Audio, Speech-to-Text, Text-to-Speech, Video
  • Generics: Collections, Classes, Methods
  • Functional Programming: Lambdas & Streams
  • JavaFX: GUI, Graphics, Multimedia
  • Concurrency: Parallel Streams, Virtual Threads, Structured Concurrency, Scoped Values, Concurrent Collections, Multi-Core
  • Database: JDBC, SQL, SQLite
  • Java Platform Module System (JPMS)
  • Objects Natural: Java API, String, BigInteger, BigDecimal, Date/Time, Cryptography, ArrayList, Regex, JSON, CSV, Web Services
  • JShell for Python-Like Interactivity

Want to stay in touch with the Deitels?

  • Contact the authors at [email protected]
  • Join the Deitel social media communities
    deitel.com/linkedin
    facebook.com/DeitelFan
    instagram.com/DeitelFan
    x.com/deitel
    youtube.com/DeitelTV
    mastodon.social/@deitel
  • For source code and updates, visit: deitel.com/javafp5

Reviewer Comments
"The future of Java programming is here, and this new edition of Deitel is leading the charge! By embracing genAI head-on, the authors are potentially revolutionizing programming education. Through its integrative approach to the use and study of genAI, this book is positioned to be the leading book in modern Java and its applications. Indeed, I expect that it should be widely adopted by instructors who want to ingrain in their students an appreciation for the critical role that Java will play in data science, machine learning, artificial intelligence, and cybersecurity.

"The book's innovative and forward-thinking use of genAI facilitates reader engagement and inspires readers to think critically about the benefits and limitations of AI as a programming aid. Chapter 19 could become everyone's favorite new Java book chapter--the generative AI API-based code examples are interesting and fun.

"All audiences of this book should read the Preface--there's so much to get excited...

"Excellent coverage of the latest Java language features. The Strings chapter sets the stage for important applications in NLP (a critical ingredient to making genAI systems work) and cryptography (a critical ingredient to information security) that are introduced by objects-natural case studies in Chapters 7 (private-key cryptography) and 11 (public-key cryptography). The objects-natural case study on class BigInteger is especially pertinent at a time when cybersecurity is more important than ever and programmers need to develop an appreciation for secure software engineering practices.

"Real-World Modeling with Inheritance, Polymorphism and Interfaces covers a lot but I feel smarter after reading it and going through the associated genAI exercises! These are cleverly written so prompted AIs will guide the reader to 'fill in the gaps' and provide application areas where these techniques are used.

"The objects-natural case study on ArrayLists provides a 'sneak peek' at the Java Collections Framework showing how this data structure solves problems caused by the limitations of Java arrays. The Java Collections Framework chapter does an admirable job covering most key data structures and how Java’s built-in collections implement them. The section on hash tables is informative. The coverage of newer JDK techniques, such as convenience factory methods, is appropriate.

"The genAI exercises are highly valuable and fun, giving the reader new tools for filling in details and thinking critically about how and why certain practices are followed in Java in particular and object-oriented programming in general. Great job contrasting 'checked' and 'unchecked' exceptions. Suggests mechanisms for 'bulletproofing your code' with validation logic so that certain exceptions aren't thrown in the first place. The genAI prompt exercises on the types of OpenAI API messages passed to the chat completion API were very helpful for cementing my understating. Amazing AI description of the beach photo! In grad school my research group was barely scratching the surface of identifying objects in images--things have come a long way! The closed captions demo is cool!

"A broad introduction to fundamental OOP inheritance and polymorphism concepts. The use of interfaces to implement runtime polymorphism logically follows a similar discussion involving abstract classes. I like the discussion of the relative benefits of composition vs. inheritance. Accomplishes the herculean task of covering tight vs. loose coupling and dependency injection in just a few pages. Great to see the Builder design pattern in action."
--Brian Canada, Professor of Computational Science, University of South Carolina Beaufort

"This is the best book for learning Java that I have come across in 25+ years of Java experience. I've suggested using it to train developers in my company and in the companies where I do consultancy. A detailed explanation of the core Java language. Excellent discussion of inheritance and polymorphism. Teaches how to use and incorporate AI in your daily software-creation process. Using tools like ChatGPT, Gemini, Claude and Perplexity is now an essential skill to gain a competitive advantage. Awesome Chapter 19 that clearly introduces the power of AI API-based app development. A clear explanation of Java concurrency. The Big O discussion teaches the costs and consequences of design decisions. Great discussion of creating custom classes. Excellent intro to the Java Platform Module System. Best intro to JShell I've seen. I like the detailed discussion of how streams and lambdas work and the thorough explanation of exceptions."
--Ron Veen, Java Developer, Special Agent at Team Rockstars IT, co-author Virtual Threads, Structured Concurrency, and Scoped Values: Explore Java's New Threading Model

"The book's 'objects-natural' approach introduces substantial pre-existing Java classes and object interaction before diving into custom class creation in later chapters. I like the objects-natural case study with the date/time example--a good forced dive into the Java API documentation. I like that inheritance, interfaces, and composition are covered in the same chapter, as it is a logical progression that tells the story of what is the best approach for an OO Java program. The Building Java Generative AI API-Based Applications chapter taught me things I did not know. I appreciate how AI tools were used to help write the chapter and the text was transparent about it. The 94 end-of-chapter genAI exercises are exciting, creative, and fun. I really enjoyed the Files chapter--it brought in a lot of the latest technologies, such as JSON, CSV, networking APIs, and cryptography. Great job introducing and motivating generic class and method concepts and bringing in CS theory to support the practical application of Java's generic collection data structures."
--Emily Navarro, Ph.D., Continuing Lecturer, Department of Informatics, University of California, Irvine

"Uses the latest Java features to write code in the most modern ways. GenAIs can read diagrams! [Prompt genAIs with class Account's UML class diagram, asking them to generate the corresponding Java class declaration.] I like the genAI 'why questions,' such as, 'prompt genAIs for insights as to why Java constructors cannot return values.' I didn’t know GenAI would tell me to fix the errors even if I didn’t ask or could explain how the Java method-call stack works using text-only, step-by-step diagrams made of characters! Cool! Great list of NLP applications! The objects natural NLP, regex and cryptography security examples are awesome! They let the reader use String knowledge while also learning real-world principles. Includes a substantial treatment of JavaFX. The walkthrough of how to set up a JavaFX application in Scene Builder was excellent. Great JavaFX layouts table. Nice to see accessibility in the JavaFX chapters. A good intro to modules--covers the basics (and more) while remaining approachable. I like that you included the structure of a modularized application. The VideoPlayer module-dependency graph is a great real example. The progression of running the services example with no providers, then one, then two is a fun way to show the ServiceLoader really picks providers at runtime! I like the number and variety of JShell examples and exercises. I like how lambdas and method references are presented. Focuses on the most common generics use cases and makes them easy to understand. An objects-natural case study on BigDecimal--interesting discussion of how half-even banker's rounding works for processing monetary amounts. I like the concurrency examples--the explanations of virtual threads, structured concurrency and scoped values were good."
--Jeanne Boyarsky, CodeRanch, Java Champion

ISBN: 9780137574735

Dimensions: unknown

Weight: unknown

1136 pages

5th edition