Search for notes by fellow students, in your own course and all over the country.

Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.

My Basket

3 Types of Cloud Computing£1.50

Title: Complete Core Java
Description: This PDF has the complete explanation of Core Java. You can find all your java related queries in this pdf with questions and answers section in each topic. You can also find practical examples and explanation using diagrams in this PDF. This PDF can be of much useful for you.

Document Preview

Extracts from the notes are below, to see the PDF you'll receive please use the links above


Theory

http://www
...
com/virtim/index
...


Print

Core Java
* Java is an Object Oriented Programming language
...


Compilation process of C/C++ & Java

For Java

* Java is given by sun Micro-systems
...


Problem with C/C++
* It will compile for specific platform
...
S
...

* Developing compiler is complex and expensive task
...
But in
the case of java you need to convert byte code to machine code then you can execute
...
exe”
...

* Compiler is responsible to check system or grammatical error of the program
...

1 of 85

2/1/2016 7:45 AM

Theory

http://www
...
com/virtim/index
...


Q-> what is java Interpreter?

Java interpreter is a single program written in C/C++ with the name java
...

* It will convert the class file into native code line by line
...


Q-> what is JIT Compiler?
* It stands for (Just In Time)
...
exe
...


* Due to converting the code line by line using java interpreter java execution is slower in initial version of java
...


Q-> what is JRE?
* JRE stands for (Java Runtime Environment)
...


* JRE is contents collection of library and API which will help you to run your java program
...

* Example of tools
...
exe, javac
...
exe, javaw
...
out
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...
)

2> Keywords:
Keywords are the predefine words whose meaning is define by language developer that can’t be changed
...

* Enum

* Annotation ( these keywords use in lower case
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...

While choosing the user define words you have to follow following rules:-

* User define words can content any alphabet digit and only two special symbol that is underscore and $
...

* You can’t start user define word with digit
...

* You can’t used space any user define words
...


There are two types of data types:* Primitive data types

* User define data types

Primitive data types:-

User define data types:There are two types of user define data types
Class type and interface type

5> Variable:
Variable is the name of memory location where you can store some value
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...


Above two variable a,b declared with primitive data type so, a and b is called as primitive variable
...


Q-> Difference between primitive and reference variable?
Primitive variable:

* Variable declared with primitive data types is called primitive variable
...

* Default value of primitive variable assign according to data type used
...

Reference variable:

* Variable declared with user define data types is called reference variable
* Always 8 byte memory will be allocated reference variable
* Null will be assigned a reference variable as a default

* Reference variable always content address of an object
...
out
...
show();
}
}

6> Constant:
It is a kind of variable where value can’t be changed through out the program
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...
out
...
out
...
out
...
out
...
show();
}
}

Comments:If you don’t want to execute particular line or group of line you can use comment
...


There are three types of literals
a) Decimal integer literals -> int a=123;
b) Octal integer literals -> int a=0123;

c) Hexadecimal integer literals -> int a=ox123;
6 of 85

2/1/2016 7:45 AM

Theory

Ex:

http://www
...
com/virtim/index
...


class Hello{

int a=123; int b=0123; int c=ox123;
void show(){

system
...
println(a);
system
...
println(b);
system
...
println(c);
}
}

class Lab3{

Public static void main(String as[]){
Hello h=new Hello();
h
...


Two types of notation can be used to represent float value
...
0f

double d1=109e-5; -> 109*10^-5;

double d2 = 889E3; -> 889*10 per power 3;

Character literals:It is used to assign to character data type
...


* Char ch1=’ ‘ ; not ok, because in single quotation mark you have to provide at least one character
...


* Char ch2=’\n’;

In this case of scope sequence character you can provide following character data types the \n will be considered as one
character
...
>

Char data type size two byte:7 of 85

2/1/2016 7:45 AM

Theory

* In C/C++ we are using Ascii character with 9 bit of memory
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...

* Using Unicode character set you can represent all language
...

Ex :- String str=”welcome”;

Note:- String is a class in java not a data types
...

• True

• False
Ex: Program:class Hello{

char ch1=’A’;
char ch2=’3’;

char ch3=’&’;
int x=’A’;
int y=’a’;
int z=’0’;

char ch4=’\n’;
char ch5=’\r’;

String str=”Welcome Again”;
String str1=”This is bca”;
String str2=” “:
String str3;
boolean b;

boolean c=true;

Boolean dd=true;
void show1(){

systm
...
println(“character”);
systm
...
println(“ch1”);
systm
...
println(“ch2”);
systm
...
println(“ch3”);
systm
...
println(“x”);
systm
...
println(“y”);
systm
...
println(“z”);

systm
...
println(“ch4”);
systm
...
println(“ch5”);
}

void show2(){
8 of 85

2/1/2016 7:45 AM

Theory

systm
...
println(“String literal demo”);

http://www
...
com/virtim/index
...


systm
...
println(str);

systm
...
println(str
...
out
...
out
...
length());
systm
...
println(str2);
systm
...
println(str3);
}

void show3(){

systm
...
println(“Boolean literals demo”);
systm
...
println(b);
systm
...
println(c);
}
}
class Lab5{

Public static void main(String as[]){
h
...
show2()

h
...
(Dot) Operator

a) Arithmetic Operator:It is used to do arithmetic operator/expression
Example of arithmetic operation are:class Lab6{

public static void main(){
byte b=10;

system
...
println(b);
float f=10
...
out
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...
0; then it will show error possible loss of
precision
...
out
...
out
...
0/10
...
out
...
0/0
...
out
...
out
...
out
...
03/3
...
arithmetic exception: / by zero
b) Relational Operator :It is used to form logical expression
...

Ex: (ac), (a!=b) etc
...
Result of logical operator will be boolean value (true/false) according to following truth
table
...


10 of 85

2/1/2016 7:45 AM

Theory

http://www
...
com/virtim/index
...


d) Assignment Operator :It is used to assign source value or expression to destination variable
...


* If the source type is not source type than you have to convert source type to required destination type
...


There are two types of casting:(i) Implicit casting:If the source type is less than/smaller than destination type the automatic conversion type the automatic conversion is
happened the is called as Implicit casting or widening
...
0f, double d=f;

(ii) Explicit casting:If the source type is bigger than destination type then you have to convert source type to required destination type that is
called as or narrowing
...
99;
float f= (float) (d+10
...


e) Increment/ Decrement Operator :Increment operator used to increment the value by 1
...

Two types:
11 of 85

2/1/2016 7:45 AM

Theory

* Pre/pos increment

http://www
...
com/virtim/index
...


a++ -> post, ++a -> pre
* Pre/pos decrement
a-- -> pos --a -> pre

f) Ternary Operator :It is used to simple condition check
...


* If the condition is truth then first part will be executed otherwise second part
...

>>= -> right shift operator
<<= -> Left shift operator
& -> Bitwise AND
|| -> Bitwise OR

!= -> bitwise NOT
^ -> Bitwise XOR

h) Instance of Operator:Instance _of operator is used to check whether given object is instance of given class or not
String str=”bca”;

Str= instance of string -> true
Str instance of Hello -> false

i) New Operator:New operator is used to allocate the memory of members of class
...

