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

do-while loops

As we have seen with the while loop, the boolean loop continuation expression is at the start of the loop. Though similar to the while loop, the do-while loop is different in one critical aspect: in the do-while loop, the loop continuation expression is at the end of the loop. Thus, the do-while loop is executed at least once. More formally, a do-while loop executes one or more times.

Figure 5.4 presents the syntax of the do-while loop.

Figure 5.4 – The do-while loop syntax

Figure 5.4 – The do-while loop syntax

As can be seen in the preceding figure, the loop continuation expression is at the end of the loop, after one loop iteration. Also note the semi-colon, ; after ).

Figure 5.5 presents a do-while version of the while loop in Figure 5.2.

Figure 5.5 – A do-while loop that ends based on user input

Figure 5.5 – A do-while loop that ends based on user input

In the preceding figure, the only differences with Figure 5.2 are lines 21 and 30. On line 21, we simply enter the loop as, unlike...

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