Java Basics

Post on 06-May-2015

636 views 2 download

description

A brief basics of java.

Transcript of Java Basics

JAVA PROGRAMMI

NGPresented By:Ramkrishna Mishra5910428ECE, 7th Sem

INTRODUCTION TO JAVA

Developed by Sun Microsystems in 1991.

A Programming language.Successor to C++.Based on OOPS.A development environment

Features of java1. Compiled and Interpreted

2. Platform Independent and portable3. Object- oriented4. Robust and secure5. Distributed6. Familiar, simple and small7. Multithreaded and Interactive8. High performance9. Dynamic and Extensible

HOW TO WRITE A

PROGRAM IN JAVA

class Rk{ public static void main(String args[]) { System.out.println(“Hello”); } }

An Example

Save this file as “Rk.java”.Open command prompt.Go to that folder through “cd FolderName”.Compiled the program with keyword “javac Rk.java”If any error is found, it’ll indicate.Run the program with keyword “java Rk”.

OOPS CONCEPT

Features of OOPS1. Class 2. Object3. Data abstraction4. Data encapsulation5. Inheritance6. Polymorphism

CLASSA class is the blueprint from which individual objects are created.

OBJECTObjects are entities of class.

DATA ABSTRACTIONData hiding technique is called

data abstraction.Access modifiers are used.

DATA ENCAPSULATIONBinding up data member and number function.

INHERITANCEIt can be defined as the process where one object acquires the properties of another.

POLYMORPHISMPolymorphism is the ability of an object to take on many forms.

WHAT ARE EXCEPTION?

When an error occurs within a method, the method creates an object and hands it off to the runtime system. The object, called an exception object, contains information about the error.

TYPES OF EXCEPTION

TRYCATCHTHROWTHROWSFINALLY

MULTITHREADING•Multithreading is a process of executing multiple threads simultaneously.

•A thread is a lightweight sub-process, a smallest unit of processing.

FOR LISTENING..:)

THANK YOU