Ex: Hello h=new Hello();

String str=new String(“bca”);

ArrayList al=new ArrayList();

12 of 85

2/1/2016 7:45 AM

Theory

Integer i=new Integer(10);

http://www
...
com/virtim/index
...


j)
...
Dot operator is used to access the member of class using object or class name
...
a;
h
...
show();
h
...
sum();
}
}

9> Control Statement:
* Conditional control statement (if, switch)

* Looping control statement ( for, while, do while)

* Unconditional control statement (break, continue)
Ex: if statement:syntax:-

Q:- Display the messge if it is divisible by 5 or not?
class Lab15{
13 of 85

2/1/2016 7:45 AM

Theory

public static void main(Stringas[]){

http://www
...
com/virtim/index
...


int a=15;

if(a%5==0){

system
...
println(a+” is divisible by 5”);
}

else{

system
...
println(a+” is not divisible by 5”);
}
}
}

Switch Statement:
Syntax:

switch(int value)
{

case ...
>: stmt;
break;

default: stmt;
}

Example:class Lab18{

public static void main(Stringas []){
int a=Integer
...
out
...
out
...
out
...
out
...
”); }
}
}

Looping Control Statement:

14 of 85

2/1/2016 7:45 AM

Theory

While Loop:-

http://www
...
com/virtim/index
...


class Lab23{

public static void main(String as[]){
int i= Integer
...
out
...
parseInt(as[0]);
while(n<=10){

system
...
println(n);
n++;
}

system
...
println(n);
do{

system
...
println(n);
n++;
}

While(n<=10)
}
}

Q-> Different between while/ do-while?

Unconditional control statement:a> Break

b> Continue

a> Break:15 of 85

2/1/2016 7:45 AM

Theory

It will transfer the control to end of loop unconditionally
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...


Example 1:
class Lab24 {

public static void main(String as[]){
for( int i=0; i<=20; i++)
{

if(i%2==0)
continue;

system
...
println(i);
}
}
}

Example 2:
class Lab25{

public static void main(String as[]){
int n=30;

system
...
println(“continue demo for no”);
system
...
println(i);

system
...
println(“Break demo”);
for( int i=0; i<=20; i++)
{

if(i==5)
break;

system
...
println(i);
}
}
}

10> Arrays:
* Arrays are used to store collection of element inside single variable of same type
...

* we can declare and initialize array in two ways:A> Static Initialization

B> Dynamic Initialization

A> Static Initialization:int a=10; -> a [10] holding 4 byte;

int arr [ ]; -> arr [null] holding 8 byte;
16 of 85

2/1/2016 7:45 AM

Theory

int arr[ ]= {1,2,3,4};

http://www
...
com/virtim/index
...


B> Dynamic Initialization:-

