Sunteți pe pagina 1din 44

A

SUMMER TRAINING REPORT


ON
CORE JAVA
UNDERTAKEN

JAVAHUB TRAINING CENTER JAIPUR(RAJ.)

Submitted in partial fulfillment of the requirements for the award of Degree of


BACHELOR OF TECHNOLOGY
IN
COMPUTER SCIENCE & ENGINEERING

Training In-charge
Mr.VIKASH SINGH

(10th June, 2019 – 11th July, 2019)

Submitted by: Submitted to:


Ankit Kumar Mr.Pramod Mishra
ID.E-9464/16,(CSE)
4thyear
( Assistant Professor)
MAHAMAYA COLLAGE OF AGRICULTURAL ENGINEERING & TECH.
AKBARPUR-AMBEDKAR NAGER (U.P) 224122
ACKNOWLEDGEMENT
I would like to thanks all those with whom I learned and whose thoughts and insights
helped me in increasing my knowledge and understanding of learning in the
organization. I would like to pay my sincere gratitude to Mr.Vikas Singh (director of
institute) and Mr.Vineet Khandewal (Program Co-ordinator), JAVAHUB
TRAINING CENTER JAIPUR(RAJ.)

Besides I would also thanks to Mr. Vikas Singh Director of JAVAHUB


TRAINING CENTER

and his team for constant motivation and proper guidance during the entire tenure of this report
work.

We pay our sincere and deep gratitude to our honourable Vice Chancellor DR.Jeet Singh
Sandhu, N.D.U.A.T Kumarganj Ayodhya, needless to say, all this would not have been
possible without his blessing & encouragement.

We would like to express our sincere and heartiest gratitude to our Dean Dr. Rajat Kumar Mehta
for the continuous motivation and proper guidance during the entire tenure of the study.

We have paucity of words to express our utmost grate fullness and regard for moral
encouragement and staunch support and selfless help rendered by Dr. P.K Mishra Assistant
Professor ,Farm Machinery And Power Engineering and Dr. Susheel Kumar Pandey,
Associate Professor ,Process and Food Engineering , during the period of my study.

Finally, I am thankful to all of them who directly or indirectly helped me in the completion of
the report successfully.

Mr.Ankit Kumar Date:


ID NO.-E-9464/16
Place: M.C.A.E.T, Akbarpur Ambedkar nagar.

01
ABSTRACT

A practical training is a method of implementing and converting your theoretical knowledge


into a practical use. The more one can go under practical training, the more he will be able to
accuracy and experience in his field. Therefore, a practical training is must to complete a degree
of engineering in my field.
Therefore to gain a professional Knowledge I was also made to undergo a one month
in practical training at JAVAHUB TRAINING CENTER There I was given
JAVA Language training.

This report emphasis on the knowledge and practical training as well, gained during this one
month tenure. it includes the activities carried out on different days, tasks, problems and their
solutions, area covered during the whole program as well.
During the tenure of one month different challenges came across us, but the trainer of JAVA
Language, us very well to tackle them.
The training of JAVA Language was carried out in a Tank road Jaipur.
In this report a brief history and introduction of the institute has been provided and also various
tasks and training activities with institute data has been mentioned. The process and method
carried out during the program, conclusion of the training and some suggestion and
recommendation has been mentioned. This report is an attempt made to study the overall
performance of JAVA Language. This report present the Introduction of JAVA Language.

02
TRANING SCHEDULE

Table 1 Schedule of June- July 2019

DAY ACTIVITY
10-JUNE Registration And Introduction
11-JUNE Basics of java And History of java
12-JUNE Keyword, Variable, Data Types
13-JUNE Typecasting
14-JUNE Instance & Static Data Members
15JUNE Concept of OOP
16-JUNE SUNDAY
17-JUNE Encapsulation
18-JUNE Object & Class
19-JUNE Inheritance
21-JUNE Program Practice (Lab)
22-JUNE
Practice session

23-JUNE SUNDAY
24-JUNE Polymorphism, Scanner class
25-JUNE Constructor
26-JUNE Static Block
27-JUNE Array
28-JUNE Program Practice (Lab)
29-JUNE Array of Array
30-JUNE SUNDAY
01- JULY String Handling
02-JULY Acess Modifiers
03-JULY Abstraction
03-JULY WORK ON LIVE PROJECT

04-JULY Package
05-JULY Program Practice(Lab)
06JULY Exception Handling
07-JULY SUNDAY
08-JULY Throw &Throws
09-JULY Input/Output Stream
10-JULY Multi-Threading
11-JULY Program Practice (Lab)
CONTANT

1. Acknowledgement...........................................................................................................1
2. Abstract...................................................................................... .... .....................................2
3. Introduction.....................................................................................................................5
4. Organisation....................................................................................................................5
5. Basics Of Java.................................................................................................................5
5.1. Overview Of Java...................................................................................................6
5.2. Features Of Java.....................................................................................................6
5.3. Java ClassPath Setting............................................................................................7
5.4. Steps For Compiling And Executing Programs..........................................................7
5.5. Difference Between JDK,JRE And JVM...................................................................7
5.6. Object And Class........................................................................................................ 8
5.7. Data Types.................................................................................................................. 8
5.8. Variables..................................................................................................................... 9
5.9. Operators And Its Types.................................................................................10

5.10.as when needed and we are very grateful for that......11

6. Programming Concepts...................................................................................................... 12
6.1. Structure Of Java Program................................................................................... 12
6.2. Main Method............................................................................................................ 13
6.3. Decision Making Statement.................................................................................... 14
6.4. Looping Statement.................................................................................................. 15
6.5. Wrapper Classes...................................................................................................... 15
6.6. Access Modifiers................................................................................................. 16

7. Java Useful Keywords..................................................................................................... 17


7.1. Final....................................................................................................................... 17
7.2. Static .................................................................................................................. 18
7.3. This......................................................................................................................... 19
7.4. Super.................................................................................................................... 20
7.5. Synchronized....................................................................................................... 21

8. JavaClasses, Blocks And Constructors............................................................................... 22


8.1. Abstract Classes................................................................................................... 23
8.2. Constructors......................................................................................................... 24
8.3. Constructors And Its Types.............................................................................25
8.4. Static Block In Java.............................................................................................. 26
8.5. Relationship In Java............................................................................................... 27

9. Java Object Oriented............................................................................................... 28


9.1. . Inheritance................................................................................................... 30
9.2. Method Overloading.......................................................................................... 31
9.3. Method Overriding.....................................................................................33
9.4. Interface..................................................................................................... 33
9.5. Abstraction................................................................................................... 34
9.6. Encapsulation...................................................................................................... 35
9.7. Polymorphism....................................................................................................... 35

10. Java Advanced................................................................................................................. 36


10.1. ExceptitionHandling...........................................................................................37
10.2. Multithreading...................................................................................................... 38
10.3. String....................................................................................................................... 39
10.4. Collection............................................................................................................... 39

10.5 Project Undertaken....................................................................................................... 39

Conclusions....................................................................................................................... 40
Suggestions and recommendation...................................................................................41
References......................................................................................................................... 42

04
INTRODUCTION

Java is one of the programming language or technology used for developing web applications. Java
language developed at SUN Micro Systems in the year 1995 under the guidance of James Gosling
and there team. Originally SUN Micro Systems is one of the Academic university ( Standford
University Network )

Whatever the software developed in the year 1990, SUN Micro Systems has released on the name
of oak, which is original name of java (scientifically oak is one of the tree name). The OAK has
taken 18 months to develop.The oak is unable to fulfill all requirements of the industry. So James
Gosling again reviews this oak and released with the name of java in the year 1995. Scientifically
java is one of the coffee seed name.

ORGANISATION
HP the largest IT company in the world, through its partner offers high quality Courses for 4 &
6 weeks. Few Courses in Summer Training Program are Programming Techniques using 'C',
PHP, VLSI, VHDL & PCB Design, Data Structure using C Language, Core Java, J2EE -
Hibernate with Spring Framework, J2EE - Struts with Hibernate Framework, Android, ASP.NET
With C#, Embedded & Robotics-Basics & Advanced, ARM, Linux Administration with
Scripting, Networking concepts with security.

BASICS OF JAVA

Overview Of Java:-

Java is a platform independent, more powerful, secure, high performance, multithreaded


programming language. Here we discuss some points related to java.

Define JRE:-

The Java Runtime Environment (JRE) is part of the Java Development Kit (JDK). It contains
set of libraries and tools for developing java application. The Java Runtime Environment provides
the minimum requirements for executing a Java application. 05
Define JVM:-

JVM is set of programs developed by sun Micro System and supplied as a part of jdk for reading
line by line of byte code and it converts into native understanding form of operating system. Java
language is one of the compiled and interpreted programming language.

