Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Java Programming for Beginners

You're reading from   Java Programming for Beginners Learn the fundamentals of programming with Java

Arrow left icon
Product type Paperback
Published in Oct 2017
Publisher Packt
ISBN-13 9781788296298
Length 318 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
SkillSprints Inc., Mark Lassoff SkillSprints Inc., Mark Lassoff
Author Profile Icon SkillSprints Inc., Mark Lassoff
SkillSprints Inc., Mark Lassoff
Arrow right icon
View More author details
Toc

What this book covers

Chapter 1, Getting Started with Java, teaches you what Java is and shows its features. We will see the vastness of Java's application by looking at various fields it is used in. We will walk through the steps to install the Java Development Kit. We will then set up a development environment called NetBeans for writing Java programs, and execute these programs. We'll also see how to use NetBeans and write our first Java program in it. You'll also learn to use NetBeans to detect errors and rectify them.

Chapter 2, Understanding Typed Variables, shows what variables are and how they are important for creating better programs. We'll look at some of the primitive data types of Java, int, long, float, char, and double, in detail. You'll also learn about the String class and two of its manipulation methods.

Chapter 3, Branching, basically portrays how to work with conditional if...else statements, running through complex conditionals using functions such as contains, complex, and boolean. We will go through the intricacies of switch, case, and break with the help of programs; we'll also deep dive into using loop functionality with while, do...while, and for loops.

Chapter 4, Data Structures, discusses arrays and presents an example that prints the English alphabet using an array. Then, we'll take a look at multidimensional arrays and write a program that creates a two-dimensional chess board. We'll walk through what ArrayList is and how it enhances the functionality of arrays. We'll write a program using ArrayList with functionality that would have been quite difficult to implement using an array. Finally, you'll learn about Maps and implement an example to understand them better.

Chapter 5, Functions, helps you to start with some of the basic Java functions, such as methods, and then move on to understanding you advanced Java functions. As you become a more experienced programmer, you'll begin to internalize concepts like these and you won't have to really think about them explicitly when you're writing day-to-day code. For now though, there are some logical shortcuts that we can use to keep from getting too tripped up.

Chapter 6, Modeling with Object-Oriented Java, teaches how to create classes and objects in Java. We will also walk through creating custom classes, member variables, and member functions. We will also look into a very special member assigned to our custom classes, the constructor, and types of constructor.

Chapter 7, More Object-Oriented Java, reveals some intricacies of object-oriented programming, precisely, those using the concept of Inheritance, by creating something called as superclass and subclass, and establishing an is-a relationship between them. You'll learn how to use key aspects such as overriding subclass and super class, data structures, and the Protected method. We also get to know how an abstract method works, in detail.

Chapter 8, Useful Java Classes, presents the Calendar class, which is used to work with dates and times. You will learn about the String class in detail. We'll also see what exceptions are and how to handle them to make our programs more robust. Then, we will walk through the Object class and some of its methods. Finally, we will take a look at primitive classes in Java.

Chapter 9, File Input and Output, walks you through the concept of writing and reading data files, where we'll see the usage of the FileWriter and FileReader classes and learn to free up resources using the close () method. You'll also learn to catch an exception and handle it. Then, we'll see how to use the BufferedWriter and BufferedReader classes to wrap the FileWriter and FileReader classes, respectively. Lastly, we will talk about one more aspect of I/O, the Serializable class. We will analyze what serialization is and its use with respect to serializing and deserializing objects.

Chapter 10, Basic GUI Development, shows the basic functions of the GUI in NetBeans. We will learn how to create an application window with the jFrame class by setting its size, adding labels to it, and closing our application. Then we'll talk about the working of palette and components available in it. Lastly, we'll learn about triggering events by adding a button and adding functionality to it.

Chapter 11, XML, explains the Java code to read an XML file into a Document object. You'll also learn how to parse XML data using Java. Finally, you'll learn how to write and modify XML data in Java.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image