Java
          java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible.
Java is a high-level, language developed At Sun Microsystems, Inc. in 1991 by James Gosling, Patrick Naughton,
Chris Warth, Ed Frank, and Mike Sheridan as a project.
First working version development took 18 months.
Initially it was named as "Oak," this language was given the moniker "Java" in 1995.
Download IDE
          A software package known as an integrated development environment (IDE) combines the fundamental instruments needed to create and test software. During the writing, developing, and testing of software code, developers employ a variety of tools.
▶ Steps involved to download Eclipse IDE.
Step 1 :: Go through http://www.eclipse.org/downloads.
Step 2 :: Download executable Eclipse file
Step 3 :: Start the Eclipse Installer executable. ...
Step 4 :: Select the package to install. ...
Step 5 :: Select your installation folder. ...
Step 6 :: Launch Eclipse.
Download JDK :
The Java Development Kit is a distribution of Java Technology by Oracle Corporation. It is only feature of java which is platform dependent.Every platform has their different type of JDK .
▶ Steps involved to download JDK are as follows
Step 1 :: Go to the Oracle site and open the Java SE download page. Download JDK from the Site.
Step 2 :: Install the JDK exe File. ...
Step 3 :: Check the Directory. ...
Step 4 :: Update the Environment Variables. ...
Step 5 :: Verify the Java Installation.
Setup Environment Variable
▶ Steps to setup environment variabes:
1.Select Start >> Control Panel >> Select System and Security >> Advanced System settings >> Environment Variables >>
Click on New >> Add CLASSPATH as variable name and path of files as a variable value >> Select OK.
Compiling :
          The process of converting a high level language to machine level language using a compiler is refer to as compilation.During compilation all the program will be converted into binary code.After succesful compilation of program the binary code is loaded on ram and then it is executed.
Interpretition :
         The process of converting a high level language to machine level language using a interpreter is refer to as Interpretition. In the process of interpretition a single instruction from the program would be extracted converted into machine level language ,loaded and executed.This process goes on till the last line pf program is executed.
Features :
❖ Platform Independent :- { platform = OS + Processor }
          The most important feature of java is that it is platform independent ,which means the program can be written at one platform and executed on different platform.
( Java program can be written on Windows and can be executed on Linux.This concept is also called as (WORA) write once run anyware)
❖ Byte code :-
          Bytecode is a highly optimized set of instructions designed to be executed by the Java run-time system During compilation of java program first file which is generated is bite code.The fact that the output of a Java compiler is not executable code is the key that enables Java to handle both the security and portability challenges.Rather, it is bytecode.
❖ Object Oriented :-
          In Java, everything is an considered as objects. Using which one can easily solve real life problems.
❖ Secure :-
          Java is secure language because it has feature of access modifiers ,using which one can gve aor stop the access.
❖ Portable :-
          Java code can be executed on all the platforms hence it can be said as portable.
❖ Robust :-
          Java is very strong language ,it does not have pointers ,it also has feature of garbage collection.
❖ Multithreading :-
          Multithreading is the process of executing two or more threads simultaneously for maximum utilization of the CPU. A thread in Java is a lightweight process requiring fewer resources to create and share the process resources.
❖ Just-In-Time compiler :-
         java is very high performing language because it has just in time compiler.It is present in the JVM.
Program Syntax
          public class Program1 {
                    public static void main(String []args) {
                          System.out.println("Hello World");
                    }
          }
Class Syntax
          class Program2
                {
                }
