SlideShare ist ein Scribd-Unternehmen logo
1 von 25
A Brief Introduction…
Submitted by-
Dilip Kumar Jangir
Branch-Information Technology
Roll No.-12EARIT019
What is Java?
 Java is a general purpose, high-level programming language developed
by Sun Microsystems.
 A small team of engineers, known as the Green Team, initiated the
language in 1991.
 Java was originally called OAK, and was designed for handheld devices
and set-top boxes.
 Today, Java is a commonly used foundation for developing and delivering
content on the Web.
Characteristics of Java
Java is-
 Simple.
 Object-oriented.
 Distributed.
 Interpreted.
 Robust.
 Secure.
 Architecture-neutral.
 Portable.
 Multithreaded.
 Dynamic.
Java Virtual Machine(JVM)
 Java is both compiled and interpreted.
 Source code is compiled into Java bytecode.
 Which is then interpreted by the Java Virtual Machine (JVM).
 Therefore bytecode is machine code for the JVM.
 Java bytecode can run on any JVM, on any platform including mobile
phones and other hand-held devices.
 Networking and distribution are core features.
 Makes Java very good for building networked applications, server side components,
 In other languages these are additional APIs.
Features of JVM
 The Garbage Collector
 Runs in the background and cleans up memory while application is running.
 Java manages memory for you, the developer has no control over the allocation of
memory (unlike in C/C++).
 This is much simpler and more robust (no chance of memory leaks or corruption).
 The Just In Time compiler (JIT)
 Also known as “Hot Spot”.
 Continually optimises running code to improve performance.
 Can approach the speed of C++ even though its interpreted.
(Cont.)Features of JVM
 Security
 Java offers very fine control over what an application is allowed to do.
 E.g. Read/write files, open sockets to remote machines, discover information about the
users environment, etc.
 Used in Java Applets to create a “sandbox”. Stops a rogue applet attacking your machine.
 Makes Java very safe, an important feature in distributed systems.
 Class Loading
 Loading of bytecode into the virtual machine for execution.
 Code can be read from a local disk, over a network, or the Internet.
 Allows downloading of applications and applets on the fly.
Versions of Java
 JDK Alpha and Beta(1995)
 JDK 1.0(January 23,1996)
 JDK 1.1(February 19,1997)
 J2SE 1.2(December 8,1998)
 J2SE 1.3(May 8,2000)
 J2SE 1.4(February 6,2002)
 J2SE 5.0(September 30,2004)
 J2SE 6.0(December 11,2006)
 J2SE 7.0(July 28,2011)
 J2SE 8.0(March 18,2014)
 J2SE 9.0 & 10.0 are scheduled to release in 2016 & 2018 respectively.
Data Types
In Java, there are two categories of data types-
1. Primitive Data Types 2. Non-Primitive Data Types
Data Type Default Type Default Size
boolean False 1 bit
char ‘u0000’ 2 byte
byte 0 1 byte
short 0 2 byte
int 0 4 byte
long 0L 8 byte
float 0.0f 4 byte
double 0.0d 8 byte
Naming Conventions
Java Naming Convention is a rule to follow as you decide what to name your
identifiers such as class, package, variable, constant, method, etc.
Name Conventions
Class Name Should start with uppercase letter and be a noun e.g. String,
Colour, Button, Thread, etc.
Interface Name Should start with uppercase letter and be an adjective e.g.
Runnable, ActionListener, etc.
Method Name Should start with lowercase letter and be a verb e.g.
actionPerformed(), main), println(), etc.
Variable Name Should start with lowercase letter e.g. forstName, orderNumber,
etc.
Package Name Should be in lowercase letter e.g. java, lang, sql,util, etc.
Constant Name Should be in uppercase letter e.g. RED, YELLOW,
etc.
Java OOP’s Concept
 Object Oriented Programming is a paradigm that provides many
concepts such as inheritance, data binding, polymorphism etc.
 Java concepts-
 Object
 Class
 Inheritance
 Polymorphism
 Abstraction
 Encapsulation
Object
 An entity that has state and behavior is known as an object e.g. chair,
bike, marker, pen, table, car etc.
 An object has three characteristics:
 State- represents data(value) of an object.
 Behaviour- represents the behaviour (functionality) of an object such
as deposit, withdraw, etc.
 Identity- Object identity is typically implemented via a unique ID. The
