21
[1 ]

java concepts

Embed Size (px)

DESCRIPTION

this ppt will give u brief introduction about core java.

Citation preview

Page 1: java concepts

[1]

Page 2: java concepts

[2]

CONTENTS: History Featurs of Java JDK & JRE, Bytecode & JVM Classes and objects Inheritance & Interfaces Multithreading Applets Advantages & Disadvantages

Page 3: java concepts

HISTORY OF JAVA

Developed by Sun microsystems (U.S.) in 1991. Was designed for development of software for electronic devices. A team headed by James Gosling was formed to undertake this

task. OOPs Language C++ was explored resulting in new language ‘Oak’. This team, The Green Project Team, demonstrated an application to

control home appliances using hand held touch screen device in 1992.

In 1993, with www, this team game up with the idea of developing web Applets using this language, to run on all types of connected computers.

In 1994, the team developed ‘Hot Java’ browser. Oak was renamed to JAVA in 1995, due to legal snags. By the time of 1996, java established itself as a leader of Internet

Programming and a general purpose OOPs language.

[3]

Page 4: java concepts

FEATURES OF JAVA Simple Truly Object Oriented Platform Independent Distributed Interpreted Secure Robust Multithreaded

[19]

Page 5: java concepts

JDK AND JRE

• Java Runtime Environment (JRE) includes no of development tools , classes and methods.

• Java Development Kit (JDK) is collection of tools used for developing and running programs. This includes: Appletviewer: enables us to run Applets (without

browser). Java: interpreter, reads bytecode files, runs Applets and

applications. Javac: compiler, translates source code to byte code files,

that is readable by interpreter. Jdb: java debugger

[4]

Page 6: java concepts

BYTE CODE & JVM

A program exists in two forms: source code & object code.

The program written in editor is source code. Executable form of this code is called as object code. Java compiler generates an object file containing

bytecode. This bytecode is executable on any specific CPU. Java Virtual Machine (jvm) is a virtual machine, that

can execute this bytecode using interpreter.

[5]

Page 7: java concepts

JavaProgram

JavaCompiler

JavaVirtual

Machine

PROCESS OF COMPILING

BytecodeJava

Interpreter

MachineCode

CONVERSION OF BYTECODE INTO MACHINE CODE

[6]

Page 8: java concepts

Java Runtime Environment (JRE)

Java API Class JVM

Operating System(Windows, Linux etc)

Hardware

[7]

Page 9: java concepts

CLASSES & OBJECTS

An object is a bundle of related state and behavior.

Software objects are used to model real world objects.

A collection of objects is known as Class. Classes can be considered as a blueprint

from which objects are derived.

e.g. the statement fruit mango creates an object mango of class fruit

[8]

Page 10: java concepts

A SIMPLE HELLO WORLD PROGRAM

class HelloWorldApp{ public static void main (String args[])

{System.out.println(“Hello World”);}

}

[9]

Page 11: java concepts

INHERITANCE

Enables user to derive new classes from existing ones.

Class derived from other class is called Subclass (also as derived class, extended class or child class)

Class getting derived is known as Superclass (also a base class or a parent class)Syntax :

class subclassname extends superclassname { variables declaration;

methods declaration;}

[10]

Page 12: java concepts

EXCEPTION HANDLING

It is a customary way to indicate abnormal condition.

A method encountering abnomalities, thows an exception.

Exceptions are caught by handlers. Handlers these are positioned along method

invocation stack.

[12]

Page 13: java concepts

Throwable

Exception Error

InterruptedException Runtime

Exceptions

Thread Death

Throwable Family

[13]

Page 14: java concepts

MULTITHREADING

It is a specialised form of multitasking A thread is similar to a program with single

flow of control. A thread can be considered as a subprogram. Each thread runs parallel to each other. Java Interpreter handles switching of control

between threads such that they seem to run concurrently.

[14]

Page 15: java concepts

APPLETS

These are small programs used in Internet Computing.

Can be transferred over internet from system to system.

Can run anywhere using Applet Viewer or any Java enabled browser.

Applets are not full featured or stand alone programs.

They run inside web page using HTML tags. Used for graphics, sounds play, arithematic

operations, accept user input, animations, interactive games etc

[16]

Page 16: java concepts

WHAT CAN JAVA TECHNOLOGY DO?

Development Tools Application Programming Interface (APIs) Deployment Technologies User Interface Toolkits Integration Libraries

[18]

Page 17: java concepts

ADVANTAGES:

Page 18: java concepts

DISADVANTAGES

Slow Performance (10 to 20 times slower than c++)

Compiling takes time Too much error checking Interpreter takes time too

• Memory management is expensive.

• Java being a high level language, does not offers freedom to use on embedded systems.

Page 19: java concepts

REFERENCES: Mrs.Faiyaz Alam, Appin, Alwar Core Java Study Materials, Appin Programming With Java book by

E.Balaguruswami Java Programming book by Vikash Thada

[21]

Page 20: java concepts

[22]

Page 21: java concepts

THANK YOU ALL

[23]