Garbage Collector:-

Garbage Collector is the system Java program which runs in the background along with regular
Java program to collect un-Referenced (unused) memory space for improving the performance of
our applications.
Define an API:-

An API (Application Programming Interface) is a collection of packages, a package is the


collection of classes, interfaces and sub-packages. A sub-package is a collection of classes
interfaces and sub sub packages etc.

Java programming is containing user friendly syntax so that we can develop effective application
s. in other words if any language is providing user friendly syntax, we can develop error free
applications.

Definition of JIT:-

JIT is the set of programs developed by SUN Micro System and added as a part of JVM, to speed
up the interpretation phase

Features Of JAVA:-

Features of a language are nothing but the set of services or facilities provided by the language
vendors to the industry programmers. Some important features are;

06
Fig:-1.0 Java Classpath Setting

Path Variable:-

Path variable is set for providing path for all java tools like java, javac, javap, javah, jar,
appletviewer which are use in java programming. These all tools are available in bin folders so we
set path upto bin folders.

Classpath Variable:-

Classpath variable is set for providing path for predefined java classes which is used in our
application. All classes are available in lib/rt.jar so we set classpath upto lib/rt.jar.

Steps For CompilingAnd Executing Programs:-

The following sequence of steps represented in the diagram use compiling the java program and
executing the java programs.

07
Fig..1.1

Difference Between JDK,JRE AND JVM:-

Jvm, Jre, Jdk these all the backbone of java language. Each components have separate works. Jdk
and Jre physically exists but Jvm are abstract machine it means it not physically exists.
JVM : JVM (Java Virtual Machine) is a software. It is a specification that provides runtime
environment in which java bytecode can be executed. It not physically exists.JVMs are not same for
all hardware and software, for example for window os JVM is different and for Linux VJM is
different. JVM, JRE and JDK are platform dependent because configuration of each OS differs. But,
Java is platform independent.

JRE : The Java Runtime Environment (JRE) is part of the Java Development Kit (JDK). It contains
set of libraries and tools for developing java application. The Java Runtime Environment provides
the minimum requirements for executing a Java application. It physically exists. It contains set of
libraries + other files that JVM uses at runtime.

JDK : The Java Development Kit (JDK) is primary components. It physically exists. It is collection
of programming tools and JRE, JVM.

08
Fig...1.2

Object And Class:-

Object is the physical as well as logical entity where as class is the only logical entity.Class: Class
is a blue print which is containing only list of variables and method and no memory is allocated for
them. A class is a group of objects that has common properties.

A class in java contains:

• Data Member

• Method

• Constructor
• Block

• Class and Interface


Object: Object is a instance of class, object has state and behaviors.An Object in java has three
characteristics:

• State

• Behavior

• Identity
09
State: Represents data (value) of an object.
Behavior: Represents the behavior (functionality) of an object such as deposit, withdraw
. Identity: Object identity is typically implemented via a unique ID. The value of the ID

visible to the external user. But,it is used internally by the JVM to identify each object

Class is also can be used to achieve user defined data types.

Data Types:-

Datatype is a spacial keyword used to allocate sufficient memory space for the data, in other words
Data type is used for representing the data in main memory (RAM) of the computer.

In general every programming language is containing three categories of data types. They are

• Fundamental or primitive data types

• Derived data types

 Data
booleanUser defined data
Type types.Value
Default
false Default
1 bit size
char
byte
short '\u0000'
0 2
1
2 byte
byte
int
long
float 0L
0.0f 4
8
4 byte
double 0.0d 8 byte

Figure.1.3

Variable:-

Variable is an identifier which holds data or another one variable is an identifier whose value can
be changed at the execution time of program. Variable is an identifier which can be used to
identify input data in a program.

.......... 10.........

Operators And Its Types:-

Operator is a special symbol that tells the compiler to perform specific mathematical or logical
Operation. Java supports following lists of operators.

• Arithmetic Operators
• Relational Operators

• Logical Operators  Bitwise Operators

• Assignment Operators

• Ternary or Conditional Operators

PROGRAMMING CONCEPTS

Structure Of Java Program:-

Structure of a java program is the standard format released by Language developer to the Industry
programmer. Sun Micro System has prescribed the following structure for the java programmers for
developing java application.

• A package is a collection of classes, interfaces and sub-packages. A sub package contains