value of the ID is not visible to the external user but, it is used
internally by the JVM to identify each object uniquely.
 Object is an instance of a class.
Class
 A class is a group of objects that has common properties. It is a template
or blueprint from which objects are created.
 A class in java can contain-
 Data member
 Method
 Constructor
 Block
 Class and interface
 By default, all data members and methods are private in Java.
Example of Class
class Student{
int age;
String name;
void printData(){
System.out.println(“Name:”+name+”nAge:”+age);
}
public static void main(String args[]){
Student st=new Student();
st.name=“John”;
st.age=22;
st.printData();
}
}
Inheritance
 Inheritance in java is a mechanism in which one object acquires all the
properties and behaviors of parent object.
 The idea behind inheritance in java is that you can create new classes
that are built upon existing classes.
 Inheritance represents the IS-A relationship, also known as parent-
child relationship.
 It provides the mechanism of usability of code.
 The extends keyword is used to derive a new class from existing class.
Types of Inheritance
 Single
 Multilevel
 Hierarchical
 Java does not support Multiple Inheritance because it creates the
ambiguity in the program.
Polymorphism
 Polymorphism in java is a concept by which we can perform a single action by
different ways. Polymorphism is derived from 2 greek words: poly and morphs.
 The word "poly" means many and "morphs" means forms. So polymorphism
means many forms.
 There are two types of polymorphism in java:
 Compiletime Polymorphism
 Runtime Polymorphism
 We can perform polymorphism in java by method overloading and method
overriding.
Method Overloading
 If a class have multiple methods by same name but different parameters,
it is known as Method Overloading.
 Method overloading increases the readability of the program.
 There are two ways to overload the method in java:
 By changing number of arguments.
 By changing the data types.
Method Overriding
 If subclass (child class) has the same method as declared in the parent
class, it is known as method overriding in java.
 Usages-
 Method overriding is used to provide specific implementation of a
method that is already provided by its super class.
 Method overriding is used for runtime polymorphism
 Rules-
 method must have same name as in the parent class
 method must have same parameter as in the parent class.
 must be IS-A relationship (inheritance).
Abstraction
 Abstraction is a process of hiding the implementation details and
showing only functionality to the user.
 Another way, it shows only important things to the user and hides the
internal details.
 For example sending SMS, you just type the text and send the message.
You don't know the internal processing about the message delivery.
 Abstraction lets you focus on what the object does instead of how it does
it.
Encapsulation
 Encapsulation in java is a process of wrapping code and data together
into a single unit, for example capsule i.e. mixed of several medicines.
 We can create a fully encapsulated class in java by making all the data
members of the class private.
 Advantages:
 By providing only setter or getter method, you can make the
class read-only or write-only.
 It provides you the control over the data.
 The Java Bean class is the example of fully encapsulated class.
MySQL
 The most popular Open Source Relational SQL database management system.
 One of the best RDBMS being used for developing web-based software
applications.
 Uses a standard form of the well-known SQL data language, works on many
operating systems and with many languages including PHP, PERL, C, C++, JAVA,
etc.
Online Exam
System
Java PPT
Java PPT
Java PPT

Weitere ähnliche Inhalte

Was ist angesagt?

Java Presentation
Java PresentationJava Presentation
Java Presentationpm2214
 
Presentation on Core java
Presentation on Core javaPresentation on Core java
Presentation on Core javamahir jain
 
Introduction to java
Introduction to java Introduction to java
Introduction to java Sandeep Rawat
 
Introduction to java (revised)
Introduction to java (revised)Introduction to java (revised)
Introduction to java (revised)Sujit Majety
 
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...Edureka!
 
Core Java
Core JavaCore Java
Core JavaNA
 
Introduction to java
Introduction to java Introduction to java
Introduction to java Java Lover
 
Why java is important in programming language?
Why java is important in programming language?Why java is important in programming language?
Why java is important in programming language?NexSoftsys
 
Advance Java Topics (J2EE)
Advance Java Topics (J2EE)Advance Java Topics (J2EE)
Advance Java Topics (J2EE)slire
 
Introduction to Java Programming Language
Introduction to Java Programming LanguageIntroduction to Java Programming Language
Introduction to Java Programming Languagejaimefrozr
 
Introduction to Java -unit-1
Introduction to Java -unit-1Introduction to Java -unit-1
Introduction to Java -unit-1RubaNagarajan
 
