2. INTRODUCTION OF JAVA
JAVA is a programming
language and a platform
independent language. Which
follow the concept of oops.
Platform independent that
means its byte code is able to run
in any o/s. It has own (JRE) java
runtime environment.divas007developer@gmail.com 2
3. The green project begain in
1991.
Original language name : OAK.
Name changed to java.
First public release in 1995.
Write once run everywhere.
HISTORY OF JAVA
4. JAVA IS USED.
There are many devices where java
is currently used . Some of them
are as follows:-
Desktop application
such as acrobat
reader, media player,
antivirus etc.
Web application
such as irctc.co.in,
java.com etc.
Enterprises application
such as banking
application, mobile
embedded system, Smart
card Robotics, Games etc.
divas007developer@gmail.com 4
5. FEATURES OF JAVA
Simple
Object Oriented
Dynamic
Secured
High performance
MultithreadedRobust
Architecture neutral
Portable
Distributed
JAVA
divas007developer@gmail.com 5
6. •System is based on c++ .
•Removed many confusing
and/or rarely used feature. Ex
:- pointer, operator
overloading etc.
•No need to remove
unreferenced objects
because there is automatic
garbage collection in java.
JAVA
language
is simple
because :-
SIMPLE
divas007developer@gmail.com 6
10. In JAVA , there is no use of pointer
that’s why JAVA is secure.
Because no one interacts with there
memory access so there is no chance to
hack or destroy our data from hacker.
SECURED
divas007developer@gmail.com
10
11. It means java program execute in
any platform it is not depend
upon any particular
platform(architec) . Like:-
windows, mac, sun solaris etc.
ARCHITECTURE NEUTRAL
divas007developer@gmail.com 11
12. Robust simply means Error tolerance.
Java uses strong memory management.
There are lack of pointer that avoids security problem.
There is automatic garbage collection in java.
There is exception handling and type checking mechanism in java.
All these points makes java robust.
ROBUST
divas007developer@gmail.com
12
13. We can carry the java
byte code to any
platform.
divas007developer@gmail.com 13
PORTABLE
14. Java is faster than traditional
interpreter or compiler. Because
its 80 % syntax is based on c , c++
which is directly interact with o/s.
divas007developer@gmail.com 14
High performance
15. We can create distributed applications in java.
Distributed computing involves several computer on a
network working working together.
Java is designed to make distributed computing easy with
the networking capability that is inherently integrated
into it.
divas007developer@gmail.com 15
Distributed
17. JAVA programs are compiled into byte code
that can be stored on any type machine.
Interpreted is used to read byte code and
execute it.
divas007developer@gmail.com 17
INTERPRETED
18. A thread is like a separate program executing
concurrently.
We can write java program that deal with many task at
once by defining multiple thread.
The main advantage of multi-threading is that if shares
the same memory. Thread are important for multimedia,
web-application etc.
divas007developer@gmail.com 18
Multi-threaded
19. divas007developer@gmail.com 19
First java program in java
class simple
{
Public static void main(String args[])
{
System.out.Println(“Hello java”);
}
}
Save the file as simple.java
To compile:- javac simple.java
To run:- java simple
Out put :- Hello java
20. Open command prompt
Copy the path of bin folder
Write in command prompt
Set path= copied path
ex:- set path = C:Program FilesJavajdk1.7.0_25bin;.;
divas007developer@gmail.com 20
Set the temporary path of jdk
we need to follow these steps:-
21. •Local variable
•Instance variable
•Static variable
Variable is a
name of
memory
location.
There are
three types of
variable.divas007developer@gmail.com 21
Variable in java
23. Local variable:- A variable that is declare inside the
method is called local variable. Local variable must be
initialized.
Instance variable:- A variable that is declared inside the
class but outside the method is called instance variable
.it is not declared as static.
Static variable:- A variable that is declared as static is
called static variable. It can’t be local.
divas007developer@gmail.com 23
Types of variable
24. divas007developer@gmail.com 24
Class test
{
Int x; //instance variable
Static int y; //static variable
Void sum() {int x=5;} //local variable
Public static void main(String args[])
{
System.out.Println(“Example of variable”);
}
}
//static method
Variable example