1. SUMMER TRAINING PRESENTATION ON
“JAVA TECHNOLOGY”
PRESENTED TO:- PRESENTED BY:-
MR.K.K.BHARGAV(HOD) SHARAD SONI
SHUBHAM GARG
TARUN KARORA
VEDPRAKASH SHARMA
2. Index:--
What is JAVA?
What is OOP?
Why Java?
Characteristics of JAVA.
Java on Web.
Java Packages.
Disadvantages of java.
A Simple JAVA Program.
Project Work
3. What is JAVA?
JAVA is an OBJECT-ORIENTED LANGUAGE designed to produce programs
that will run on any computer system.it focuses the philosophy “write once
run anywhere” meaning the compiled java code can run on all platforms that
supports java without the need of recompilation.
There are two kinds of java programs;
1.Applets :- programs that are embedded within a webpage
2.Application programs :- programs for specific application & run on
any machine that supports java.it is of two types:-
1.Console applications:-programs that supports
input output in text format.
2.GUI applications:-programs that can create and
manage multiple windows and
provides GUI based mechanism
of window based programs
4. What is OOP ??
Object-Oriented Programming is a method of
implementation in which programs are organized as cooperative
collections of objects, each of which represents an instance of
some class, and whose classes are all members of one or more
hierarchy of classes united via inheritance relationships.
5. Principles of OOP…
There are three main features of OOPS.
1) Encapsulation
2) Inheritance
3) Polymorphism
Let’s we discuss about the about features in details.
6. Encapsulation…
Encapsulation means putting together all the variables and the methods into
a single unit called Class. It also means hiding data and methods within an
Object. Encapsulation provides the security that keeps data and methods safe
from inadvertent changes.
Advantages of Encapsulation
1. Protection(read-only write-only)
2. Control over the data
7. Inheritance…
An important feature of object-oriented programs is inheritance— the
ability to create classes that share the attributes and methods of
existing classes, but with more specific features. Inheritance is mainly
used for code reusability.
“In general one line definition we can tell that deriving a new class from
existing class, is called as Inheritance”.
8. Polymorphism…
Polymorphism is an object-oriented programming concept that refers
to the ability of a variable, function or object to take on multiple forms.
A language that features polymorphism allows developers to program
in the general rather than program in the specific.
2 ways to implement polymorphism.
1. Static Polymorphism (compile time)
2. Dynamic Polymorphism (run time)
9. Static Polymorphism…
Compile time polymorphism is nothing but the method overloading
in java. In simple terms we can say that a class can have more than
one methods with same name but with different number of arguments
or different types of arguments or order of argument must be different.
Means a class can contain any number of methods with same name
as long as their signatures are different
10. Runtime Polymorphism…
Method overriding is a perfect example of runtime polymorphism. In this
kind of polymorphism, reference of class X can hold object of class X or an
object of any sub classes of class X.
For e.g.
If class Y extends class X then both of the following statements are valid:
Y obj = new Y();
Parent class reference can be assigned to child object X obj = new Y();
11. Why Java…
An Object oriented programming language developed in the early ‘90s.
The language itself takes much of its syntax from C and C++ but has a
simpler object model and eliminates low-level tools.
It is platform independent. Early implementations of Java had the slogan:
“write once, run anywhere”
It has a system of automatic memory management.
12. Java, Web, and Beyond…
Java Applets
Java Web Applications
Java can also be used to develop applications for hand-held
devices such as Palm and cell phones
13. Characteristics of Java…
•Java Is Simple
•Java Is Object-Oriented
•Java Is Distributed
•Java Is Interpreted
•Java Is Secure
•Java Is Architecture-Neutral
•Java Is Portable
•Java's Performance
•Java Is Multithreaded
•Java Is Dynamic
14. Java Disadvantages…
Slower than compiled language such as C
An experiment in 1999 showed that Java was 3 or 4 times slower
than C or C++
Need to install JVM for deployment platforms
15. Java Packages…
A package is named direction of classes the purpose of grouping classes in
a package is to make it easy to add classes in a package into our program
code. Every class in java is contained in package.in short they are the place
where we store the files of java.
We can add classes from package to our program as shown below:
Import package name;
Packages are used to store classes in organized way & to resolve name
conflicts.
Java packages provide access protection.
Examples of Inbuilt packages are lang,io,awt,util etc.
17. Java life cycle…
Java programs normally undergo four phases
• Edit
Programmer writes program (and stores program on
disk)
• Compile
Compiler creates byte-codes from program (.class)
• Load
Class loader stores byte-codes in memory
• Execute
Interpreter: Translates byte-codes into machine language
18. Simple Java Program…
This program prints Welcome to Java!
public class Welcome
{
public static void main(String[] args)
{
System.out.println("Welcome to Java!");
}
}
Output
19. Project Work….
I have made the simple “Text Editor” using Java which is shown below. This
editor works same like the Windows Notepad to some extent. In this I have
made the used of anonymous class concept, event handling concept & other
utility classes also…