collection of classes, interfaces and sub-sub packages etc. java.lang.*; package is imported by
default and this package is known as default package.

• Class is keyword used for developing user defined data type and every java program must start
with a concept of class.

...........11..... ..
Main( ) Method:-

main() method is starting execution block of a java program or any java program start their
execution from main method. If any class contain main() method known as main class.

Decision Making Statement:-

Decision making statement statements is also called selection statement. That is depending on the
condition block need to be executed or not which is decided by condition. If the condition is "true"
statement block will be executed, if condition is "false" then statement block will not be executed.

In java there are three types of decision making statement.

• if

• if-else

• switch

Looping Statement:-
for loop

While loop

do-while

Wrapper Classes :-For each and every fundamental data type there exist a pre-defined class, Such
predefined class is known as wrapper class. The purpose of wrapper class is to convert numeric
string data into numerical or fundamental data......12......

Access modifiers:-
Access modifiers are those which are applied before data members or methods of a class. These are
used to where to access and where not to access the data members or methods. In java programming
we have four access modifiers they are

JAVA USEFUL KEYWORDS:-

Final keyword :-

In java language final keyword can be used in following way.

• Final at variable level

• Final at method level

• Final at class level


Static keyword :-

The static keyword is used in java mainly for memory management. Static keyword are used with
variables, methods, blocks and nested class. Static is a keyword that are used for share the same
variable or method of a given class. This is used for a constant variable or a method that is the
same for every instance of a class. The main method of a class is generally labeled static.

In java language static keyword can be used for following

13

1. variable (also known as class variable)


2. method (also known as class method)
3. block.
4. nested class This keyword

this is a reference variable that refers to the current object. It is a keyword in java language
represents current class object

"this" keyword can be use in two ways.

• this . (this dot)

• this() (this off)

Example:-