Data Types
Java supports several types of data. You may use these types to declare variables and to create arrays.
Primitive
Java defines eight primitive types of data: byte, short, int, long, char, float, double, and boolean.
The primitive types are also commonly referred to as simple types. These can be put in four groups:
❖ Integers :: This group includes byte, short, int, and long, which are for whole-valued signed numbers.
❖ Floating-point numbers :: This group includes float and double, which represent numbers with fractional precision.
❖ Characters :: This group includes char, which represents symbols in a character set, like letters and numbers.
❖ Boolean :: This group includes boolean, which is a special type for representing true/false values
Non Primitive
There are five types of Non-Primitive data types in Java and they are classified as :
Class
Object
String
Array
Interface
Variables
The variable is the basic unit of storage in a Java program. Variables are entities which help us to identify the memory location in which the data is presented.
As a result of this variables are also refered as identifiers.
General Syntax of declaring a variable is shown below :
int a;
int b;
int c;
Local Variables
The variables which are declared with in a method are refered to as local variables.
Local variables are allocatedmemory once thecontrol enters the method.
Local variables are located memory on stack.
Local variables are deallocated memory once the controller leaves method.
Local variable cannot be used without initialization as they do not have a default initial value.
Instance Variables
Variable which are declared inside a class are refered to as Instance variable.
Instance variables are allocated memory on HEAP.
Instance variable can be used without initialization as they would have a default value.
Referance Variables
A reference variable allows you to retrieve the value of an object by pointing to an object of a specific class.
Control Statements
The code is run from top to bottom by the Java compiler.
The code's statements are carried out in the order that they appear.
However, Java has statements that can be used to manage how Java code is executed.
These sentences are referred to as control flow statements.
One of Java's core characteristics, it ensures a seamless flow of programmes.
Decision Making
There are two types of control statements in decision making.
1) If Statement
2) Switch Statement
Loop Statements
There are four types of loops in java namely:
a) while loop
b) do while loop
c) for loop
d) for-each loop
Jump Statements
There are two jump statements in Java:
a)break statement
b) continue statement
Arrays
The concept of variable can be used only if the amount of data to be handled is less.
In other words if the amount of data to be handled id huge the we cannot use concept of variables.Another major disadvantage of variable is that we cannot apply searching sorting algorithms on them.
In order to over come these disadvantages we need to use the concept of arrays. Java supports two types of arrays.
1) Rectangular
2) Jagged
An array is a group of like-typed variables that are referred to by a common name. Arrays of
any type can be created and may have one or more dimensions. A specific element in an
array is accessed by its index. Arrays offer a convenient means of grouping related
information
Rectanguar Arrays
A multidimentional array in which the number of column is equal to number of rows is said to be rectangular array.
A rectangular array of numbers is called a matrix.
Jagged Arrays
A multi-dimentional array in which the number of column is equal to number of rows is said to be rectangular array.
Strings
The String data type is used to declare string variables. You can also declare arrays of strings.
A quoted string constant can be assigned to a String variable. A variable of type String can
be assigned to another variable of type String. You can use an object of type String as an
argument to println( ).
There are two types of strings:
a) Immutable
b) Mutable
Immutable
The string is immutable means that we cannot change the object itself, but we can change the reference to the object.
The string is made final to not allow others to extend it and destroy its immutability.
Mutable
mutable strings are those strings whose content can be changed without creating a new object.
StringBuffer and StringBuilder are mutable versions of String in java. whereas Being practical there no such mutable string.
Methods
A method is a block of code which only runs when it is called. You can pass data, known as parameters, into a method.
Methods are used to perform certain actions, and they are also known as functions.
There are four types of methods:
❖ Accepts parameters & has return type
❖ Accepts parameters & no return type
❖ No parameters & has return type
❖ No parameters & no return type
Method overloading ::
In Java, it is possible to define two or more methods within the same class that share the
same name, as long as their parameter declarations are different. When this is the case,
the methods are said to be overloaded, and the process is referred to as method overloading.
Method overloading is one of the ways that Java supports polymorphism.
Type Casting
Type casting is when you assign a value of one primitive data type to another type.
In Java, there are two types of casting:
a)Widening Casting (automatically) - converting a smaller type to a larger type size
byte -> short -> char -> int -> long -> float -> double
b)Narrowing Casting (manually) - converting a larger type to a smaller size type
double -> float -> long -> int -> char -> short -> byte
Class
Java is an object-oriented programming language.
Everything in Java is associated with classes and objects, along with its attributes and methods.
For example: in real life, a car is an object. The car has attributes, such as weight and color, and methods, such as drive and brake.
A Class is like an object constructor, or a "blueprint" for creating objects.
Objects
In Java, an object is created from a class. We have already created the class named Main, so now we can use this to create objects.
To create an object of Main, specify the class name, followed by the object name, and use the keyword new.
Constructors
A constructor in Java is a special method that is used to initialize objects. T
he constructor is called when an object of a class is created. It can be used to set initial values for object attributes.
In Java, a constructor is a block of codes similar to the method.
It is called when an instance of the class is created. At the time of calling the constructor,
memory for the object is allocated in the memory. It is a special type of method which is used to initialize the object.
Every time an object is created using the new() keyword, at least one constructor is called.
Non Parameterized
A constructor that has no parameter is known as the default constructor.
If we don’t define a constructor in a class, then the compiler creates a default constructor(with no arguments) for the class.
And if we write a constructor with arguments or no arguments then the compiler does not create a default constructor.
Parameterized
A constructor that has parameters is known as parameterized constructor.
If we want to initialize fields of the class with our own values, then use a parameterized constructor.
Object Oriented Programming
The process of providing solution to a problem keeping object as the basis is refer to as Object Orientation.
The concept of object oriented programming are as follows:
1) Class.
2) Object.
3) Method and method passing.
4) Pillars of OOPs.
a) Encapsulation.
b) Inheritance.
c) Polymorphism.
Encapsulation
The process of providing controlled access to the private members of a class using accessors & mutators is refered to as encapsulation.
Encapsulation does not refer to data hiding.
Encapsulation is as a protective wrapper that prevents the code and data from being arbitrarily accessed by
other code defined outside the wrapper. Access to the code and data inside the wrapper is
tightly controlled through a well-defined interface
Inheritance
Inheritance is the process by which one object acquires the properties of another object. This
is important because it supports the concept of hierarchical classification. As mentioned
earlier, most knowledge is made manageable by hierarchical (that is, top-down) classifications.
by use of inheritance,
an object need only define those qualities that make it unique within its class. It can inherit
its general attributes from its parent. Thus, it is the inheritance mechanism that makes it
possible for one object to be a specific instance of a more general case.
          class Program2
                {
                }