The Evolution of Java
The Evolution of JavaThe Evolution of Java
The Evolution of JavaFu Cheng
 

Was ist angesagt? (20)

core java
core javacore java
core java
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
 
Java Presentation
Java PresentationJava Presentation
Java Presentation
 
Presentation on Core java
Presentation on Core javaPresentation on Core java
Presentation on Core java
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
Introduction to java (revised)
Introduction to java (revised)Introduction to java (revised)
Introduction to java (revised)
 
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...
Java Training | Java Tutorial for Beginners | Java Programming | Java Certifi...
 
Java Introduction
Java IntroductionJava Introduction
Java Introduction
 
Introduction to JAVA
Introduction to JAVAIntroduction to JAVA
Introduction to JAVA
 
Core Java
Core JavaCore Java
Core Java
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
Maven Introduction
Maven IntroductionMaven Introduction
Maven Introduction
 
JNDI
JNDIJNDI
JNDI
 
Why java is important in programming language?
Why java is important in programming language?Why java is important in programming language?
Why java is important in programming language?
 
Advance Java Topics (J2EE)
Advance Java Topics (J2EE)Advance Java Topics (J2EE)
Advance Java Topics (J2EE)
 
Introduction to Java Programming Language
Introduction to Java Programming LanguageIntroduction to Java Programming Language
Introduction to Java Programming Language
 
Java 8 features
Java 8 featuresJava 8 features
Java 8 features
 
Features of java
Features of javaFeatures of java
Features of java
 
Introduction to Java -unit-1
Introduction to Java -unit-1Introduction to Java -unit-1
Introduction to Java -unit-1
 
The Evolution of Java
The Evolution of JavaThe Evolution of Java
The Evolution of Java
 

Ähnlich wie Java PPT

Introduction to java
Introduction to javaIntroduction to java
Introduction to javaSujit Majety
 
PROGRAMMING IN JAVA unit 1.pptx
PROGRAMMING IN JAVA unit 1.pptxPROGRAMMING IN JAVA unit 1.pptx
PROGRAMMING IN JAVA unit 1.pptxSeethaDinesh
 
Classes and Objects
Classes and ObjectsClasses and Objects
Classes and Objectsvmadan89
 
A seminar report on core java
A  seminar report on core javaA  seminar report on core java
A seminar report on core javaAisha Siddiqui
 
Basic Java Programming
Basic Java ProgrammingBasic Java Programming
Basic Java ProgrammingMath-Circle
 
Learning java from scratch
Learning java from scratchLearning java from scratch
Learning java from scratchActonRoy
 
Java OOP Concept
Java OOP ConceptJava OOP Concept
Java OOP ConceptNikitaGour5
 
A CASE STUDY JAVA IS SECURE PROGRAMMING LANGUAGE
A CASE STUDY  JAVA IS SECURE PROGRAMMING LANGUAGEA CASE STUDY  JAVA IS SECURE PROGRAMMING LANGUAGE
A CASE STUDY JAVA IS SECURE PROGRAMMING LANGUAGENathan Mathis
 
Java Interview Questions
Java Interview QuestionsJava Interview Questions
Java Interview QuestionsKuntal Bhowmick
 
Class notes(week 2) on basic concepts of oop-2
Class notes(week 2) on basic concepts of oop-2Class notes(week 2) on basic concepts of oop-2
Class notes(week 2) on basic concepts of oop-2Kuntal Bhowmick
 
Object Oriented Programming All Unit Notes
Object Oriented Programming All Unit NotesObject Oriented Programming All Unit Notes
Object Oriented Programming All Unit NotesBalamuruganV28
 

Ähnlich wie Java PPT (20)

Cs8392 oops 5 units notes
Cs8392 oops 5 units notes Cs8392 oops 5 units notes
Cs8392 oops 5 units notes
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
PROGRAMMING IN JAVA unit 1.pptx
PROGRAMMING IN JAVA unit 1.pptxPROGRAMMING IN JAVA unit 1.pptx
PROGRAMMING IN JAVA unit 1.pptx
 
Java
JavaJava
Java
 
Java1
Java1Java1
Java1
 
Java
Java Java
Java
 
java ppt.pdf
java ppt.pdfjava ppt.pdf
java ppt.pdf
 
javaopps concepts
javaopps conceptsjavaopps concepts
javaopps concepts
 