Example:
class Hello{
// int arr [0];

// int arr1 [ ]= new int [ ];

// int arr2 [ ] =new int [-5];
int arr3[ ];

int arr4 [ ]={1,2,3,4};
public void show()
{

system
...
println(arr4[0]);
system
...
println(arr4[1]);
system
...
println(arr4[2]);
system
...
println(arr4[3]);
arr3 =new int [0];
// arr3 [1]=10;

system
...
println(“Length:” +arr3
...
out
...
show();
}

17 of 85

2/1/2016 7:45 AM

Theory

}

http://www
...
com/virtim/index
...


Memory Allocation:
One Dimensional Array:
* Int arr [ ] new int [5];

Str [0] =”bca”;

Str [2]= “India”;

Two Dimensional Array:

18 of 85

OOPS Concept
2/1/2016 7:45 AM

Theory

Object Oriented Principals:

http://www
...
com/virtim/index
...


1> Abstraction

2> Encapsulation
3> Inheritance

4> Polymorphism

Object:* Anything which you can describe is called as an object
...


* Properties are also called as attributes and operations means behavior
...

Draw the diagram:-

To describe the you can take three properties
a> End User properties

b> Hardware People Properties
c> Developer Properties

* When you are describing mobile End User properties then you need to provide only to End user by holding the properties
and operation that is related to other perspective
...


* Abstraction the design level concept and these is no implementation in terms of programming language
...

* Class is called as programming language specific entities
...

* Method are called as operation
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...


Diagram:-

4> Polymorphism:* Polymorphism is the process of where one entity behaves differently in different cases
...


Note: PIE are the Piller of OPPS
Class and Object:

Class:Class is the logical representation of real word entities that contain properties and operation related to the entities
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...

Eg: Hello h = new Hello();

Here h is object which contains 8 byte
...


(ii) Hello h = new Hello():* Newly created address will be assign to h
...


* Whenever you are using the class (Writing java Hello) 1st JVM has to load the class in main memory
...


a> Variable:Variable declared inside the class directly can be divide into two types
...
out
...
show();
h
...
b=20;
h
...
show();

Hello h1= new Hello();
h1
...
b=200;
h1
...
show();

21 of 85

2/1/2016 7:45 AM

Theory

h
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...

Instance Variable:* It declared inside the class directly without static keyword are called as instance variable or non static variable
...

* Instance variable will get the memory when the JVM is created
...


Static Variable:* It declared inside the class directly with static keyword are called as static variable and non instance variable
...


* JVM will allocate the memory for static variable at the time of loading the class
...


b> Method: - will study After Block
...

Eg:{

// set of statement
}

There are two types of Block
(i)Instance Block
(ii)Static block

Program:class Hello{
int a=10;

static int b=20;
{

system
...
println(“Hello class Instance block”);
system
...
println(a);
system
...
println(b);
}

static{

system
...
println(“Hello class Static block”);

22 of 85

2/1/2016 7:45 AM

Theory

http://www
...
com/virtim/index
...


// system
...
println(a);
system
...
println(b);
}

public void show(){

system
...
println(“Hello class show()”);
system
...
println(a);
system
...
println(b);
}
}

public class Lab1{

public static void main(String as [ ]) {
Hello h = new Hello();
h
...

Static Block will be executed at class loading time and instance variable will get the memory at the time of object creation so
whenever class is loading instance variable will not be initialized that’s why you can’t access instance variable inside static
variable
...


* Instance block will be executed at object creation time and static block will be executed at class loading time
...

* Constructor will not have any return type even void also
...
out
...
out
...
out
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
show();

student stu1 = new Student(100, “sri”);
stu1
...
com (mailto:shashi@bca
...
com (mailto:roji@bca
...
show();

stu3
...


* It mainly used to initialize the instance variable of class with different set of value
...

* But if you are writing any constructor then JVM won’t inserted default constructor inside the class
...

24 of 85

2/1/2016 7:45 AM

Theory

http://www
...
com/virtim/index
...


• You can overload the constructor, it mean you can write more than one constructor with different set of parameter
...


* You can’t use static modifier before constructor
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
Of Hello”);
a=a1;
b=b1;
}

public void show(){

system
...
println(“show()- Hello”);
system
...
println(a);
system
...
println(b);
}
}

public class Lab5{
int x=10;

Static int y=20;
{

system
...
println(“Instance Block of Lab5”);
system
...
println(x);
system
...
println(y);
}

static{

system
...
println(“Static Block of Lab5”);
System
...
println(y);
}

public static void main(String as[ ]){
25 of 85

2/1/2016 7:45 AM

Theory

Hello h= new Hello();

http://www
...
com/virtim/index
...


system
...
println(Hello
...
show();
}
}

Example2:
class Hello1 {
int a=10;

static int b=20;
{

system
...
println(“Instance Block of Hello1”);
system
...
println(a);
system
...
println(b);
}
{

system
...
println(“Instance Block 1 of Hello1”);
system
...
println(a);
system
...
println(b);
}
{

system
...
println(“Instance Block 2 of Hello1”);
system
...
println(a);
system
...
println(b);
}

static {

system
...
println(“Hello1 ---4---- Static block ”);
system
...
println(b);
}

static {

system
...
println(“Hello1 ---1--- Static block ”);
system
...
println(b);
}
}

public class Lab6 {

public static void main(String as[]){
Hello1 h = new Hello1 ();
}
}
* You can write more than one Static / Instance block inside class directory
...

26 of 85

2/1/2016 7:45 AM

Theory

you can use the class in two ways:

http://www
...
com/virtim/index
...


(i) Create the object of that class
...

* Memory will allocate for static variable of the class
...


* Memory will be allocated for reference variable
...

* Instance block will be executed
...

* Appropriate constructor will be called
...


* you can’t declare constructor as static
...


b> Method:There are two types of method:
(i) Instance Method
(ii) Static method

Example:
class Hello {
int a=10;

static int b=20;
void m1(){

system
...
println(‘instance Method m1()”);
system
...
println(a);
system
...
println(b);
}

static void m2(){

system
...
println(‘static Method m2()”);
system
...
println(b);
}

27 of 85

2/1/2016 7:45 AM

Theory

}

http://www
...
com/virtim/index
...


public class Lab7 {

public static void main(String as[]){
// case1:

Hello h = new Hello();
h
...
m2();

// case2:

Hello
...
m1();

Hello h = null;
h
...


* Inside instance method you can access instance as well as static variable
...


Static Block:* Method declared inside the class with static keyword
...


* static method must be called by you explicitly by following ways:(i) Reference variable which contain object of class
...

(iii) Reference variable which content null
...
out
...
out
...
out
...
out
...
out
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
show();

system
...
println(h
...
out
...
p);
}
}

Variables Point:a>Variable declared inside constructor method or block is called local variable
...

c> Local variable will not be initializing by JVM automatically
...


e> Local variable can’t be accessed from object of the declared as static
...


Local Block:* Block defined inside constructor, method, or block itself are called as local block
...

* Local Block can be nested, it mean you can write local block inside local block
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
Of Hello”);
a=a1;
b=b1;
}

public void show (){

system
...
println(“show()
...
out
...
out
...
out
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
show();
}
}

Method Overloading:* writing more than one method with same name by varying the parameters inside the class is called as method overloading
...


(2) By changing order of parameter
...
of parameter
...


Example 1:31 of 85

2/1/2016 7:45 AM

Theory

class Arithmetic {

http://www
...
com/virtim/index
...


int a=10;

void sum(){

system
...
println(a+a);
}

void sum(int p){

system
...
println(p+p);
}

void sum(int p, double d){
system
...
println(p+d);
}

void sum(double d, int p){
system
...
println(d+p);
}

void sum(int a, int b, double d){
system
...
println(a+b+d);
}
}

public class Lab12{

public static void main(String as[]){
Arithmetic obj = new Arithmetic();
obj
...
sum(10);

obj
...
sum(10,20,30);
obj
...
sum(20,10,50, 20);
}
}

Problem With Method Overloading:* If you have the requirement to add only one type of data inside the method then for every different number of arguments,
you have to write new method or you can modifier the existing method
...
5 sun has provided variable argument feature by which you can declared only one method that will handle different
number of method calls
...

* The array can contain either zero (0) or more elements
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...


(2) Using this you can access instance variable and static variable
...

(4) You can take same name for instance variable as same local variable
...

(6) To differentiate refer the instance variable using this keyword and use the local variable directly
...


This (Keyword ) can be used for following purpose:* To access number of class
...

* Variable of class
...
a;
* this
...
m1();

* this
...


this();-> To call Default Constructor of class
...


this(1,2);-> To call 2 args constructor class
...
out
...
out
...
a);
33 of 85

