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

Exercises

And that’s all theory for this chapter! So, roll up those sleeves, and let’s dive into your first day at Mesozoic Eden. Welcome aboard! Mesozoic Eden is a famous zoo where dinosaurs live that have been brought to live with high end genetic manipulation techniques. Here are some exercises for you to test your knowledge so far:

  1. Your first task involves welcoming our guests. Modify the following code snippet so that it outputs "Welcome to Mesozoic Eden":
    public class Main {
        public static void main(String[] args) {
            System.out.println("Hello world");
        }
    }
  2. Complete the following programs by filling out the blanks so that it prints out your name and the position you want to have in Mesozoic Eden 5 years from now:
    public class Main {
        public static void main(String[] args) {
            __________________________;
            String position = "Park Manager";
            System.out.println("My name is " + name + "
              and I want to be a " ______ " in Mesozoic
                Eden.");
        }
    }
  3. We’ve received some questions about opening hours. Complete the following program so that it prints the park’s opening and closing hours:
    public class Main {
        public static void main(String[] args) {
            String openingHours = "08:00";
            String closingHours = "20:00";
        }
    }
  4. Create a Java project with a package named dinosaur. You can create a package by right-clicking on the src/main/java folder, selecting “new” and choosing “package”.
  5. Modify the code from exercise 1 so that it prints out "Welcome, [YourName] to Mesozoic Eden!", where [YourName] is replaced by, surprise surprise, your name. Bonus: try to create a separate String variable as shown in the second and third exercises.
  6. Some guests reported feeling unsafe near the T-Rex. Let’s solve this by adding another System.out.println to the program of exercise 5. It should print the phrase "Mesozoic Eden is safe and secure." after the welcome message.

Create a Note

Modal Close icon
You need to login to use this feature.
notes
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

Delete Note

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

Edit Note

Modal Close icon
Write a note (max 255 characters)
Cancel
Update Note

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