java presentation

19

Upload: programming-talents

Post on 09-Jan-2017

23 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Java presentation
Page 2: Java presentation

What is java?Java is a programming language and a platform.

"Write once, run anywhere" (WORA), or sometimes “write once, run everywhere” (WORE), is a slogan created by Sun Microsystems to illustrate the cross-platform benefits of the Java language.

This language was developed at SUN Microsystems in the year 1995 under the guidance of James Gosling and team.

Platform: Any hardware or software environment in which a program runs, is known as a platform. Since Java has its own runtime environment (JRE) and API, it is called platform.

Page 3: Java presentation

Features of Java

1- Simple

2- Object-Oriented

3- Platform independent

4- Secured

5- Robust

6- Architecture neutral

7- Portable

8- Dynamic

9- Interpreted

10- High Performance

11- Multithreaded

12- Distributed

Page 4: Java presentation

Software & tools required

Software & Tools-

1- Linux 7.1 or Windows xp/7/8 operating system

2- Java JDK 8

3- Microsoft Notepad or any other text editor

4- Eclipse or NetBeans .

Page 5: Java presentation

JVM , JDK & JRE

Page 6: Java presentation

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 JVM is different.● JVM, JRE and JDK are platform dependent because configuration of each OS

differs. But, Java is platform independent.

Page 7: Java presentation

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.

Page 8: Java presentation

JDK

● The Java Development Kit (JDK) is primary components.

● It physically exists. ● It is collection of programming tools

and JRE, JVM.

Page 9: Java presentation

Copy this path and set it as PATH in user variables

Setting Up of Environment

Page 10: Java presentation

Environment Setup

1- goto- Control Panel>System and Security>System. 2- click on Advance System Settings tab on left sidebar. 3- It will open System Properties tab and click on Advanced tab.4- Bottom|Right has Environment Variable Button, click on it. 5- Set PATH in User variables and Set JAVA_HOME in System variables .

1st

2nd

Page 11: Java presentation

Where JAVA is used?

● Desktop Applications such as acrobat reader, media player, antivirus etc.● Web Applications such as irctc.co.in, javatpoint.com etc. ● Enterprise Applications such as banking applications. ● Mobile ● Embedded System ● Smart Card ● Robotics ● Games etc.

Page 12: Java presentation

Types of JAVA Application There are mainly 4 type of applications that can be created using java programming:

1- Standalone Application- Antivirus, Media Player etc.

2- Web Application- JSP, Servlets etc. used to make web application

3- Enterprise Application- JAVA EE at business tier

4- Mobile Application. Android and JAVA ME.

Page 13: Java presentation

First Program “Hello World”1- open text editor and write first program

2- Save it as Hello.java

3- Open command prompt or terminal .

4- Go to the file and to compile code write

“javac Hello.java” command.

5- to run “java Hello”.

class Hello {

public static void main (String args[])

{

System.out.println("Hello JAVA");

}

}

Page 14: Java presentation

Compile and Execute

Page 15: Java presentation

Class in JAVA “class is the only logical entity.”

Class: Class is a blueprint 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:

1- Data Member, 2- Method, 3- Constructor

4- Block, 5- Class and 6- Interface

Page 16: Java presentation

Object in JAVA “Object is the physical as well as logical entity.”

Object: Object is an instance of class, object has state and behaviors.

An Object in java has three characteristics:

1- State 2- Behavior 3- Identity

State: Represents data (value) of an object.

Behavior: Represents the behavior (functionality) of an object

Identity: Object identity is typically implemented via a unique ID.

Page 17: Java presentation

Real Life example of Object and class.

Class: vehicle

Object: car, bus, bike, truck are object of vehicle class.

State: Color, Model,speed

Behaviour: Travelling

Identity: unique number

Page 18: Java presentation

“Variable is a name of memory location or name of reserved area allocated in memory.”There are three types of variables in java 1- local variable ` 2- instance variable 3- static variable

A variable that is declared inside the method is called local variable. A variable that is declared inside the class but outside the method is called instance variable . It is not declared as static. A variable that is declared as static is called static variable. It cannot be local.

Variables and Datatypes in JAVA

Page 19: Java presentation

DATA Types

Basically two types of data type : Primitive

&Non-Primitive