2/1/2016 7:45 AM

Theory

system
...
println(this
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...
out
...
out
...
out
...
out
...
a=a;
}

public Hai(int a, int b) {

system
...
println(“ 2 args – cons -Hai”);
this
...
b=b;
}

public void show();
}

int a=222;

system
...
println(this
...
out
...
out
...
out
...
b);
}
}
}

public class Lab16 {

public static void main (String as [ ]) {
Hai h = new Hai (100);
h
...


Example:34 of 85

2/1/2016 7:45 AM

Theory

class Hello {

http://www
...
com/virtim/index
...


int a;
int b;
int c;

public Hello () {

system
...
println(“Default Constructor”);
}

public Hello (int a) {
this();

system
...
println(“1 args constructor”);
this
...
show();
}

public Hello (inta, int b) {
this(a);

system
...
println(“2 args constructor”);
this
...
b=b;
}

public Hello (int a, int b, int c) {
this(a,b);

system
...
println(“3 args constructor”);
this
...
b=b;
this
...
out
...
out
...
out
...
out
...
show ();
}
}

Constructor Overloading:Writing more than one constructor by chaining the parameter inside same class is called as constructor overloading
...


35 of 85

2/1/2016 7:45 AM

Theory

Method:-

http://www
...
com/virtim/index
...


* Method can take any name
...


Constructor:* Constructor name should have class name
...

* Constructor calls by JVM automatically
...


JVM Memory Management:* When you are running the java program JVM will occupy some memory from the O
...

* At JVM startup, JVM will occupy some memory form O
...

* The memory occupy the JVM will be divided into two parts
...


At the time loading the class JVM will perform following tasks:* One default object will be created of the type’s java
...
class which holds the represent of stack and static variable
...


* Stack memory will be divided into two parts
...


2) Memory will be allocated for local variable
...

4) Static block will be executed
...


Call By Value and Call by reference:* Passing the primitive as a parameter to method is called as call by value mechanism
...

* Passing the reference as parameter to method is called as call by reference mechanism
...


Example:class Hai {
int x=10;
}

class Hello {
36 of 85

2/1/2016 7:45 AM

Theory

void m1(Hai hai) {

http://www
...
com/virtim/index
...


system
...
println(“m1() start “);
system
...
println(Hai
...
x = hai
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
m2(p);

system
...
println(“After calling call by value method”);
system
...
println(p);
Hai hai = new Hai ();

system
...
println(“Before calling call by reference method”);
system
...
println(Hai
...
out
...
out
...
x);
}
}

Q->Can I overload the main() method if yes the which main() method will be called by JVM
...
out
...
out
...
out
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...


Q->we have written two class Hello and Hai both contain the main() which main() method will be called
by JVM
...
At a time only one main can be execute using class name
...
This process is called as recursive calling
...

Java
...
stack over flow error;

Q-> Write a java program to find the factorial of given number using recursive
...
out
...
find_fact(n));
else

system
...
println(“Please provide +ve no”);
}
}

String in Switch:
* Before to JDK 1
...

(1) byte

(2) short
(3) int

(4) char

* But form JDK 1
...

38 of 85

2/1/2016 7:45 AM

Theory

Example:-

http://www
...
com/virtim/index
...


public class Strswitch {

public static void main (String as [ ]) {
String color = as [0];
switch(color); {
case “Red”:

system
...
println(“you have selected option -1”);
break;

case “Blue”:

system
...
println(“you have selected option -2”);
break;

case “Green”:

system
...
println(“you have selected option -3”);
break;

default : system
...
println(“Invalid Option”);
}
}
}

Inheritance
* It is process of writing newly class using extending class functionality
...

=> Types of Inheritance:
1> Simple Inheritance

2> Multilevel Inheritance

3> Hierarchical Inheritance
4> Multiple Inheritance
5> Hybrid Inheritance
6> Cyclic Inheritance

1> Simple Inheritance:* In the case of simple inheritance we have only one sub class and only one super class
...

* One derived class can have only one direct base class and many in object base classes
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...

Example:

4> Multiple Inheritance:* Here one sub class can have many parent classes but all the parent class have only one sub class
...


5> Hybrid Inheritance:* Combination of two or more inheritance is called as hybrid
...

Example:

40 of 85

2/1/2016 7:45 AM

Theory

6> Cyclic Inheritance:-

http://www
...
com/virtim/index
...


* Extending class to itself is called as cyclic and this not allow in java
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
m1();

// h
...
m1();
hai
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...


* Super class member can be accessible in sub class directly but sub class member are not allowed to access in super class
directly but you can access the same way creating the object of sub class
...


* Inheritance with class member called instance block, static block, instance variable, static variable, instance method, static
method
...
out
...
out
...
a=a;
this
...
out
...
out
...
c=c;

this
...
out
...
c=c;

this
...
out
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...
out
...
e=e;
this
...
out
...
e=e;
this
...
out
...
out
...
out
...
out
...
out
...
out
...
show();

C ob1 = new C(10,20);
ob1
...
show();
}
}
* When you are not writing any constructor inside the class then one default constructor will be inserted by JVM
...


* If you are not writing any super() statement inside sub class constructor then one default super() statement will be inserted
by JVM automatically
...


