
eBook - ePub
100+ Solutions in Java
A Hands-On Introduction to Programming in Java: A Hands-On Introduction to Programming in Java (English Edition)
- English
- ePUB (mobile friendly)
- Available on iOS & Android
eBook - ePub
100+ Solutions in Java
A Hands-On Introduction to Programming in Java: A Hands-On Introduction to Programming in Java (English Edition)
About this book
A step by step guide that will help you learn the Java programming language Key Features
- Get familiar with the features in Java 8 And Java 9
- Understand the working of various Java APIs
- Learn Modular Programming with Java 9
- Learn to use features such as Lambda, Time API, and Stream API.
- Learn how to access databases from a Java application
- Description
100+ Solutions in Java is an easy-to-understand step-by-step guide that helps you develop applications using Java 8 and Java 9. It is for everyone, from beginners to professionals, who wish to begin development in Java. The content is designed as per increasing complexity and is explained in detail with appropriate examples. This book follows a practical approach by providing ample examples and assignments for you to test your understanding of each concept. You will also get familiar with the important features introduced in Java 10. This book is a "beginner's guide" that will help you upskill your knowledge in Java. By the end of the book, you will know the different features introduced in Java over the years and will learn to implement these features to develop real-world applications. What will you learn
- Work with the newly introduced features in Java 8 And Java 9
- Get to know in-depth about the Java Stream API
- Learn how to work with Java regular expressions
- Get an overview of Inheritance and Interfaces in Java
- Get familiar with Design Patterns in Java
- Who this book is for
This book is for Developers and Technical Specialists who are interested in learning Java. Prior knowledge of programming languages such as C, C++, or Python and any DBMS such as SQL Server, MySQL will be an added advantage. Table of Contents
1. Introduction to Java
2. Java Programming Constructs
3. Iris Species
4. Java Application Components
5. Subclasses and Interfaces
6. Exceptions and Regular Expressions
7. Collections and Stream API
8. Generics and Time API
9. File Manipulation in Java
10. Threads and JDBC
11. Design Patterns and I18N
12. More about JDK 8, 9 and 10 About the Author
Dhruti Shah is a multi-skilled, tech savvy person with over 15 years of experience as a software trainer, technical writer, and manager in the IT education industry. She has been working extensively with Java technology for the last 10 years. She is a Microsoft Certified Training Specialist who has trained over 2000 candidates worldwide on more than 10 technologies.She has been appreciated as a model representative for India for flawlessly managing two prestigious International projects to set up and upgrade the Centre of Excellence in Information Technology in Panama and Costa Rica, Central America (a collaboration project of the Indian government with the governments of Panama and Costa Rica). LinkedIn Profile: https://www.linkedin.com/in/dhruti-shah-a24ba148/
Frequently asked questions
Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Perlego offers two plans: Essential and Complete
- Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
- Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access 100+ Solutions in Java by Dhruti Shah,DHRUTI SHAH in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in Java. We have over one million books available in our catalogue for you to explore.
Information
CHAPTER 1
Introduction to Java
This chapter introduces the concept of object-oriented programming and explains how Java has evolved as an object-oriented programming (OOP) language. You will learn about the various versions and features of Java and the steps to install a Java Development Kit (JDK). You will also learn to create an application by using JDK 8 and JDK 10.
Structure
- Introduction to object-oriented programming
- Java programming language
- Java platform and editions
- Java SE platform components
- Java SE version history
- Features of Java SE 9 and Java SE 10
- Downloading and Installing JDK 8 and JDK 10
- Setting up the path for JDK
- Java application development
- Structure of a Java program
- Java code compilation and execution
- Creating and executing a Java program using JDK 8
- Creating and Installing a Java program using JDK 10
- Creating and executing a Java 8 project in NetBeans
- Creating and executing a Java 10 project in NetBeans
Objectives
- Learn the concept of object-oriented programming
- Learn to download and install JDK 8 and JDK 10
- Understand the structure of a Java program
- Learn to develop a Java project in NetBeans
1.1 Introduction to object-oriented programming
With the advancement in technology and the increasing complexity of software, a requirement of new and flexible modes of programming was observed. A need to make reliable software, reduce the overall development and maintenance cost, and deliver the software within timelines, resulted in the development of the object-oriented programming model.
The primary focus of object-oriented programming is on objects. Any real-world entity that has certain characteristics and behavior that can be used to describe it is considered as an object. There are several objects that have certain common characteristics. These can be grouped into categories or classes. Thereby, every object of a class will be considered as an instance of that class. Programmatically, a class is a structure that contains the data (characteristics) and methods (behavior) to work on that data.
For example, a class
Vehicle can have characteristics such as color and type, and behavior such as start, stop, accelerate, etc. The following image shows a Unified Modeling Language (UML) class diagram representation of the Vehicle class:
Figure 1.1: Class Diagram
Here, the Fields represent the characteristics and Methods represent the behavior of the object. The
Vehicle class can then have instances of types of vehicles such as bike, bicycle, car, etc. This is explained in detail in the following image:
Figure 1.2: Object of Vehicle Class
Here, the object bike has the characteristics
color=blue and type=motorcycle with the behavior, including start, stop, and accelerate. Similarly, there can be other instances of the Vehicle class such as car, bicycle, etc. with the same or different values for characteristics and similar behavior.An object-oriented programming language is based on the following principles:
- Encapsulation: To encapsulate means to enclose. Hence, encapsulation allows you to enclose the data members and methods into a closed structure called a class. Encapsulation ensures data security through data hiding so that a user cannot access the members of a class directly.
- Abstraction: Abstraction is a programming concept in which the non-essential details of an entity are hidden from user view. For example, in the case of a washing machine, the user only presses the button on a digital panel to set up the process and start the machine. However, the internal functioning of the washing machine is not known to the user. This means that the non-essential aspect of how the washing machine washes the clothes is abstracted from the user. Similarly, abstraction can also be implemented in code to hide the unnecessary details from the user.
- Inheritance: To inherit means to acquire some feature or asset from an ancestor. For example, a child acquires certain aspects of physical appearance and certain behavior of his/her biological parents. In programming also, inheritance plays a similar role. It allows us to combine the common characteristics and behavior of objects into a parent class also called a superclass. This class can then be inherited by other classes that allow a developer to extend and reuse the feature of existing classes. The new/inherited classes are called child classes, derived classes, or subclasses.
- Polymorphism: Polymorph is a combination of words poly which means many and morph which means forms. This polymorph is an object that can have multiple forms/behaviors? For example, a chameleon can change its color as per the environment to protect itself from predators. In programming, polymorphism is the ability of an object to behave in different ways based on requirements. Polymorphism can be implemented in several ways in programming based on the programming language used.
1.2 Java programming language
Java is a popular object-oriented, platform-independent programming language. It allows you to develop a variety of applications that can run on different hardware and operating systems. Java also provides a runtime environment for executing Java applications on different devices.
Java was originally developed in 1991 by James Gosling and a team of engineers at Sun Microsystems which was later acquired by Oracle Corporation. It was initially designed for consumer devices such as washing machines, televisions, etc. For such devices, it was necessary to have a language that was small, efficient, fast, and platform-independent. Languages such as C and C++ were not preferred due to the compiler’s dependence on specific CPUs and also high development time and cost. Thus, Java was developed as a portable and platform-independent language that could execute code on any platform. Initially, it was named Oak but later renamed to Java.
Even though Java was developed to cate...
Table of contents
- Cover Page
- Title Page
- Copyright Page
- Dedication Page
- About the Author
- Acknowledgement
- Preface
- Errata
- Table of Contents
- 1. Introduction to Java
- 2. Java Programming Constructs
- 3. Java Application Components
- 4. Java Reference Types
- 5. Subclasses and Interfaces
- 6. Exceptions and Regular Expressions
- 7. Collections and Stream API
- 8. Generics and Time API
- 9. File Manipulation in Java
- 10. Threads and JDBC
- 11. Design Patterns and Internationalization
- 12. More About JDK 8, 9, and 10
- Index