Classes and Objects
Classes and ObjectsClasses and Objects
Classes and Objects
 
Java_presesntation.ppt
Java_presesntation.pptJava_presesntation.ppt
Java_presesntation.ppt
 
Java notes
Java notesJava notes
Java notes
 
A seminar report on core java
A  seminar report on core javaA  seminar report on core java
A seminar report on core java
 
Basic Java Programming
Basic Java ProgrammingBasic Java Programming
Basic Java Programming
 
Learning java from scratch
Learning java from scratchLearning java from scratch
Learning java from scratch
 
1 .java basic
1 .java basic1 .java basic
1 .java basic
 
Java OOP Concept
Java OOP ConceptJava OOP Concept
Java OOP Concept
 
A CASE STUDY JAVA IS SECURE PROGRAMMING LANGUAGE
A CASE STUDY  JAVA IS SECURE PROGRAMMING LANGUAGEA CASE STUDY  JAVA IS SECURE PROGRAMMING LANGUAGE
A CASE STUDY JAVA IS SECURE PROGRAMMING LANGUAGE
 
Java Interview Questions
Java Interview QuestionsJava Interview Questions
Java Interview Questions
 
Class notes(week 2) on basic concepts of oop-2
Class notes(week 2) on basic concepts of oop-2Class notes(week 2) on basic concepts of oop-2
Class notes(week 2) on basic concepts of oop-2
 
Object Oriented Programming All Unit Notes
Object Oriented Programming All Unit NotesObject Oriented Programming All Unit Notes
Object Oriented Programming All Unit Notes
 