class Loan{

private double interest;

private String type;

public Loan(){

this(“personal loan”);

public Loan(String type){

this.type = type;

this.interest = 0.0;

14


Super keyword :-

Super keyword in java is a reference variable that is used to refer parent class object. Super is an
implicit keyword create by JVM and supply each and every java program for performing
important role in three places.

• At variable level

• At method level

• At constructor level Synchronized Keyword Synchronized Keyword is used for when we

want to allow only one thread at a time then use Synchronized modifier. If a method or block

declared as a Synchronized then at a time only one thread is allowed to operate on the given

object.

CLASSES, BLOCKS AND CONSTRUCTORS:-

Abstract Classes:-

We know that every java program must start with a concept of class that is without classes concept
there is no java program perfect.In java programming we have two types of classes they are

1. Concrete class
2. Abstract class

15

Constructor And Its Types:-A constructor is a special member method which will be called
implicitly (automatically) by the JVM whenever an object is created for placing user or programmer
defined values. place of default values. In a single word constructor is a special member method
which will be called automatically whenever object is created.
The purpose of constructor is to initialize an object called object initialization. Constructors are
mainly create for initializing the object. Initialization is a process of assigning user defined values
at the time of allocation of memory space.

Types of constructors:-

Based on creating objects in Java constructor are classified in two types. They are

 Default or no argument Constructor

 Parameterized constructor.

Default constructor:-

If you do not implement any constructor in

your class, Java compiler inserts a default

constructor into your code on your behalf.

This constructor is known as default

constructor.

Example:

class Demo

public Demo()

System.out.println("This is a no

argument constructor");

public static void main(String args[])

16

new Demo();

}
}

Parameterized constructor

Constructor with arguments(or you can say

parameters) is known as Parameterized

constructor.

Example:

public class Employee {

int empId;

String empName;

//parameterized constructor with two

parameters

Employee(int id, String name){

this.empId = id;

this.empName = name;

void info(){

System.out.println("Id: "+empId+"

Name: "+empName);

17

public static void main(String args[]){

Employee obj1 = new

Employee(10245,"Ankit");
Employee obj2 = new

Employee(92232,"kaushal");

obj1.info();

obj2.info();

Output:

Id: 10245 Name: Ankit

Id: 92232 Name: kaushal

Static Block in Java:-

Static block is a set of statements, which will be executed by the JVM before execution of main
method. At the time of class loading if we want to perform any activity we have to define that
activity inside static block because static block execute at the time of class loading.

In a class we can take any number of static block but all these static block will be execute from top
to bottom.

Relationship in Java:-

Type of relationship always makes to understand how to reuse the feature from one class to another
class. In java programming we have two types of relationship they are.

18

• Is-A Relationship

• Has-A Relationship
JAVA OBJECT ORIENTED:-

Inheritance:-The process of obtaining the data members and methods from one class to another
class is known as inheritance. It is one of the fundamental features of object-oriented programming.

A class that is declared with abstract keyword, is known as abstract class.

abstract one which is containing some defined method and some undefined method. In java
programming undefined methods are known as un-Implemented or abstract method.The process of
obtaining the data members and methods from one class to another class is known as
inheritance. It is one of the fundamental features of object-oriented programming.

Types of Inheritance:-

• Single inheritance

• Multiple inheritance
• Hierarchical inheritance

• Multilevel inheritance

• Hybrid inheritance

Why use Inheritance ?

• For Method Overriding (used for Runtime Polymorphism).

• It's main uses are to enable polymorphism and to be able to reuse code for different classes
by putting it in a common super class

• For code Re-usability

19

1) Single Inheritance:-

Single inheritance is damn easy to understand. When a class extends another one class only
then we call it a single inheritance. The below flow diagram shows that class B extends only
one class which is A. Here A is a parent class of B and B would be a child class of A.
Single Inheritance example program in Java:-

Class A

public void methodA().

System.out.println("Base class method");

Class B extends A

public void methodB()

System.out.println("Child class method");

public static void main(String args[])

20

B obj = new B();

obj.methodA(); //calling super class method

obj.methodB(); //calling local method


}

2) Multiple Inheritance:-

“Multiple Inheritance” refers to the concept of one class extending (Or inherits) more than
one base class. The inheritance we learnt earlier had the concept of one base class or parent.
The problem with “multiple inheritance” is that the derived class will have to manage the
dependency on two base classes.

3) Multilevel Inheritance:-

Multilevel inheritance refers to a mechanism in OO technology where one can inherit from a
derived class, thereby making this derived class the base class for the new class. As you can
see in below flow diagram C is subclass or child class of B and B is a child class of A.

Example:-

Class X

public void methodX()

System.out.println("Class X method");

21

Class Y extends X

public void methodY()

{
System.out.println("class Y method");

Class Z extends Y

public void methodZ()

System.out.println("class Z method");.

public static void main(String args[])

Z obj = new Z();

obj.methodX(); //calling grand parent class method

obj.methodY(); //calling parent class method

obj.methodZ(); //calling local method

22

4) Hierarchical Inheritance:-

In such kind of inheritance one class is inherited by many sub classes. In below example
class B,C and D inherits the same class A. A is parent class (or base class) of B,C & D.

5) Hybrid Inheritance:-

In simple terms you can say that Hybrid inheritance is a combination of Single and Multiple
inheritance. A typical flow diagram would look like below. A hybrid inheritance can be
achieved in the java in a same way as multiple inheritance can be!! Using interfaces
Method Overloading:-

Whenever same method name is exiting multiple times in the same class with different number of
parameter or different order of parameters or different types of parameters is known as method
overloading.

Example method overloading:-In this example, we have created two methods that differs in data
type. The first add method receives two integer arguments and second add method receives two
double arguments.

class Adder{

static int add(int a, int b){return a+b;}

static double add(double a, double b){return a+b;}

class TestOverloading2{

23

public static void main(String[] args){

System.out.println(Adder.add(11,11));

System.out.println(Adder.add(12.3,12.6));

}}

Output:
22

24.9

Why method Overloading?Suppose we have to perform addition of given number but there can be
any number of arguments, if we write method such as a(int, int)for two arguments, b(int, int, int) for
three arguments then it is very difficult for you and other programmer to understand purpose or
behaviors of method they can not identify purpose of method. So we use method overloading to
easily figure out the program. For example above two methods we can write sum(int, int) and
sum(int, int, int) using method overloading concept.

Different ways to overload the method:-

There are two ways to overload the method in java

• By changing number of arguments or parameters

• By changing the data type

• By changing the order of arguments.


Method Overriding:-

Whenever same method name is existing in both base class and derived class with same types of
parameters or same order of parameters is known as method Overriding.

24

Advantage of Java Method Overriding:-

• Method Overriding is used to provide specific implementation of a method that is already


provided by its super class.

• Method Overriding is used for Runtime Polymorphism

Example of method overriding:-class Vehicle{

//defining a method
void run(){System.out.println("Vehicle is running");}

//Creating a child class

class Bike2 extends Vehicle{

//defining the same method as in the parent class

void run(){System.out.println("Bike is running safely");}

25

public static void main(String args[]){

Bike2 obj = new Bike2();//creating object

obj.run();//calling method

}
}

Output:

Bike is running safely

Interface:-

Interface is similar to class which is collection of public static final variables (constants) and
abstract methods.The interface is a mechanism to achieve fully abstraction in java. There can be
only abstract methods in the interface. It is used to achieve fully abstraction and multiple
inheritance in Java.

26

Why we use Interface ?

• It is used to achieve fully abstraction.

• By using Interface, you can achieve multiple inheritance in java.

When we use abstract and when Interface

If we do not know about any things about implementation just we have requirement specification
then we should be go for Interface

If we are talking about implementation but not completely (partially implemented) then we should
be go for abstract
Abstraction:-

Abstraction is the concept of exposing only the required essential characteristics and behavior with
respect to a context.

Hiding of data is known as data abstraction. In object oriented programming language this is
implemented automatically while writing the code in the form of class and object.

Real life example of Abstraction

Abstraction shows only important things to the user and hides the internal details for example
when we ride a bike, we only know about how to ride bike but can not know about how it work ?
and also we do not know internal functionality of bike.

Encapsulation:-Encapsulation is a process of wrapping of data and methods in a single unit is


called encapsulation. Encapsulation is achieved in java language by class concept.Combining of
state and behavior in a single container is known as encapsulation. In java language encapsulation
can be achieve using class keyword, state represents declaration of variables on attributes and
behavior represents operations in terms of method.

27

Benefits of encapsulation:-

• Provides abstraction between an object and its clients.

• Protects an object from unwanted access by clients.

• Example: A bank application forbids (restrict) a client to change an Account's balance

Polymorphism :-
The process of representing one form in multiple forms is known as Polymorphism.Here original
form or original method always resides in base class and multiple forms represents overridden
method which resides in derived classes.
Polymorphism is not a programming concept but it is one of the principal of OOPs. For many
objects oriented programming language polymorphism principle is common but whose
implementations are varying from one objects oriented programming language to another object
oriented programming language.

Polymorphism principal is divided into two sub principal they are:

1) Static Polymorphism also known as compile time polymorphism

2) Dynamic Polymorphism also known as runtime polymorphism

• 1.Compile time Polymorphism (or Static polymorphism):-

• Polymorphism that is resolved during compiler time is known as static polymorphism.


Method overloading is an example of compile time polymorphism.

• Method Overloading: This allows us to have more than one method having the same name, if
the parameters of methods are different in number, sequence and data types of parameters.
We have already discussed Method overloading.

28

Example of static Polymorphism:-

Method overloading is one of the way java supports static polymorphism.

class SimpleCalculator

{
int add(int a, int b)

return a+b;

int add(int a, int b, int c)

return a+b+c;

29

public class Demo

public static void main(String args[])


{

SimpleCalculator obj = new SimpleCalculator();

System.out.println(obj.add(10, 20));

System.out.println(obj.add(10, 20, 30));

Output:. 30 60

30

2.Runtime Polymorphism (or Dynamic polymorphism):-

It is also known as Dynamic Method Dispatch. Dynamic polymorphism is a process in which


a call to an overridden method is resolved at runtime, thats why it is called runtime
polymorphism.
Example:

class ABC{

public void myMethod(){

System.out.println("Overridden Method");

public class XYZ extends ABC{

31

public void myMethod(){

System.out.println("Overriding Method");

public static void main(String args[]){

ABC obj = new XYZ();


obj.myMethod();

Output

Overriding Method

32

Exception Handling:-

The process of converting system error messages into user friendly error message is known as
Exception handling. This is one of the powerful feature of Java to handle run time error and
maintain normal flow of java application.

An Exception is an event, which occurs during the execution of a program, that disrupts the normal
flow of the program's Instructions.

Type of Exception:-

• Checked Exception

• Un-Checked Exception
Hierarchy of Exception classes:-

Fig.1.4

33

Multithreading:-

Multithreading in java is a process of executing multiple threads simultaneously. The aim of


multithreading is to achieve the concurrent execution.
Thread

Thread is a lightweight components and it is a flow of control. In other words a flow of control is
known as thread.State of a thread are classified into five types they are

1. New State
2. Ready State
3. Running State
4. Waiting State
5. Halted or dead State
For example:-

public class GuruThread1 implements Runnable

public static void main(String[] args) {

Thread guruThread1 = new Thread("Guru1");

Thread guruThread2 = new Thread("Guru2");

guruThread1.start();

guruThread2.start();

System.out.println("Thread names are following:");

System.out.println(guruThread1.getName());

System.out.println(guruThread2.getName());

34

public void run() {

}.

String:-

String is a sequence of characters enclosed within double quotes (" ") is known as String.
Example: "Java Programming".
In java programming to store the character data we have a fundamental datatype called char.
Similarly to store the string data and to perform various operation on String data, we have three
predefined classes they are:

• String

• StringBuffer

• StringBuilder

For example:-

public class CompareToExample{

public static void main(String args[]){

String s1="hello";

35

String s2="hello";

String s3="hemlo";

String s4="flag";

System.out.println(s1.compareTo(s2)); // 0 because both are equal

System.out.println(s1.compareTo(s3)); //-1 because "l" is only one time lower than "m"

System.out.println(s1.compareTo(s4)); // 2 because "h" is 2 times greater than "f"

}}
Collection :-
Collections in java is a framework that provides an architecture to store and manipulate the group of
objects.All the operations that you perform on a data such as searching, sorting, insertion,
manipulation, deletion etc. can be performed by Java Collections.Java Collection simply means a
single unit of objects. Java Collection framework provides many interfaces (Set, List, Queue, Deque
etc.) and classes (ArrayList, Vector, LinkedList, PriorityQueue, HashSet, LinkedHashSet, TreeSet
etc).

36

PROJECTS UNDERTAKEN

Student Portal System (Admin Level) JAVA based with back-end controlled by JDBC.
Database Used: MySql
JDBC (Java Database Connectivity) is uses for connect java application with database. It is Java
SE technology, which is install automatically with the jdk software. Jdbc is an API (Application
programming interface) used to communicate Java application to database in database independent
and platform independent manner. It provides classes and interfaces to connect or communicate Java
application with database.

figure no.1.5
Input From User:

Student Id Student Name Branch


Father’s Name Mother’s Name Address

Date Of Birth Age Telephone No


Modules Provided:

Using Encrypted Password

 Add Records

 Display Records

 Update Records. 37

 Delete Records

 Search Records

 Exit.
39
CONCLUSION

Practical knowledge means the visualization of the knowledge, which we read in our books. For
this, we perform experiments and get observations. Practical knowledge is very important in every
field. One must be familiar with the problems related to that field so that he may solve them and
become a successful person.

After achieving the proper goal in life, an engineer has to enter in professional life.
According to this life, he has to serve an industry, may be public or private sector or self-own. For
the efficient work in the field, he must be well aware of the practical knowledge as well as
theoretical knowledge.

Due to all above reasons and to bridge the gap between theory and practical, our Engineering
curriculum provides a practical training of 30 days. During this period a student work in the industry
and get well all type of experience and knowledge about the working of companies and hardware and
software tools.

I have undergone my 30 days summer training in 10 th june at JAVAHUB TRANING CENTER


JAIPUR,TONK ROAD JAIPUR(Raj). This report is based on the knowledge, which I
acquired during my 30 days of summer training.

..

40

SUGGESTION AND RECOMMENDATION


After learning one month under this training program, the following are the suggestion and
recommendation which I would like to advice to the institute.

Writing to improve reading: To improve reading comprehension, constant writing can be used.
The pupils can identify relevant facts and list them on a sheet of pepar after reading a short
passage.

Improving motivation and interest shall provide opportunities to pupils to read materials they
cannot refuse. Use of a variety of reading activities to capture the pupils interests can encourage
the reading practice.

SUGGESION FOR FURTHER STUDY

The study suggests the need to conduct a series of allied studies that will complete the
perspective covered by the present study.

1. The studies similar to the present one can be replicated with large sample size and
methodological sophistication.

2. Apart from difficulties in basic language skills, behavioural symptoms unique to dyslexics
can be explored.

3. Remedial programmes for improving proficiency in basic language skills need to be


developed.

4.Error committed by dyslexics in other languages may also be studied.

41

.
REFERENCES

• OopS Concept by VIKASH SINGH

• Thinking In java(12nd edition)

• https://youtu.be/8cm1x4bC610

• Google Group-javatechzone

42

S-ar putea să vă placă și