Java: The Complete Reference, Ninth Edition (INKLING CH) - Learn Java Programming from Scratch with this Comprehensive Guide
Java: The Complete Reference, Ninth Edition (INKLING CH) free download
Are you looking for a comprehensive guide to learn Java programming from scratch? Do you want to master the fundamentals and advanced features of one of the most popular and versatile programming languages in the world? Do you want to access a digital version of the best-selling book on Java for free? If you answered yes to any of these questions, then this article is for you.
Java: The Complete Reference, Ninth Edition (INKLING CH) free download
In this article, you will learn what Java is, what INKLING CH is, why you should read this book, how to download it for free, and what you will learn from it. By the end of this article, you will have a clear understanding of how to start your journey as a Java developer with the help of this book.
What is Java?
Java is a general-purpose, object-oriented, high-level programming language that was created by James Gosling at Sun Microsystems in 1995. It is widely used for developing applications for various platforms, such as desktops, web servers, mobile devices, embedded systems, and more. Java is known for its portability, performance, security, simplicity, and compatibility. Some of the features that make Java unique are:
It is compiled and interpreted. This means that Java source code is first converted into bytecode by a compiler, which can then be executed by a virtual machine (JVM) on any platform that supports it.
It is platform-independent. This means that Java programs can run on any platform that has a JVM installed, without requiring any changes in the source code or recompilation.
It is object-oriented. This means that Java follows the principles of encapsulation, inheritance, polymorphism, and abstraction, which allow for creating reusable and modular code that can be easily extended and maintained.
It is multithreaded. This means that Java supports concurrency, which allows for creating multiple threads of execution that can run simultaneously and share resources.
It is robust and secure. This means that Java has features such as exception handling, garbage collection, memory management, access control, and encryption, which prevent errors, memory leaks, and security breaches.
Java is one of the most popular and widely used programming languages in the world, with millions of developers and billions of devices running Java applications. Some of the applications that are powered by Java are:
Android apps. Java is the official language for developing apps for the Android operating system, which is the most widely used mobile platform in the world.
Web applications. Java is used for creating dynamic and interactive web applications using frameworks such as Spring, Hibernate, Struts, JSF, and more.
Enterprise applications. Java is used for developing large-scale and complex applications for businesses and organizations using technologies such as Java EE, EJB, JMS, JPA, and more.
Desktop applications. Java is used for creating graphical user interfaces (GUI) and standalone applications for desktops using libraries such as Swing, AWT, JavaFX, and more.
Scientific applications. Java is used for performing numerical computations, data analysis, machine learning, artificial intelligence, and more using libraries such as Apache Commons Math, Weka, Deeplearning4j, and more.
What is INKLING CH?
INKLING CH is a digital platform that provides access to thousands of books and courses on various topics, such as programming, business, design, health, and more. INKLING CH allows you to read books online or offline on any device, such as laptops, tablets, smartphones, and e-readers. INKLING CH also offers features such as:
Interactive learning. INKLING CH books and courses have interactive elements such as quizzes, videos, animations, simulations, and more that enhance your learning experience and retention.
Personalized learning. INKLING CH allows you to customize your learning path by choosing the topics you want to learn, the pace you want to follow, and the goals you want to achieve.
Social learning. INKLING CH allows you to connect with other learners and instructors through forums, chats, groups, and more. You can also share your notes, highlights, bookmarks, and progress with others.
Smart learning. INKLING CH uses artificial intelligence and machine learning to provide you with personalized recommendations, feedback, insights, and analytics that help you improve your learning outcomes.
INKLING CH is a great way to learn new skills or improve your existing ones at your own convenience and pace. You can access INKLING CH from any device with an internet connection or download the books and courses for offline reading.
Why should you read this book?
If you want to learn Java programming from scratch or improve your existing skills, then this book is for you. Java: The Complete Reference, Ninth Edition (INKLING CH) is the definitive guide to Java programming that covers all aspects of the language from the basics to the advanced features. This book is written by Herbert Schildt, one of the world's leading authorities on Java and author of several best-selling books on the topic. This book will teach you how to:
Create applications for various platforms using Java
Use the core features of the Java language such as data types, variables, operators, control statements, classes, methods, inheritance, packages, interfaces, and exception handling
Use the standard libraries of the Java platform such as java.lang, java.util, java.io, java.net, java.awt, java.applet, and more
Create multithreaded programs that can run concurrently and share resources
Create applets that can run on web browsers and interact with web pages
Create graphical user interfaces (GUI) using Swing, AWT, and JavaFX
Create web applications using servlets, JSP, and JDBC
Create enterprise applications using EJB, JMS, JPA, and JAX-WS
Create mobile applications using Android SDK
Create scientific applications using Apache Commons Math, eka, Deeplearning4j, and more
This book is updated to cover the latest features of Java 8, such as lambda expressions, streams, default methods, functional interfaces, and more. This book also includes hundreds of examples, exercises, and projects that illustrate the concepts and techniques of Java programming. This book is suitable for beginners and experienced programmers alike, as it covers both the fundamentals and the advanced topics of Java.
How to download Java: The Complete Reference, Ninth Edition (INKLING CH) for free
If you want to download this book for free, you can follow these simple steps:
Visit the official website of INKLING CH at https://www.inkling.com/.
Create an account or log in with your existing one. You can also use your Google or Facebook account to sign up or log in.
Search for the book title or ISBN in the search bar. The ISBN of this book is 978-0-07-180855-2.
Add the book to your library and start reading. You can also download the book for offline reading on any device.
That's it! You have successfully downloaded Java: The Complete Reference, Ninth Edition (INKLING CH) for free. You can now enjoy reading this book and learning Java programming at your own pace.
What you will learn from Java: The Complete Reference, Ninth Edition (INKLING CH)
This book is divided into five parts, each covering a different aspect of Java programming. Here is an overview of what you will learn from each part:
Part I: The Java Language
This part covers the core features of the Java language, such as data types, variables, operators, control statements, classes, methods, inheritance, packages, interfaces, and exception handling. You will learn how to create and use objects, how to implement polymorphism and abstraction, how to organize your code into modules, how to handle errors and exceptions, and more. This part also introduces some of the new features of Java 8, such as lambda expressions, streams, default methods, functional interfaces, and more.
Part II: The Java Library
This part covers the standard libraries of the Java platform, such as java.lang, java.util, java.io, java.net, java.awt, java.applet, and more. You will learn how to use these libraries to perform various tasks, such as string handling, collections framework, input/output operations, networking and internet programming, graphical user interface (GUI) development, applet creation and execution, and more. This part also includes a comparison of java.util classes and their features.
A comparison of java.util classes and their features
ClassDescriptionFeatures
ArrayListA resizable array that implements the List interfaceRandom access, fast iteration and traversal, dynamic resizing
LinkedListA doubly-linked list that implements the List and Deque interfacesFast insertion and deletion at both ends, sequential access
VectorA synchronized resizable array that implements the List interfaceRandom access, thread-safe, dynamic resizing
StackA subclass of Vector that implements a last-in-first-out (LIFO) data structurePush and pop operations at one end only
HashSetA hash table that implements the Set interfaceNo duplicate elements allowed, fast lookup and insertion using hashing function
, fast lookup and insertion using hashing function, predictable iteration order
TreeSetA balanced binary tree that implements the SortedSet interfaceNo duplicate elements allowed, sorted order of elements, fast lookup and insertion using tree structure
HashMapA hash table that implements the Map interfaceKey-value pairs, no duplicate keys allowed, fast lookup and insertion using hashing function
LinkedHashMapA subclass of HashMap that maintains a linked list of the entries in insertion orderKey-value pairs, no duplicate keys allowed, fast lookup and insertion using hashing function, predictable iteration order
TreeMapA balanced binary tree that implements the SortedMap interfaceKey-value pairs, no duplicate keys allowed, sorted order of keys, fast lookup and insertion using tree structure
PriorityQueueA priority heap that implements the Queue interfaceElements ordered by priority, first-in-first-out (FIFO) data structure, fast insertion and removal of the highest priority element
ArrayDequeA resizable array that implements the Deque interfaceFirst-in-first-out (FIFO) or last-in-first-out (LIFO) data structure, fast insertion and deletion at both ends
Part III: Input/Output, Networking, and the Internet
This part covers the input/output (I/O), networking, and internet programming features of Java. You will learn how to use streams and buffers to read and write data from various sources and destinations, such as files, consoles, sockets, URLs, and more. You will also learn how to use sockets and URLs to create network applications that can communicate over TCP/IP or HTTP protocols. You will also learn how to use applets to create web applications that can run on web browsers and interact with web pages.
How to use streams and buffers in Java I/O
A stream is an abstraction that represents a sequence of data that can be read from or written to. A buffer is a memory area that stores data temporarily before or after it is transferred to or from a stream. Java provides various classes for handling streams and buffers in the java.io package. Some of the common classes are:
InputStream and OutputStream: These are abstract classes that represent byte streams that can read or write bytes of data.
Reader and Writer: These are abstract classes that represent character streams that can read or write characters of data.
FileInputStream and FileOutputStream: These are subclasses of InputStream and OutputStream that read or write bytes of data from or to a file.
FileReader and FileWriter: These are subclasses of Reader and Writer that read or write characters of data from or to a file.
BufferedInputStream and BufferedOutputStream: These are subclasses of InputStream and OutputStream that use buffers to improve the performance of reading or writing bytes of data.
BufferedReader and BufferedWriter: These are subclasses of Reader and Writer that use buffers to improve the performance of reading or writing characters of data.
DataInputStream and DataOutputStream: These are subclasses of InputStream and OutputStream that can read or write primitive data types and strings in a binary format.
ObjectInputStream and ObjectOutputStream: These are subclasses of InputStream and OutputStream that can read or write objects in a serialized format.
PrintStream and PrintWriter: These are subclasses of OutputStream and Writer that can print formatted data to a stream.
Scanner: This is a class that can parse text data from a stream using regular expressions.
The following code snippet shows an example of reading and writing files using streams and buffers in Java:
```java //Import the necessary classes import java.io.*; //Create a class with a main method public class FileIOExample public static void main(String[] args) //Declare variables for input and output streams FileInputStream fis = null; FileOutputStream fos = null; BufferedInputStream bis = null; BufferedOutputStream bos = null; try //Create input and output streams for reading and writing files fis = new FileInputStream("input.txt"); fos = new FileOutputStream("output.txt"); //Create buffered streams for improving performance bis = new BufferedInputStream(fis); bos = new BufferedOutputStream(fos); //Declare a variable for storing a byte of data int b; //Read a byte of data from the input stream until the end of the stream is reached while ((b = bis.read()) != -1) //Write the byte of data to the output stream bos.write(b); //Flush the output stream to ensure all data is written bos.flush(); //Print a message to indicate success System.out.println("File copied successfully."); catch (IOException e) //Handle any I/O exceptions e.printStackTrace(); finally //Close the streams in a finally block to ensure they are closed even if an exception occurs try if (bis != null) bis.close(); if (bos != null) bos.close(); if (fis != null) fis.close(); if (fos != null) fos.close(); catch (IOException e) //Handle any I/O exceptions e.printStackTrace(); ``` Part IV: Concurrency
This part covers the concurrency features of Java, such as multithreading, synchronization, locks, atomic variables, and executors. You will learn how to create and manage threads that can run concurrently and share resources. You will also learn how to use synchronization techniques to prevent data inconsistency and deadlock problems. You will also learn how to use advanced concurrency tools such as locks, atomic variables, and executors to improve the performance and scalability of your multithreaded programs.
How to create and manage threads in Java
A thread is a lightweight process that can run independently and concurrently with other threads. Java supports multithreading, which means that multiple threads can run simultaneously within a single program. Java provides two ways to create threads:
Implementing the Runnable interface: This involves creating a class that implements the Runnable interface and overriding its run() method. The run() method contains the code that the thread will execute. To create a thread using this approach, you need to create an instance of the class and pass it to the constructor of the Thread class. Then, you can call the start() method of the Thread class to start the thread.
Extending the Thread class: This involves creating a subclass of the Thread class and overriding its run() method. The run() method contains the code that the thread will execute. To create a thread using this approach, you need to create an instance of the subclass and call its start() method to start the thread.
The following code snippet shows an example of creating and running threads using both approaches in Java:
```java //Import the necessary class import java.lang.Thread; //Create a class that implements the Runnable interface class MyRunnable implements Runnable //Override the run() method @Override public void run() //Print a message with the name of the current thread System.out.println("Hello from " + Thread.currentThread().getName()); //Create a class that extends the Thread class class MyThread extends Thread //Override the run() method @Override public void run() //Print a message with the name of the current thread System.out.println("Hello from " + Thread.currentThread().getName()); //Create a class with a main method public class ThreadExample public static void main(String[] args) //Create an instance of MyRunnable and pass it to the constructor of Thread Thread t1 = new Thread(new MyRunnable()); //Set the name of t1 t1.setName("Runnable Thread"); //Start t1 t1.start(); //Create an instance of MyThread Thread t2 = new MyThread(); //Set the name of t2 t2.setName("Thread Subclass"); //Start t2 t2.start(); //Print a message with the name of the main thread System.out.println("Hello from " + Thread.currentThread().getName()); ``` Part V: The Applet Class
This part covers the applet features of Java, such as applet creation, execution, lifecycle, parameters, graphics, events, and more. You will learn how to create applets that can run on web browsers and interact with web pages. You will also learn how to use graphics and events to create dynamic and interactive applets.
How to create and run applets in Java
a web page. Java provides the Applet class in the java.applet package to create applets. To create an applet, you need to do the following steps:
Create a subclass of the Applet class and override its methods. The Applet class has four methods that define the lifecycle of an applet: init(), start(), stop(), and destroy(). The init() method is called when the applet is loaded, the start() method is called when the applet is started, the stop() method is called when the applet is stopped, and the destroy() method is called when the applet is unloaded. You can also override the paint() method to draw graphics on the applet.
Create an HTML file that contains an tag or an tag that specifies the name, size, and parameters of the applet. The tag has attributes such as code, width, height, and param. The code attribute specifies the name of the applet class file, the width and height attributes specify the size of the applet in pixels, and the pa