Java PPT

  • 1. A Brief Introduction… Submitted by- Dilip Kumar Jangir Branch-Information Technology Roll No.-12EARIT019
  • 2. What is Java?  Java is a general purpose, high-level programming language developed by Sun Microsystems.  A small team of engineers, known as the Green Team, initiated the language in 1991.  Java was originally called OAK, and was designed for handheld devices and set-top boxes.  Today, Java is a commonly used foundation for developing and delivering content on the Web.
  • 3. Characteristics of Java Java is-  Simple.  Object-oriented.  Distributed.  Interpreted.  Robust.  Secure.  Architecture-neutral.  Portable.  Multithreaded.  Dynamic.
  • 4. Java Virtual Machine(JVM)  Java is both compiled and interpreted.  Source code is compiled into Java bytecode.  Which is then interpreted by the Java Virtual Machine (JVM).  Therefore bytecode is machine code for the JVM.  Java bytecode can run on any JVM, on any platform including mobile phones and other hand-held devices.  Networking and distribution are core features.  Makes Java very good for building networked applications, server side components,  In other languages these are additional APIs.
  • 5. Features of JVM  The Garbage Collector  Runs in the background and cleans up memory while application is running.  Java manages memory for you, the developer has no control over the allocation of memory (unlike in C/C++).  This is much simpler and more robust (no chance of memory leaks or corruption).  The Just In Time compiler (JIT)  Also known as “Hot Spot”.  Continually optimises running code to improve performance.  Can approach the speed of C++ even though its interpreted.
  • 6. (Cont.)Features of JVM  Security  Java offers very fine control over what an application is allowed to do.  E.g. Read/write files, open sockets to remote machines, discover information about the users environment, etc.  Used in Java Applets to create a “sandbox”. Stops a rogue applet attacking your machine.  Makes Java very safe, an important feature in distributed systems.  Class Loading  Loading of bytecode into the virtual machine for execution.  Code can be read from a local disk, over a network, or the Internet.  Allows downloading of applications and applets on the fly.
  • 7. Versions of Java  JDK Alpha and Beta(1995)  JDK 1.0(January 23,1996)  JDK 1.1(February 19,1997)  J2SE 1.2(December 8,1998)  J2SE 1.3(May 8,2000)  J2SE 1.4(February 6,2002)  J2SE 5.0(September 30,2004)  J2SE 6.0(December 11,2006)  J2SE 7.0(July 28,2011)  J2SE 8.0(March 18,2014)  J2SE 9.0 & 10.0 are scheduled to release in 2016 & 2018 respectively.
  • 8. Data Types In Java, there are two categories of data types- 1. Primitive Data Types 2. Non-Primitive Data Types Data Type Default Type Default Size boolean False 1 bit char ‘u0000’ 2 byte byte 0 1 byte short 0 2 byte int 0 4 byte long 0L 8 byte float 0.0f 4 byte double 0.0d 8 byte
  • 9. Naming Conventions Java Naming Convention is a rule to follow as you decide what to name your identifiers such as class, package, variable, constant, method, etc. Name Conventions Class Name Should start with uppercase letter and be a noun e.g. String, Colour, Button, Thread, etc. Interface Name Should start with uppercase letter and be an adjective e.g. Runnable, ActionListener, etc. Method Name Should start with lowercase letter and be a verb e.g. actionPerformed(), main), println(), etc. Variable Name Should start with lowercase letter e.g. forstName, orderNumber, etc. Package Name Should be in lowercase letter e.g. java, lang, sql,util, etc. Constant Name Should be in uppercase letter e.g. RED, YELLOW, etc.
  • 10. Java OOP’s Concept  Object Oriented Programming is a paradigm that provides many concepts such as inheritance, data binding, polymorphism etc.  Java concepts-  Object  Class  Inheritance  Polymorphism  Abstraction  Encapsulation
  • 11. Object  An entity that has state and behavior is known as an object e.g. chair, bike, marker, pen, table, car etc.  An object has three characteristics:  State- represents data(value) of an object.  Behaviour- represents the behaviour (functionality) of an object such as deposit, withdraw, etc.  Identity- Object identity is typically implemented via a unique ID. The value of the ID is not visible to the external user but, it is used internally by the JVM to identify each object uniquely.  Object is an instance of a class.
  • 12. Class  A class is a group of objects that has common properties. It is a template or blueprint from which objects are created.  A class in java can contain-  Data member  Method  Constructor  Block  Class and interface  By default, all data members and methods are private in Java.
  • 13. Example of Class class Student{ int age; String name; void printData(){ System.out.println(“Name:”+name+”nAge:”+age); } public static void main(String args[]){ Student st=new Student(); st.name=“John”; st.age=22; st.printData(); } }
  • 14. Inheritance  Inheritance in java is a mechanism in which one object acquires all the properties and behaviors of parent object.  The idea behind inheritance in java is that you can create new classes that are built upon existing classes.  Inheritance represents the IS-A relationship, also known as parent- child relationship.  It provides the mechanism of usability of code.  The extends keyword is used to derive a new class from existing class.
  • 15. Types of Inheritance  Single  Multilevel  Hierarchical  Java does not support Multiple Inheritance because it creates the ambiguity in the program.
  • 16. Polymorphism  Polymorphism in java is a concept by which we can perform a single action by different ways. Polymorphism is derived from 2 greek words: poly and morphs.  The word "poly" means many and "morphs" means forms. So polymorphism means many forms.  There are two types of polymorphism in java:  Compiletime Polymorphism  Runtime Polymorphism  We can perform polymorphism in java by method overloading and method overriding.
  • 17. Method Overloading  If a class have multiple methods by same name but different parameters, it is known as Method Overloading.  Method overloading increases the readability of the program.  There are two ways to overload the method in java:  By changing number of arguments.  By changing the data types.
  • 18. Method Overriding  If subclass (child class) has the same method as declared in the parent class, it is known as method overriding in java.  Usages-  Method overriding is used to provide specific implementation of a method that is already provided by its super class.  Method overriding is used for runtime polymorphism  Rules-  method must have same name as in the parent class  method must have same parameter as in the parent class.  must be IS-A relationship (inheritance).
  • 19. Abstraction  Abstraction is a process of hiding the implementation details and showing only functionality to the user.  Another way, it shows only important things to the user and hides the internal details.  For example sending SMS, you just type the text and send the message. You don't know the internal processing about the message delivery.  Abstraction lets you focus on what the object does instead of how it does it.
  • 20. Encapsulation  Encapsulation in java is a process of wrapping code and data together into a single unit, for example capsule i.e. mixed of several medicines.  We can create a fully encapsulated class in java by making all the data members of the class private.  Advantages:  By providing only setter or getter method, you can make the class read-only or write-only.  It provides you the control over the data.  The Java Bean class is the example of fully encapsulated class.
  • 21. MySQL  The most popular Open Source Relational SQL database management system.  One of the best RDBMS being used for developing web-based software applications.  Uses a standard form of the well-known SQL data language, works on many operating systems and with many languages including PHP, PERL, C, C++, JAVA, etc.