SlideShare a Scribd company logo
INTRODUCTION OF JAVA
PRESENTED BY,
RANJITHAM.N
INTRODUCTION TO JAVA:
• Java was originally developed by James Gosling at Sun
Microsystems .
• It was released in 1995.
• Java applications are typically compiled to Bytecode that can run on
any Java Virtual Machine.
• The language derives much of its syntax from C and C++.
WHAT IS JAVA?
• Java is a computer programming language.
• It is concurrent and written in the concept of Class and Object.
• Purely Object oriented programming.
• Platform independent.
FEATURES OF JAVA:
• Simple
• Secure
• Portable
• Object oriented
• Multithreaded
• High performance
• Dynamic
• interpreted
APPLICATIONS OF JAVA:
• Java program can run on any PC or any operating system.
• Simple and Standalone.
• Mobile application.
• Enterprise.
• Web application
HOW JAVA DIFFER FROM C++:
JAVA PROGRAMMING C++ PROGRAMMING
• Completely object oriented language. • partially object oriented language.
• It is portable. • It is non portable.
• Both compiler and interpreter are
used.
• Only compiler is used.
• Pointer is not used in java. • Pointer is used in c++.
• no global variable is present. • Global variable is present.
• Operator overloading is not possible. • Operator overloading is possible.
• Scope resolution operator is used. • Scope resolution operator is used.
HOW JAVA DIFFER FROM C:
JAVA PROGRAMMING C PROGRAMMING
• Object oriented language. • Function oriented language.
• It is built into long security. • It has limited security.
• Allocating memory by memory
function.
• Allocation of memory by new
function.
• Memory address is through pointers. • Memory address is through reference.
OBJECT ORIETNED PROGRAMMING CONCEPTS:
• Object
• Class
• Data abstraction
• Data encapsulation
• Polymorphism
• Inheritance
• Dynamic binding
• Message communication
OBJECT:
• Basic runtime entity.
• Represent user defined datatype.
• Object interact by sending messages to one another.
CLASS:
• Collection of similar objects.
• User defined datatype.
• Eg: Fruit.
DATA ABSTRACTION:
• The act of representing essential feautures without including the
background details.
• Insulation of the data from direct access by the program is called as
data hiding.
DATA ENCAPSULATION:
• Wrapping up of data and methods into a single unit.
INHERITANCE:
• Objects of one class acquired the properties of objects of another
class.
• Supports the concepts of hierarchical classification.
• Provides the idea of reusability.
• Can add additional features to an existing class without modifying
it.
TYPES OF INHERITANCE:
• Single inheritance
• Multiple inheritance
• Multilevel inheritance
• Hierarchical inheritance
• Hybrid inheritance.
POLYMORPHISM:
• Ability to take more than one form.
• Exhibit different behaviour in different instances.
• Single function name can be used to handle different number an
different types of arguments.
TYPES:
• Dynamic polymorphism.
• Static polymorphism.
DYNAMIC BINDING:
• The code assosiated with the given procedure call is not known
until the time of the call at runtime.
• Assosiated with the polymorphism an inheritance.
• A procedure call associated with a polymorphic reference depends
on the dynamic type of the reference.
MESSAGE COMMUNICATION:
• Program consists of a set of objects that communicate with each
other.
Involves the following basic steps:
• creating classes that define objects and their behaviour .
• creating objects from class definition.
• establishing communications among objects.
DEFINING THE CLASS:
• Once the class type has been defined,we can create the variables.
• Variables are termed as instances of classes.
SYNTAX:
class classname [extends superclassname]
{
fields declaration;
method declaration;
}
METHODS:
• Methods are declared inside the body of the class.
• Methods that are necessary to manipulate the data
contained in the class.
SYNTAX:
type methodname (parameter_list)
{
method_body;
}
METHOD DECLARATION:
• The name of the methods(method name).
• The type of the value the method returns(type).
• A list of parameters(parameter_list).
• The body of the method.
public class Cse
{
public void show()
{
System.out.println("Sample Method ");
}
public static void main(String args[])
{
Cse obj=new Cse1();
obj.show();
}
}
PROGRAM FOR METHOD DECLARATION:
FINALIZER METHODS:
• Java supports a concept called Finalization.
• Java runtime is an automatic garbage collecting system.
• Automatically frees up the memory resources used by the objects.
SYNTAX
protected void finalize()
{
…
...
}
ACCESS SPECIFIERS:
• It is restrict the place where we are using the member of the
class.
• It is used to access the member.
THREE TYPES:
• private
• protected
• public
STATIC:
• Can be called without objects.
• Initialization is not necessary.
• Static function can access only the static variables.
PROGRAM:
class sample
{
public static void main(String[] args) {
display(); }
static void display() {
System.out.println(“hai hello");
} }
STATIC MEMBER:
• The member that are declared static as shown above are static
member.
• Gets memory only in class area at the time of class loading.
• Memory efficient.
Types of static member:
• static variable
• static method
• static block
STATIC MEMBER:
class math
{
Static float mul(float x.float y)
{
return x*y;
}
Static float div(float x,float y)
{
return x/y;
}
}
class math
{
public void static main(string args[])
{
float a=math.mul(4.0.5.0);
float b=math.div(a,2.0);
System.out.println(“b=“+b);
}
}
STATIC VARIABLE
• Gets memory only in class area at the time of class loading.
• Memory efficient.
Class Stu
{
int rollnumber;
string name;
Static string name=“ITS”
Stu( int r.string n)
{
rollnumber=r;
name=n;
}
Void display()
{
System.out.println(“+rollnumber+”
”+name+””+college+”);
}
Public Static void main (string args[])
{
Stu s1=new stu(111,”karan”);
Stu s1=new stu(222”priya”);
S1.display();
S2.display();
}
STATIC METHOD:
• It belongs to the class rare than the object of the class .
• Invoked without the need for creating a instance of class.
• It can access static data member and can change value of it.
class Calculate
{
Static int cube(int x);
return x*x*x;
}
STATIC BLOCK:
It is used to initialize the static data member.
Executed before main method at the time of class loading.
Program:
class cse
{
Static { system.out.println(“static block is invoked”);}
public static main(string args[]);
}
CONSTRUCTOR:
• It is a special method where will invoke automatically when the time
of object creation.
Rules:
• Constructor name and the class name should be same.
• It wont have any return type.
• It is used to assign the value to the instance variable.
• It can be with parameter or without parameter..
PROGRAM FOR CONSTRUCTORS:
public class Cube1 {
int length;
int breadth;
int height;
public int getVolume() {
return (length * breadth * height);
}
Cube1() {
length = 10;
breadth = 10;
height = 10;
}
Cube1(int l, int b, int h) {
length = l;
breadth = b;
height = h;
}
public static void main(String[]
args) {
Cube1 cubeObj1, cubeObj2;
cubeObj1 = new Cube1();
cubeObj2 = new Cube1(10, 20, 30);
System.out.println(”Volume of
Cube1 is : ” +
cubeObj1.getVolume());
System.out.println(”Volume of
Cube1 is : ” +
cubeObj2.getVolume());
}
Java

More Related Content

What's hot

[OOP - Lec 04,05] Basic Building Blocks of OOP
[OOP - Lec 04,05] Basic Building Blocks of OOP[OOP - Lec 04,05] Basic Building Blocks of OOP
[OOP - Lec 04,05] Basic Building Blocks of OOP
Muhammad Hammad Waseem
 
Java lec class, objects and constructors
Java lec class, objects and constructorsJava lec class, objects and constructors
Java lec class, objects and constructors
Jan Niño Acierto
 
Unit 3
Unit 3Unit 3
Java Methods
Java MethodsJava Methods
Java Methods
Rosmina Joy Cabauatan
 
Java OOP Programming language (Part 3) - Class and Object
Java OOP Programming language (Part 3) - Class and ObjectJava OOP Programming language (Part 3) - Class and Object
Java OOP Programming language (Part 3) - Class and Object
OUM SAOKOSAL
 
L7 inheritance
L7 inheritanceL7 inheritance
L7 inheritance
teach4uin
 
Ch03
Ch03Ch03
Data members and member functions
Data members and member functionsData members and member functions
Data members and member functions
Marlom46
 
Java class,object,method introduction
Java class,object,method introductionJava class,object,method introduction
Java class,object,method introduction
Sohanur63
 
Classes,object and methods java
Classes,object and methods javaClasses,object and methods java
Classes,object and methods java
Padma Kannan
 
Java OOP Programming language (Part 5) - Inheritance
Java OOP Programming language (Part 5) - InheritanceJava OOP Programming language (Part 5) - Inheritance
Java OOP Programming language (Part 5) - Inheritance
OUM SAOKOSAL
 
Chap01
Chap01Chap01
Chap01
Jotham Gadot
 
6. static keyword
6. static keyword6. static keyword
6. static keyword
Indu Sharma Bhardwaj
 
Unit3 inheritance
Unit3 inheritanceUnit3 inheritance
Unit3 inheritance
Kalai Selvi
 
Static keyword ppt
Static keyword pptStatic keyword ppt
Static keyword ppt
Vinod Kumar
 
Java static keyword
Java static keywordJava static keyword
Java static keyword
Lovely Professional University
 
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions Java basic part 2 : Datatypes Keywords Features Components Security Exceptions
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions
Soumen Santra
 
Java OO Revisited
Java OO RevisitedJava OO Revisited
Java OO Revisited
Jussi Pohjolainen
 
Object oriented programming With C#
Object oriented programming With C#Object oriented programming With C#
Object oriented programming With C#
Youssef Mohammed Abohaty
 
Week9 Intro to classes and objects in Java
Week9 Intro to classes and objects in JavaWeek9 Intro to classes and objects in Java
Week9 Intro to classes and objects in Java
kjkleindorfer
 

What's hot (20)

[OOP - Lec 04,05] Basic Building Blocks of OOP
[OOP - Lec 04,05] Basic Building Blocks of OOP[OOP - Lec 04,05] Basic Building Blocks of OOP
[OOP - Lec 04,05] Basic Building Blocks of OOP
 
Java lec class, objects and constructors
Java lec class, objects and constructorsJava lec class, objects and constructors
Java lec class, objects and constructors
 
Unit 3
Unit 3Unit 3
Unit 3
 
Java Methods
Java MethodsJava Methods
Java Methods
 
Java OOP Programming language (Part 3) - Class and Object
Java OOP Programming language (Part 3) - Class and ObjectJava OOP Programming language (Part 3) - Class and Object
Java OOP Programming language (Part 3) - Class and Object
 
L7 inheritance
L7 inheritanceL7 inheritance
L7 inheritance
 
Ch03
Ch03Ch03
Ch03
 
Data members and member functions
Data members and member functionsData members and member functions
Data members and member functions
 
Java class,object,method introduction
Java class,object,method introductionJava class,object,method introduction
Java class,object,method introduction
 
Classes,object and methods java
Classes,object and methods javaClasses,object and methods java
Classes,object and methods java
 
Java OOP Programming language (Part 5) - Inheritance
Java OOP Programming language (Part 5) - InheritanceJava OOP Programming language (Part 5) - Inheritance
Java OOP Programming language (Part 5) - Inheritance
 
Chap01
Chap01Chap01
Chap01
 
6. static keyword
6. static keyword6. static keyword
6. static keyword
 
Unit3 inheritance
Unit3 inheritanceUnit3 inheritance
Unit3 inheritance
 
Static keyword ppt
Static keyword pptStatic keyword ppt
Static keyword ppt
 
Java static keyword
Java static keywordJava static keyword
Java static keyword
 
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions Java basic part 2 : Datatypes Keywords Features Components Security Exceptions
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions
 
Java OO Revisited
Java OO RevisitedJava OO Revisited
Java OO Revisited
 
Object oriented programming With C#
Object oriented programming With C#Object oriented programming With C#
Object oriented programming With C#
 
Week9 Intro to classes and objects in Java
Week9 Intro to classes and objects in JavaWeek9 Intro to classes and objects in Java
Week9 Intro to classes and objects in Java
 

Similar to Java

Java2
Java2Java2
Core Java unit no. 1 object and class ppt
Core Java unit no. 1 object and class pptCore Java unit no. 1 object and class ppt
Core Java unit no. 1 object and class ppt
Mochi263119
 
Core Java unit no. 1 object and class ppt
Core Java unit no. 1 object and class pptCore Java unit no. 1 object and class ppt
Core Java unit no. 1 object and class ppt
Mochi263119
 
Java-Intro.pptx
Java-Intro.pptxJava-Intro.pptx
Java-Intro.pptx
VijalJain3
 
unit 2 java.pptx
unit 2 java.pptxunit 2 java.pptx
unit 2 java.pptx
AshokKumar587867
 
VB.net&OOP.pptx
VB.net&OOP.pptxVB.net&OOP.pptx
VB.net&OOP.pptx
BharathiLakshmiAAssi
 
Synapseindia reviews.odp.
Synapseindia reviews.odp.Synapseindia reviews.odp.
Synapseindia reviews.odp.
Tarunsingh198
 
Java 102 intro to object-oriented programming in java
Java 102   intro to object-oriented programming in javaJava 102   intro to object-oriented programming in java
Java 102 intro to object-oriented programming in java
agorolabs
 
C# classes objects
C#  classes objectsC#  classes objects
C# classes objects
Dr.Neeraj Kumar Pandey
 
Objective-C for iOS Application Development
Objective-C for iOS Application DevelopmentObjective-C for iOS Application Development
Objective-C for iOS Application Development
Dhaval Kaneria
 
Net framework
Net frameworkNet framework
Net framework
Abhishek Mukherjee
 
UNIT - IIInew.pptx
UNIT - IIInew.pptxUNIT - IIInew.pptx
UNIT - IIInew.pptx
akila m
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
Anil Kumar
 
9 cm604.14
9 cm604.149 cm604.14
9 cm604.14
myrajendra
 
Introduction to OOP with java
Introduction to OOP with javaIntroduction to OOP with java
Introduction to OOP with java
Sujit Kumar
 
10 - Encapsulation(object oriented programming)- java . ppt
10 - Encapsulation(object oriented programming)- java . ppt10 - Encapsulation(object oriented programming)- java . ppt
10 - Encapsulation(object oriented programming)- java . ppt
VhlRddy
 
C++ training
C++ training C++ training
C++ training
PL Sharma
 
Oops concept on c#
Oops concept on c#Oops concept on c#
RIBBUN SOFTWARE
RIBBUN SOFTWARERIBBUN SOFTWARE
RIBBUN SOFTWARE
mosewoodward24
 
Java01
Java01Java01

Similar to Java (20)

Java2
Java2Java2
Java2
 
Core Java unit no. 1 object and class ppt
Core Java unit no. 1 object and class pptCore Java unit no. 1 object and class ppt
Core Java unit no. 1 object and class ppt
 
Core Java unit no. 1 object and class ppt
Core Java unit no. 1 object and class pptCore Java unit no. 1 object and class ppt
Core Java unit no. 1 object and class ppt
 
Java-Intro.pptx
Java-Intro.pptxJava-Intro.pptx
Java-Intro.pptx
 
unit 2 java.pptx
unit 2 java.pptxunit 2 java.pptx
unit 2 java.pptx
 
VB.net&OOP.pptx
VB.net&OOP.pptxVB.net&OOP.pptx
VB.net&OOP.pptx
 
Synapseindia reviews.odp.
Synapseindia reviews.odp.Synapseindia reviews.odp.
Synapseindia reviews.odp.
 
Java 102 intro to object-oriented programming in java
Java 102   intro to object-oriented programming in javaJava 102   intro to object-oriented programming in java
Java 102 intro to object-oriented programming in java
 
C# classes objects
C#  classes objectsC#  classes objects
C# classes objects
 
Objective-C for iOS Application Development
Objective-C for iOS Application DevelopmentObjective-C for iOS Application Development
Objective-C for iOS Application Development
 
Net framework
Net frameworkNet framework
Net framework
 
UNIT - IIInew.pptx
UNIT - IIInew.pptxUNIT - IIInew.pptx
UNIT - IIInew.pptx
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
 
9 cm604.14
9 cm604.149 cm604.14
9 cm604.14
 
Introduction to OOP with java
Introduction to OOP with javaIntroduction to OOP with java
Introduction to OOP with java
 
10 - Encapsulation(object oriented programming)- java . ppt
10 - Encapsulation(object oriented programming)- java . ppt10 - Encapsulation(object oriented programming)- java . ppt
10 - Encapsulation(object oriented programming)- java . ppt
 
C++ training
C++ training C++ training
C++ training
 
Oops concept on c#
Oops concept on c#Oops concept on c#
Oops concept on c#
 
RIBBUN SOFTWARE
RIBBUN SOFTWARERIBBUN SOFTWARE
RIBBUN SOFTWARE
 
Java01
Java01Java01
Java01
 

Recently uploaded

KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
IJECEIAES
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
sachin chaurasia
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
171ticu
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
abbyasa1014
 
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEMTIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
HODECEDSIET
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
bijceesjournal
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Sinan KOZAK
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
wisnuprabawa3
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
mamamaam477
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
Yasser Mahgoub
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
JamalHussainArman
 
Casting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdfCasting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdf
zubairahmad848137
 

Recently uploaded (20)

KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
 
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEMTIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEM
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
 
Casting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdfCasting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdf
 

Java

  • 2. INTRODUCTION TO JAVA: • Java was originally developed by James Gosling at Sun Microsystems . • It was released in 1995. • Java applications are typically compiled to Bytecode that can run on any Java Virtual Machine. • The language derives much of its syntax from C and C++.
  • 3. WHAT IS JAVA? • Java is a computer programming language. • It is concurrent and written in the concept of Class and Object. • Purely Object oriented programming. • Platform independent.
  • 4. FEATURES OF JAVA: • Simple • Secure • Portable • Object oriented • Multithreaded • High performance • Dynamic • interpreted
  • 5. APPLICATIONS OF JAVA: • Java program can run on any PC or any operating system. • Simple and Standalone. • Mobile application. • Enterprise. • Web application
  • 6. HOW JAVA DIFFER FROM C++: JAVA PROGRAMMING C++ PROGRAMMING • Completely object oriented language. • partially object oriented language. • It is portable. • It is non portable. • Both compiler and interpreter are used. • Only compiler is used. • Pointer is not used in java. • Pointer is used in c++. • no global variable is present. • Global variable is present. • Operator overloading is not possible. • Operator overloading is possible. • Scope resolution operator is used. • Scope resolution operator is used.
  • 7. HOW JAVA DIFFER FROM C: JAVA PROGRAMMING C PROGRAMMING • Object oriented language. • Function oriented language. • It is built into long security. • It has limited security. • Allocating memory by memory function. • Allocation of memory by new function. • Memory address is through pointers. • Memory address is through reference.
  • 8. OBJECT ORIETNED PROGRAMMING CONCEPTS: • Object • Class • Data abstraction • Data encapsulation • Polymorphism • Inheritance • Dynamic binding • Message communication
  • 9. OBJECT: • Basic runtime entity. • Represent user defined datatype. • Object interact by sending messages to one another. CLASS: • Collection of similar objects. • User defined datatype. • Eg: Fruit.
  • 10. DATA ABSTRACTION: • The act of representing essential feautures without including the background details. • Insulation of the data from direct access by the program is called as data hiding. DATA ENCAPSULATION: • Wrapping up of data and methods into a single unit.
  • 11. INHERITANCE: • Objects of one class acquired the properties of objects of another class. • Supports the concepts of hierarchical classification. • Provides the idea of reusability. • Can add additional features to an existing class without modifying it.
  • 12. TYPES OF INHERITANCE: • Single inheritance • Multiple inheritance • Multilevel inheritance • Hierarchical inheritance • Hybrid inheritance.
  • 13. POLYMORPHISM: • Ability to take more than one form. • Exhibit different behaviour in different instances. • Single function name can be used to handle different number an different types of arguments. TYPES: • Dynamic polymorphism. • Static polymorphism.
  • 14. DYNAMIC BINDING: • The code assosiated with the given procedure call is not known until the time of the call at runtime. • Assosiated with the polymorphism an inheritance. • A procedure call associated with a polymorphic reference depends on the dynamic type of the reference.
  • 15. MESSAGE COMMUNICATION: • Program consists of a set of objects that communicate with each other. Involves the following basic steps: • creating classes that define objects and their behaviour . • creating objects from class definition. • establishing communications among objects.
  • 16. DEFINING THE CLASS: • Once the class type has been defined,we can create the variables. • Variables are termed as instances of classes. SYNTAX: class classname [extends superclassname] { fields declaration; method declaration; }
  • 17. METHODS: • Methods are declared inside the body of the class. • Methods that are necessary to manipulate the data contained in the class. SYNTAX: type methodname (parameter_list) { method_body; }
  • 18. METHOD DECLARATION: • The name of the methods(method name). • The type of the value the method returns(type). • A list of parameters(parameter_list). • The body of the method.
  • 19. public class Cse { public void show() { System.out.println("Sample Method "); } public static void main(String args[]) { Cse obj=new Cse1(); obj.show(); } } PROGRAM FOR METHOD DECLARATION:
  • 20. FINALIZER METHODS: • Java supports a concept called Finalization. • Java runtime is an automatic garbage collecting system. • Automatically frees up the memory resources used by the objects. SYNTAX protected void finalize() { … ... }
  • 21. ACCESS SPECIFIERS: • It is restrict the place where we are using the member of the class. • It is used to access the member. THREE TYPES: • private • protected • public
  • 22. STATIC: • Can be called without objects. • Initialization is not necessary. • Static function can access only the static variables. PROGRAM: class sample { public static void main(String[] args) { display(); } static void display() { System.out.println(“hai hello"); } }
  • 23. STATIC MEMBER: • The member that are declared static as shown above are static member. • Gets memory only in class area at the time of class loading. • Memory efficient. Types of static member: • static variable • static method • static block
  • 24. STATIC MEMBER: class math { Static float mul(float x.float y) { return x*y; } Static float div(float x,float y) { return x/y; } } class math { public void static main(string args[]) { float a=math.mul(4.0.5.0); float b=math.div(a,2.0); System.out.println(“b=“+b); } }
  • 25. STATIC VARIABLE • Gets memory only in class area at the time of class loading. • Memory efficient. Class Stu { int rollnumber; string name; Static string name=“ITS” Stu( int r.string n) { rollnumber=r; name=n; } Void display() { System.out.println(“+rollnumber+” ”+name+””+college+”); } Public Static void main (string args[]) { Stu s1=new stu(111,”karan”); Stu s1=new stu(222”priya”); S1.display(); S2.display(); }
  • 26. STATIC METHOD: • It belongs to the class rare than the object of the class . • Invoked without the need for creating a instance of class. • It can access static data member and can change value of it. class Calculate { Static int cube(int x); return x*x*x; }
  • 27. STATIC BLOCK: It is used to initialize the static data member. Executed before main method at the time of class loading. Program: class cse { Static { system.out.println(“static block is invoked”);} public static main(string args[]); }
  • 28. CONSTRUCTOR: • It is a special method where will invoke automatically when the time of object creation. Rules: • Constructor name and the class name should be same. • It wont have any return type. • It is used to assign the value to the instance variable. • It can be with parameter or without parameter..
  • 29. PROGRAM FOR CONSTRUCTORS: public class Cube1 { int length; int breadth; int height; public int getVolume() { return (length * breadth * height); } Cube1() { length = 10; breadth = 10; height = 10; } Cube1(int l, int b, int h) { length = l; breadth = b; height = h; } public static void main(String[] args) { Cube1 cubeObj1, cubeObj2; cubeObj1 = new Cube1(); cubeObj2 = new Cube1(10, 20, 30); System.out.println(”Volume of Cube1 is : ” + cubeObj1.getVolume()); System.out.println(”Volume of Cube1 is : ” + cubeObj2.getVolume()); }