* Super() statement is used to invoke the immediate super class constructor
...


* Super() statement must be 1st statement inside sub class constructor and can’t be inside method or block
...


* Whenever you are creating sub class object then memory will be allocated for sub class instance variable
...


Use of super:43 of 85

2/1/2016 7:45 AM

Theory

class Hello {

http://www
...
com/virtim/index
...


int a=10;
int x=10;

void show(){

system
...
println(a);
system
...
println(x);

system
...
println(this
...
out
...
x);
}
}

class Hai extends Hello {
int a=200;
int y=20;

void show() {

system
...
println(a);
system
...
println(y);

system
...
println(super
...
out
...
out
...
a);
super
...
show();

h1
...


* You can take same name for instance variable of super class and sub class
...


* To resolve this problem you can refer sub class variable with super keyword and sub class with this keyword
...

* Whenever you are accessing any variable with “this” keyword the following task will happen:1> JVM will check variable locally
...


3> If the variable is found in super class then it will access otherwise it will check in class level
...

44 of 85

2/1/2016 7:45 AM

Theory

Q->Different Between this and super?

http://www
...
com/virtim/index
...


This:* It is a reference variable which holds the current class object
...

this
...
show();

(ii)To access current class constructor this is call default constructor (1 args, 2 args)
...


->call to this must be the 1st statement inside current class constructor
...

* It is use for two purpose:-

(i)To access immediate super class member
Super
...
show() --->method
* To call the super class constructor
...


* call to the super must be the 1st statement inside sub class constructor
...


* Member declared as default/ protected/ public you can accessed in same class, sub class and non-sub class defined in
same package
...
out
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
b);
system
...
println(ob
...
out
...
d);
}
}