Polymorphism
Polymorphism means "many forms", and it occurs when we have many classes that are related to each other by inheritance.
In Java polymorphism is mainly divided into two types:
a) Compile-time Polymorphism.
b) Runtime Polymorphism
Blocks
A block in Java is a set of code enclosed within curly braces { } within any class, method, or constructor.
It begins with an opening brace ( { ) and ends with an closing braces ( } ).
Between the opening and closing braces, we can write codes which may be a group of one or more statements.
Java supports two types of blocks
a) Static Block
b) Non static block
a) Static Block
The block in which the static keyword is used is said to be static block.static block gets executed only once and
it gets executed as the class gets loaded on ram.
          static
                {
                }
b) Non static block
The block which does not contain static keyword is said to be non static block.
The Non-static blocks are automatically called by the JVM for every object creation in the java stack area.
         
                {
                }
Abstract Class
A method which does not have a implimentation is refer to as abstract method. A class which contains atleast one abstract method is said to be as an abstract class.
Interface
An interface in the Java programming language is an abstract type that is used to describe a behavior that classes must implement. Interfaces of collection of abstract methods.
▶ Some features of interfaces are listed below.
❖An object of interface cannot be created.
❖A referance of interface can be created.
❖Two interfaces can be related using extends keyword.
❖A class and interface cannot be related using extends keyword.
❖A class and interface can be related using implements keyword.
❖A class implementing an interface must provide the implementation for all methods in interface.
❖ The class implementing the method must under public category as all methods in interface by default are under public category.
❖At any point of timea method implementation cannot be provided within an interface.
          interface interface.name
                {
                        returntype method.name(para);
                        returntype method2.name(para);
                }
Exceptions
Define
It is an unwanted event that occurs during the execution of program.The mistakes that took place during the execution of java program which can be handled is said to be exceptions.
If the exceptions are not handled then the program would terminate abnormally.In order to handle the exceptions java provides the try & catch blocks as these elements(try & catch) helps us to handle exceptions they are refered to as exception handling mechanism.
When an exception occurs JVM would collect the mistake details bundle these details into an objects & throw the object to the program.Using try and catch block the exception object should be handled.
There are two types of exceptions.
a)Checked Exceptions
b)Unchecked Exceptions
Checked Exceptions
Checked exception is something that has gone wrong in your code and is potentially recoverable .The are the mistakes outside the control of the program
For example, the java.io.IOException is a checked exception.
Unchecked Exception
Unchecked exception is something that has gone wrong in your code and is potentially recoverable .
For example, the ArithmeticException is a checked exception.
Try&Catch
Try & Catch is the basic and the easiest way to handle the exceptions.Inside the try block code is written which is supposed to have some exception ,
if the written code has any exception then it is thrown in the form of object and that object is caught by the catch block where it is mentioned how statements used to handle the exceptions.
Throws
Throwable
Threading
Multi Threading
Collection