Classes in Java
There are some kind of errors that might occur during the execution of the program. An exception is an event that occurs and interrupts the normal flow of instructions. That is exceptions are objects that store the information about the occurrence of errors. When any kind of error or unusual condition occurs, these exceptions are being thrown. Any exception used to occur earlier always resulted in a program crash. However, some programming languages like java have mechanisms for handling exceptions. This is known as catching exception in Java. The exceptions that occur in the program can be caught using try and catch block. Remember, the program will crash if the exception would not be caught. There are three types of exceptions in Java. These are -:
1. Checked Exceptions
2. The error
3. Runtime exception
Error and Runtime exceptions are known as unchecked exceptions. This chapter covers how to throw an exception and catch it. A detailed explanation on the types of exceptions and the advantages of the exceptions.
In this section we will learn about basic input and out put operations in Java. Different kinds of sources and destinations are represented by a Stream like disk files, devices, memory arrays etc. A Stream is a sequence of data. An Input Stream is used by the program to read data from the source. Similarly, a program uses an Output stream to write data to a destination. It also supports different kinds of data including simple bytes, primitive data types, objects etc. We will learn about I/O Steams and how to use them.
Concurrency is generally used to perform multiple tasks simultaneously. In this section we will learn how to write applications to perform multitasking. There are two types of units of execution process and threads. Thread is the most important unit in concurrent programming. There are many processes and threads which are active in a computer system. However only one threads executes at a time even in systems that only have a single execution core.
The set of strings which are based on common characteristics are shared by each string in the set. Basically, Regular expressions are are a set of strings.
This regular expression as a Java string, becomes "\\\\". That is 4 backslashes to match a single one. As in literal Java strings the backslash is an escape character. The literal string as a single backslash is denoted by "\\". In this chapter we will learn to create a syntax for regular expressions and how to use them.