public class AccModi {

public static void main (String as [ ]) {
Superclass ob1 = new Superclass();
ob1
...
showsub();

Nonsubclass nsc = new Nonsubclass();
nsc
...

* The package without name is called default package
...

Example:-

class Hello {
void m1() {

system
...
println(“Hello –m1()”);
}

46 of 85

2/1/2016 7:45 AM

Theory

void m2() {

http://www
...
com/virtim/index
...


system
...
println(‘Hello –m2()”);
}
}

class Hai extends Hello {
void m1 () {

system
...
println(‘Hai –m1()”);
}

void m3 () {

system
...
println(‘Hai –m3()”);
}
}

public class Method {

public static void main (String as [ ]) {
Hai h = new Hai ();
h
...
m2();
h
...


Use of Method Overloading:* According to object oriented best practices class are closed for modification
...

=>Sub class can be written for following reason:(i) To add new functionality

(ii) To modify existing functionality

(iii) To inherit the existing functionality
* Where you are overriding the method writing super class of sub class, you have to follow the following task:(i) Name of the method same as super class method name
...


(iii) Return type also same as super class method return type
...


(iv) Inheritance method of super class must be overridden as instance method only
...


(vi) If super class method is throwing some exception then sub class can do one of the following:a> Sub class can ignore that method level exception
...

47 of 85

2/1/2016 7:45 AM

Theory

http://www
...
com/virtim/index
...


c> Super class can’t throw exception which sub class to super class method exception
...


Example:class A{

private void m1(){

system
...
pritnln(“private m1()”);
}

int m2(){

system
...
println(“m2()”);
return();
}

static void m3() {

system
...
println(“m3()”);
}
}

class B extends A{
/* void m2(){

system
...
println(“m2() – of B”);
}

*/

private int m2() {

system
...
println(“m2() of B”);
return 9;
}

// can’t reduce the visibility of the inheritance method from A
void m3() {

system
...
println(“m3() of B”);

// this inheritance method can’t override the static method from A
public void main () {

system
...
println(“main() B”);
}
}

public class MOlab{

public static void main(String as [ ] ) {
B b = new B();
b
...


* Whenever method you are writing in sub class will be treated as new method not overridden method
...

48 of 85

2/1/2016 7:45 AM

Theory

http://www
...
com/virtim/index
...


Q-> Can I override static method?
* Yes, we can
...


Q->Can I stop method overriding?
* Yes, we can stop method overriding by declaring the method as final
...


Q->Can I override the main() method?
* Yes we can override the main() but the application will run from only one main() method at a time
...


Which object creation is true
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...


Types of polymorphism:
(i) Compile time polymorphism (static polymorphism)
(ii) Runtime polymorphism (Dynamic polymorphism )

* Compile time polymorphism (static polymorphism):-

* you can achieve compile time polymorphism using method overloading
...
sum();

m
...


(2) No
...


(3) Type of parameter will be verified
...


Runtime Polymorphism:* You can achieve runtime polymorphism using dynamic dispatch and method overloading
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...
out
...
out
...
out
...
out
...
out
...
out
...
sleeping() --->not ok
a
...
sleeping();
a
...
running();

// a
...


In the case of eating() method:* We are overriding eating() method in Dog class so we are following dynamic dispatch and method overriding for eating()
method
...


a
...
It will call eating of Dog class
...

51 of 85

2/1/2016 7:45 AM

Theory

a
...


http://www
...
com/virtim/index
...


* So in this case sleeping we are not able to achieve runtime polymorphism
...


Note:* In the case of instance method () the method call depends of the type of object is assigned variable to super class reference
variable
...


* In the case of running we are not achieve runtime polymorphism due to static
...


Abstract Class example with program:
abstract class Animal {

abstract void sleeping();
abstract void eating ();
}

abstract class Dog extends Animal {
void sleeping() {

system
...
println(“ Dog sleeping”);
}

void eating() {

system
...
println(“ Dog eating”);
}
}

class MyDog extends Dog {
void running() {

system
...
println(“ MyDog running”);
}
}

abstract class Cat extends Animal {
void sleeping() {

System
...
println(“ Cat sleeping”);
}

void running () {

system
...
println(“Cat running”);
}
}

class Mycat extends Cat {
}

class Lab1 {

public static void main (String as [ ] ) {
Animal a = new MyDog ();
a
...
sleeping();

http://www
...
com/virtim/index
...


a
...

* If you are not writing body of the method then method must be declared as abstract
...

* If class is abstract then no need to write abstract class without abstract method
...


Q-> Can we declare abstract method as static?
-> No
...


Q->Can we declare abstract method as private?
->No
...


Here only two types of member are allow
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...
show();
}

class Hello extends Hai implements inter3, inter2, inter1 {
void hai show() {

system
...
println (“Hai show()”);
}

public void m1() {

system
...
println(“m1()”);
}

public void m2() {

system
...
println(“m2()”);
}

public void show() {

system
...
println(“show”);
}
}

public class Lab2 {

public static void main (String as [ ] ) {
Hello h = new Hello ();
h
...
m2();

h
...


2> Class can extends more than one class
...

4> Class can implements one interface
...


6> Interface can implements one interface
...

8> Interface can extends one interface
...

10> Interface can extends class
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...


Case 2: I want to write constructor, instance block and final variable
...


Case 3: I want to write only final static variable
...

Case 4: I want to write only final static variable and abstract method
...


STEPS :1
...
No)

2
...
Can I declare interface method as private (No)
4
...
Can I declare variable as abstract (No)

Q-> Difference Between Interface and abstract
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...


Example 1:class Outer {
int a=10;

static int b=20;
void m1() {

system
...
println(“m1() start”);
system
...
println(a);
system
...
println(b);

Inner ob = new Inner();

// System
...
println(x);
// Test ();

system
...
println(ob
...
Test();

system
...
println(“m1() End”);
}

class Inner {
int x=10;

// static int y=20;
56 of 85

2/1/2016 7:45 AM

Theory

void show() {

http://www
...
com/virtim/index
...


system
...
println(“show() of Inner”);
system
...
println(a);
system
...
println(b);
system
...
println(x);

// System
...
println(y);
}

void Test {

system
...
println(“Inner test ()”);
}
}
}

public class Lab1 {

public static void main (String as [ ]) {
Outer o = new Outer();
o
...
show();
// o
...
Inner oi = new Outer()
...
Test();

oi
...
Inner oi = new Inner ();
}
}

Example 2:class Employee {
int empid=100;

String ename=”srinivas”;
void show() {

system
...
println(empid+ename);
Sallary s = new Sallary();
s
...
out
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...
show();
}
}

Important Points:* Outer class member can be accessed inside inner class directly
...

* Instance inner class can’t have static declarations
...


Program:interface I1{

class Hello implements I1 {
class Hai {
}

interface I2 {
}

interface I3 {
}

private class Hai1 implements I1, I2, I3 {
}

protected class Hai2 extends Hai {
class X {

int a =10;
class Y {

system
...
println(a);
}
}
}
}
}

class Lab2 {

public static void main (String as [ ] ) {
Hello h = new Hello();
}
}

=> How many class file will be generated for Lab2
1> Hello $ Hai
...
class

3> Hello $ Hai2 $ X $ y
...
class
5> Hello $ Hai2 $ Y
...
class
7> Hello $ I3
...
class

http://www
...
com/virtim/index
...


9> I1
...
class
* Inner class can be private, protected
...

* Interface can be defined inside inner class
...


* Inner class can implements one or more inner interface
...


Method Local Inner Class:* Class defined inside member is called as method inner class
...


Example:interface Ball {
void hit (){
}

public class Lab4 {

public static void main (String as [ ]) {
final int x=10;

Ball b = new Ball() {
public void hit() {

system
...
println(“ You hit it!” +x);
}

};

b
...
Task 2:- Define one sub class and overriding abstract method
...


Task 4:- Assigning due dub class object to super class reference variable
...


59 of 85

2/1/2016 7:45 AM

Theory

http://www
...
com/virtim/index
...


* Anonymous class can be written inside the method or inside the class
...

* We can write instance block inside the animal’s class but we can’t write static blocks
...


Example:abstract class Ball {
abstract void hit () {
class Hello {

Ball b = new Ball () {
}

system
...
println(“Instance Block of Anonymous class”);
public void hit () {

system
...
println(“ You hit);
}

};

void show () {
b
...
show();
}
}

End Of Oops Concept

Package
Package:
* Package is the collection of classes
...


60 of 85

2/1/2016 7:45 AM

Theory

http://www
...
com/virtim/index
...


Syntax to declare package:
Package

Package com
...
p1;
Package p2;

* Package name is the combination of sub name separated by (
...

* Each sub name represents one folder inside your file system
...
out
...
show();
}
}

Importing the package;
* By default you can access all the public classes available in same package or current folder
...
e
...
You need to import that
package in your program
...

(i) Import com
...
p1*;

* This import statement all the classes available in com
...
p1 package in your program
...
bca
...
Hai*;

* This statement import only Hai class available in com
...
p2 package in your program
...


2> Default member are allowed in same class, sub class directly or with an object and in non-sub class with object in same
package
...

* default scope is also called as private scope
...

61 of 85

2/1/2016 7:45 AM

Theory

* in same directory with object
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...


* in non-sub class same package with object only allowed
...

* in non-sub-class different package not allowed
...

->// static import (Added JDK1
...
lang
...
lang
...
*;
public class SI {

public static void main (String as [ ]) {
system
...
println(math
...
out
...
sqrt(-10));

system
...
println(math
...
lang
...


java
...
math
...


* It means that is simple import JVM will import class from the particular package
...
lang
...
sqrt;
import static java
...
math
...
out
...
out
...
out
...
out
...
lang
...
sqrt;
* In 1st static import only static sqrt method will be imported to your program
...
lang
...
*;

http://www
...
com/virtim/index
...


* in 2nd static import all the static method and static variable will be imported to your program
...

* Using to many static imports reduce the readability of your program
...


List of Built-in package are:1> Java
...
io;

3> Java
...
reflect;
4> Java
...
sql;1> Java
...
lang package is default package which is important in all the java program by default
* You can access all the classes from java
...
package without importing it
...
lang
...


* You can access all the member of object class in your class as member of current class without extending it
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...
lang package by typing following commands on command prompt
...
java
...
object or if you want to place all the method of object class to particular file then you can use following
...
java
...
object output redirection object
...

}

public in hashCode() {

// your hashcode generation long
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...
out
...
out
...
getClass());

system
...
println(h
...
getName());
Hai h1 = new Hai ();

system
...
println(h1
...
out
...
getclass()
...
out
...
getClass());

system
...
println(h2
...
getName());
system
...
println(“ hashCode”);

system
...
println(h1
...
out
...
hashCode());
system
...
println(“tostring”);
system
...
println(h);

system
...
println(h
...
out
...
out
...
tostring ());
system
...
println(h1
...
out
...


* You cannot overriding the getClass() method in your class
...


hashCode:* It will return some hashCode integer number generated by JVM
...

* This hashCode will be used by JVM to search the object when you have many object
...


toString:* The return type of tostring() method is string
...
bca
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...
sid=sid;

this
...
sid=stu
...
phone=st
...
out
...
out
...
out
...
out
...
equals(st2));
system
...
println(st
...
out
...
equals(st3));
String str =”bca”;

String str1=”bca”;

system
...
println(str
...


* If operand is primitive then actual value will be compare but if the operand is object then address will be compare
...

* You can use two version of equals method:1> Object class equals() method
...


equals():* equals method of object class also compare the address of two objects
...


Garbage Collection :
* In C we are using malloc/ calloc to allocate memory and free() function to delete the allocation memory
...


* In java we are allocating the memory using new operator but we don’t have any operator to delete the allocation memory
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...

* GC is responsible to clean the memory which is not required or not reference by any object
...
JVM will used following technique
to find the unused and referenced object
...

Hello h = new Hello();

Hello h1 = new Hello ();
h=h2;

Example

* Here h2 become unused or unreferenced so it is eligible for gc
...


Program:
class Hello {
void m1() {

system
...
println(“m1()”);
Hello h = new Hello();
}

h=h1; ->eligible for gc
...

}
}
1> JVM will find the list of unused object
...


3> Now gc is responsible to clean the memory occurred by unused objects
...


5> Before cleaning the memory gc will call runfinalization() method
...

6> runfinalization() is responsible to call finalize() on each used object
...


Complete process of Garbge Collection (GC):
JVM:67 of 85

2/1/2016 7:45 AM

Theory

->prepare the list of unused obhect

http://www
...
com/virtim/index
...


->Hand over this list to gc
...

System
...
runfinalization();

Clean the memory:
runfinalize() method
...

* call finalize() method
...


* Prepare the list of unused object
...

* Call the gc() mehtod
...
gc();
rt
...
gc();
=>Responsible of gc() :-

* gc () method is responsible to clean the memory
...


* You can have two version of finalize() method one from object class and 2nd you can override finalize() method in your
class and write the code for resource cleanup
...
out
...
out
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...
out
...
runfinalization();
System
...
runfinalization();
System
...
m1();

System
...
gc();
}
}

Cloning:
* Cloning is used to create copy of existing object
...


* In shallow cloning only top level class will be cloned and all the inner class will be reused without cloning
...

* Clonable interface is a marker interface
...

* Interface without any member is called as marker interface
...


2> Deep cloning:-

69 of 85

2/1/2016 7:45 AM

Theory

http://www
...
com/virtim/index
...


* In deep cloning top level object as well as the deep object should clone
...


* If you are cloning then you are responsible to check whether your class is implementing clonable interface or not
...


String Class:* String class is a final class available in java
...


* The string literals you are using in program is the object of string class
...
out
...
out
...
out
...
out
...
length());
system
...
println(str2
...
out
...
length());
string str1 = “java”;
string str2 = “java”

string str3 = new String (“java”);
string str4 = new String (“java”);
system
...
println(str1==str2);
system
...
println(str1==str3);
system
...
println(str3==str4);

system
...
println(str1
...
out
...
equals(str3));
system
...
println(str3
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...


String concatenation:* String object are immutable
...


String Buffer:* It is a final class available in java
...
package
...
e after creating the string buffer object you can modify the contents of the object
...


* you can create the string in two ways
...

(ii)using new operator
...


* If you are modifying the anything string object or if you are concerting any time to existing string object then anytime new
string object will created and you have to assigned that object to reference variable
...

* You can’t insert or delete any character of string object ()
...


* Whenever you creating string object then memory will allocated for specified character
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...


* You can create string buffer object with new operator
...


* If you are modifying the string buffer object then same object will be modifying, so no need to assign result to references
...

* we can perform inserting or deleting own string buffer object
...


* Whenever you creating string buffer then memory will allocated for specified string char +16 byte extra memory as capacity
will be allocated
...


* Converting one data type to another data type
...

Boolean b1 = new Boolean (True); ->T

Boolean b2 = new Boolean (“bca”); ->F
Boolean
...
lang
...


* you can’t instantiate the system class because constructor of system class is private
...

72 of 85

2/1/2016 7:45 AM

Theory

Three constructor are defined in system:-

http://www
...
com/virtim/index
...


(i) public static final I
...
in

(ii) public static final I
...
out

(iii) public static final I
...
error

In:* In this the reference variable of input stream class and it points to standard output called “keyword”
...


* Out and err both are same but by conversion err is used to print error message or any type of message that come to user
attention immediately
...


* You can change to default input or output device to other device like file or network using following three file or network
using following three method
...


2> gc():It is responsible to clean the m/r occupy by the unused object
...


4> exit(int):After invoking this method JVM will be terminated
...


6> SetProperties():73 of 85

2/1/2016 7:45 AM

Theory

This method you can use to set the properties
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...


8> setProperty (string_prop_name, string_prop_value):Using this method you can get the property value of specified property name
...
lang package
...


* In runtime class all member are defined as now static
...
getRuntime();

* Runtime class default constructor is private
...
lang
...

* All the member of math class are static
...


Strict FP:* Strict FP stands for strict floating point
...


* If you are following as based calculations then you may get variation in result from one as to another
...


* Strict FP in process to use IEEE standards for floating point calculations
...


List of core java design pattern:(i) singleton (v) command
(ii) factory (vi) decorator
(iii) obj sever (vii)Proxy

(iv) facode (viii) composite etc

(i) singleton:* Singleton design pattern ensure that only one object will be created for a class
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...
getHello();
Hello h2 = Hello
...
getHello();
Hello h4 = Hello
...
out
...
out
...


=> Compile time error
=> Logical error

=> Runtime error

Compile time error:* When any synthetically mistake will occur in your program, mean what syntax you have written that is not matching with the
compiler library than it will report to the at compile time is called as compiler time error
...
out
...
parseInt(as[ 0]);

http://www
...
com/virtim/index
...


int i1 = Integer
...
out
...
That is called as logic error
...


Runtime error:* Runtime error show in efficiency of JVM that it can’t continue that program exception
...
e
...
lang
...


(ii) Exception:* When execution in your program occurs then explicitly by handling the exception you can continue the further program
execution
...
lang
...


* If any error occurred in your program then it will be the sub class of error class
...
lang
...


Program:
class Test {

76 of 85

2/1/2016 7:45 AM

Theory

public static void main (String as [ ]) {

http://www
...
com/virtim/index
...


system
...
println(“main() being”);
int a = Integer
...
out
...
out
...
langArrayIndexOutOfBoundException: O

2> NumberFormatException: for input string: “bca”;
3> ArithmeticException : by zero
4> Java Test10
main() being
:
:

main() end
...


* Next when JVM going to execute another line then JVM is unable to execute that line due to some problem
...


* The event raised by JVM on unsuccessful compilation of request is called as exception error
...


If any problem will come in your program then JVM will do the following tasks
...


3> JVM will create the object of that class indentified
...


5> JVM will throw that object to your program
...

7> JVM will print the error massage
...


Try with multiple catch:Example:
public class Lab2 {

public static void main(String as [ ] ) {
try{

system
...
println(“main()-being”);
77 of 85

2/1/2016 7:45 AM

Theory

int a=Integer
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...
out
...


* If you are writing multiple catch block then 1st you have to write sub class exception catch block then super class exception
catch block
...


* You should not write any statement between catch and catch block
...


* If you have return statement either in try block or catch block then before data in the control to caller of the method finally
block will be executed
...


Q-> Can we write one try block without catch block?
* Yes we can
...


Q->How many finally block we can write for one try block?
* Only one
...


http://www
...
com/virtim/index
...


Q->Can you define finally block between two catch block?
* No it should be last block of statement
...
exit() method inside try block on catch block
...


* we can write the resource cleanup code inside the finalized method also but it is recommended to write resource cleanup
code in finally block for better performance
...
getconnection(“Drive”);
}

public void finalize() {
conclose();
}
}
* Connection will be close vay-2 late

* You can handle limited no of connection
...
getconnection(“Drive”);
}

catch(Exception e) { }
finally{

conclose();
}
}
* Connection will be close immediately
...
of request
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...


* You can write try, catch, finally block inside catch block
...


Throw keyword:->Throw keyword is used to throw the exception explicitly
...


Some task you can do with throw keyword syntax:
Example:-

throw object;

throw new number;
format exception();

ArithmeticException ae = new ArithmeticException();
throw ae;

InvalidMobileNoException me = new InvalidMobileNoException();
throw me;

Types of Exception:
1> Built-in exception

2> User-define exception

1> Built-in exception:* In exception which is already implemented by various vendors are called built-in exception
...


2> User-define exception:* Sometimes you may get requirement to develop your own exception depending on business requirement
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...


b> You can write instance variable if required
...


d> You can override to String () method to print tailored msg if required
...


Throws Keywords:* It is used to define method level exception
...
bca
...
io
...
Util
...
Sql
...
in);
system
...
println(“Enter your name”);
name=input
...
out
...
getInput();
try {

h
...
out
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...
bca
...
out
...
out
...
m1();
}

catch(Exception e){

system
...
println(e);

system
...
println(e
...
printStackTrace();

http://www
...
com/virtim/index
...


}
}

* If your method is throwing some exception level exception then you have two options:1> You can handle that exception by writing try – catch statement
...


NOTE:- you can throws keyword if you don’t want to handle exception
...


Types of Exception:

Check Exception:* All the subclass of exception class except Runtime exception and their subclass comes under the categories of checked
exception
...
virtim
...
php/2015-05-26-07-47-04/2015-05-
...

* You can report the exception either by writing try – catch statement or by declaring method level exception
...


->Java
...
clone not supported exception, must be caught or declared to be thrown
...

* In the case of unchecked exception it is not mandatory to report the exception
...


Example:package com
...
Lab10;

import java
...
SqlException;
class Hello {

void m1() throws clone not supportedException {
this
...
out
...
out
...
out
...
out
...
m1();
}

catch(Exception e) {

system
...
println(e);
}

h
...
m3();

system
...
println(“main end”);
}
}
* In this case of m1() method we have reported
...


* In the case of m2() method we have reported the exception by declaring it as method level exception using keywords
...

84 of 85

2/1/2016 7:45 AM

Theory

http://www
...
com/virtim/index
...


NOTE:- m1() and m2() are throwing checked exception
...


Different between Error and Exception?
Exception:* exception is a kind of problem that can be handling
...


Error:* Error is a type of problem that can’t be handling
...


* All the exception and error will be generated runtime only
...

* Exception or errors coming at compile time are called as synthetically error
Title: Complete Core Java
Description: This PDF has the complete explanation of Core Java. You can find all your java related queries in this pdf with questions and answers section in each topic. You can also find practical examples and explanation using diagrams in this PDF. This PDF can be of much useful for you.