Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learn Java with Projects
  • Table Of Contents Toc
  • Feedback & Rating feedback
Learn Java with Projects

Learn Java with Projects

By : Dr. Seán Kennedy, Maaike van Putten
4.9 (51)
close
close
Learn Java with Projects

Learn Java with Projects

4.9 (51)
By: Dr. Seán Kennedy, Maaike van Putten

Overview of this book

Learn Java with Projects bridges the gap between introductory Java guides and verbose, theoretical references. This book is crafted to build a strong foundation in Java programming, starting from the Java environment itself. It goes far beyond a superficial review of the topics; it demonstrates, with practical examples, why these fundamentals are crucial for developing a deep understanding of the language. You'll not only learn about classes and objects but also see how these concepts are used in practical scenarios, enhancing your ability to write clean, efficient code. The engaging projects throughout the book provide real-world applications of complex topics, ensuring you can connect theoretical knowledge with practical skills. What makes this book stand out is the expertise of its authors. Seán, a seasoned university lecturer with over 20 years of experience, brings academic rigor and real-world insights, thanks to his work with a prestigious software company. Maaike, a passionate software developer and award-winning trainer, brings hands-on experience and a love for teaching. By the end of this book, you'll not only understand Java's core concepts and the critical advanced ones, but also gain practical experience through projects that mimic real-life challenges.
Table of Contents (22 chapters)
close
close
1
Part 1: Java Fundamentals
9
Part 2: Object-Oriented Programming
15
Part 3: Advanced Topics

What this book covers

Chapter 1, Getting Started with Java, starts by discussing the main Java features, such as OOP. How to install Java on various operating systems and how to write your first Java program with and without an IDE are also explored.

Chapter 2, Variables and Primitive Data Types, explains what a variable is and the fact that Java uses “strong-typing” (you must declare a variables type). This chapter also covers Java’s primitive data types, their sizes in bytes (needed to understand for later when discussing casting), and their ranges.

Chapter 3, Operators and Casting, explores how Java’s operators cooperate using precedence and associativity. We discuss Java’s various operators and explain both widening and narrowing when casting in Java.

Chapter 4, Conditional Statements, focuses on both scope and conditional statements. We initially examine Java’s use of block scope. We then explain the various forms of the if statement; and conclude the chapter with both switch statements and switch expressions.

Chapter 5, Understanding Iteration, discusses loops, including while, do-while, for, and enhanced for. This chapter also explores the break and continue statements.

Chapter 6, Working with Arrays, describes why one needs arrays. We show how to declare and initialize arrays of various primitive types, including using the shorthand syntax. We discuss how to loop through an array, processing each element. Multi-dimensional arrays are also covered; as is the Arrays class.

Chapter 7, Methods, discusses the importance of methods and the difference between the method definition and method execution. Method overloading is discussed and the varargs format is explained. Lastly, the important concept of call-by-value is explained.

Chapter 8, Classes, Objects, and Enums, is a significant OOP chapter and details the following: the difference between classes and objects; the this reference; access modifiers; basic and advanced encapsulation; the object life cycle; the instanceof keyword; enums and records.

Chapter 9, Inheritance and Polymorphism, explains inheritance and polymorphism. We detail what overriding means and discuss the super, protected, abstract, and final keywords. We also explore sealed classes and upcasting/downcasting.

Chapter 10, Interfaces and Abstract Classes, covers both abstract classes and interfaces. We explain static, default, and private interface methods and also sealed interfaces.

Chapter 11, Dealing with Exceptions, explains exceptions and their purpose. We explain the difference between checked and unchecked exceptions. We delve into throwing exceptions and how to create your own custom exceptions. The important catch or declare principle is discussed; as are the try-catch, try-catch-finally, and try-with-resources blocks.

Chapter 12, Java Core API, introduces important classes/interfaces from the API, such as Scanner. We compare and contrast String and StringBuilder and discuss how to create a custom immutable type. We example the List interface and its popular implementation ArrayList. Lastly, we explore the Date API.

Chapter 13, Generics and Collections, discusses the collections framework and its interfaces List, Set, Map, and Queue. We examine several implementations of each and basic operations. We explain sorting using both the Comparable and Comparator interfaces. We finish by examining generics and basic hashing concepts.

Chapter 14, Lambda Expressions, explains what lambda expressions are and their relationship to functional interfaces. Several functional interfaces from the API are examined. Lastly, method references and the role of context in understanding them are outlined.

Chapter 15, Streams: Fundamentals, is our first chapter on streams. In this chapter, we discuss what a stream pipeline is and what stream laziness means. We show different ways to create both finite and infinite streams. We examine the terminal operations that start off the streaming process - including reductions such as collect() which is very useful for extracting information out of a stream.

Chapter 16, Streams: Advanced Concepts, starts by examining intermediate operations such as filter(), map(), and sorted(). We explore the primitive streams followed by how to map from one stream to another, regardless of type. The Optional type is explained and we conclude with a discussion of parallel streams.

Chapter 17, Concurrency, starts by explaining what concurrency is. We examine working with threads and present issues with concurrent access. Mechanisms to resolve these issues are discussed; namely: atomic classes, synchronized blocks, and the Lock interface. Concurrent collections and the ExecutorService are explored next. We finish with a discussion on threading problems such as data races, deadlock, and livelock.

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY