SlideShare uma empresa Scribd logo
1 de 23
Basics of JavaBasics of Java
By
Nilesh Dalvi
Lecturer, Patkar-Varde College.Lecturer, Patkar-Varde College.
http://www.slideshare.net/nileshdalvi01
Java and Data StructuresJava and Data Structures
Introduction
• Java is a object-oriented programming
language.
• Related to C++, which is an offspring of
C-Language.
• Much of the characteristics of Java
inherited from C-Language & C++.
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
C-Language C++
Java
Syntax Oops features
History of Java
• General purpose object-oriented language
developed by sun microsystems in 1991.
• It is initially called ‘oak’, was
renamed as ‘Java’ in 1995.
• Originally designed to develop software
for consumers electronic devices like
toasters, TVs, etc.
• First language that is not tied to any
particular H/W or OS
• Java is platform-neutral language.
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Java applets and Application
• Used to create two types of programs:
Applications and Applets.
• Application: program that runs on your
computer, under the os of that computer.
• Applet: application designed to be
transmitted over the internet and executed
by a Java-compatible web browser.
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Difference between C++ and Java
• Java does not support operator overloading
• Java does not have template classes as in C++.
• Java does not support multiple inheritance of classes.
Accomplished by “interfaces”
• Java does not support global variables, every variable &
method is declared within a class.
• Java does not use pointers.
• Java has replaced destructor function with a finalize()
method.
• There are no header files in java.
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Java Features
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Simpl
e
Object-
Oriented
Platform-independent
Secured
Robust
Architecture-neutral
Portable
Dynamic
Interpreted
High Performance
Multi-threaded
Distributed
Java Features
Simple:
• According to Sun, Java is simple because:
– Syntax is based on C and C++ (so easier for
programmers to learn it after C++).
– Removed many confusing and/or rarely-used features
e.g., explicit pointers, operator overloading etc.       
– No need to remove unreferenced objects because there
is Automatic Garbage Collection in java.
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Java Features
Object-Oriented:
• Object-oriented programming(OOPs) is a methodology
that simplify software development and maintenance by
providing some rules.
• Basic concepts of OOPs are:
– Classes and Objects
– Inheritance
– Polymorphism
– Abstraction
– Encapsulation
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Java Features
Platform-independent
• A platform is the hardware or software environment in
which a programs runs.
• Java platforms has to components
– JVM (Java Virtual Machine)
– Java application programming Interface(API)
• Java programs can be easily moved from one computer
system to another, any where any time, changes in OS,
processors and system resources will not force any changes
in java programs.
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Java Features
Platform-independent
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Java Features
Secure:
• With java secure features it enable us to develop virus free,
temper free system.
• Java program always runs in Java runtime environment
with almost null interaction with system OS, hence it is
more secure.
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Java Features
Robust:
• Robust simply means strong.
– Java uses strong memory management.
– There are lack of pointers that avoids security problem.
– There is automatic garbage collection in java.
– There is exception handling and type checking mechanism in java.
• All these points makes java robust.
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Java Features
Architecture-neutral :
• There is no implementation dependent features
• e.g. size of primitive types is set.
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Java Features
Portable :
• Java byte code can be carried to any platform.
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Java Features
High -Performance:
• Java enables performance with the use of just-in-
time compiler.
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Java Features
Distributed:
• Java is designed as a distributed language for creating
applications on networks.
• It has ability to share both data and programs.
• This enables multiple programmers at multiple remote
locations to collaborate and work together on a single
project.
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Java Features
Multi-threaded:
• A thread is like a separate program, executing
concurrently.
• We can write Java programs that deal with many tasks at
once by defining multiple threads.
• This means that we need not wait for the application to
finish one task before beginning another.
• The main advantage of multi-threading is that it shares the
same memory.
• Threads are important for multi-media, Web applications
etc.
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Java Features
Dynamic:
• Java is a dynamic language.
• Java is capable of dynamically linking in new class libraries,
methods and objects.
• Java programs supports functions written in other
languages such as C and C++. These functions are known as
native methods.
• Native methods are linked dynamically at runtime.
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Java Features
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
SimplSimpl
ee
Object-Object-
OrientedOriented
Platform-independentPlatform-independent
SecuredSecured
RobustRobust
Architecture-neutralArchitecture-neutral
PortablePortable
DynamicDynamic
InterpretedInterpreted
High PerformanceHigh Performance
Multi-threadedMulti-threaded
DistributedDistributed
Java Development Kit
JDK contains a collections of tools that are used for developing and running
Java programs
 javac (java compiler) – converts source code into java bytecode.
 java (java interpreter) – An interpreter interpret the class files generated by
the javac compiler.
 jar (archiver) - which packages related class libraries into a single jar file.
 javadoc - documentation generator, which automatically generates
documentation from source code comments (HTML format)
 jdb (debugger)- Helps to finds errors in our programs
 javap (disassember) – enables to convert byte code files into a program
source code.
 appletviewer – This tool can be used to run and debug java aaplets without
a web browser.
 javah – Produces header files for use with native methods.
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
JVM Architecture
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Java File
.class .class .class
javac
Java compiler
Compile-time
JVM Architecture
Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
Class Loader
Class
Segment
Heap
Segment
Stack
Segment
Native
Methods
Interface
Java Native
Libraries
Operating
System
Just
In-time
Compiler
Ram Memory
Memory
Mgmt
Execution
Engine
Exception
Handling
.class
JRE
API
JVM
Q & A

Mais conteúdo relacionado

Mais procurados

Methods and constructors
Methods and constructorsMethods and constructors
Methods and constructorsRavi_Kant_Sahu
 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programmingSachin Sharma
 
OOPs Concepts - Android Programming
OOPs Concepts - Android ProgrammingOOPs Concepts - Android Programming
OOPs Concepts - Android ProgrammingPurvik Rana
 
GETTING STARTED WITH JAVA(beginner)
GETTING STARTED WITH JAVA(beginner)GETTING STARTED WITH JAVA(beginner)
GETTING STARTED WITH JAVA(beginner)HarshithaAllu
 
Static keyword ppt
Static keyword pptStatic keyword ppt
Static keyword pptVinod Kumar
 

Mais procurados (11)

Methods and constructors
Methods and constructorsMethods and constructors
Methods and constructors
 
Keywords and classes
Keywords and classesKeywords and classes
Keywords and classes
 
Object-oriented concepts
Object-oriented conceptsObject-oriented concepts
Object-oriented concepts
 
Basic concept of OOP's
Basic concept of OOP'sBasic concept of OOP's
Basic concept of OOP's
 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programming
 
OOPs Concepts - Android Programming
OOPs Concepts - Android ProgrammingOOPs Concepts - Android Programming
OOPs Concepts - Android Programming
 
GETTING STARTED WITH JAVA(beginner)
GETTING STARTED WITH JAVA(beginner)GETTING STARTED WITH JAVA(beginner)
GETTING STARTED WITH JAVA(beginner)
 
Presentation on java
Presentation  on  javaPresentation  on  java
Presentation on java
 
Ch5 inheritance
Ch5 inheritanceCh5 inheritance
Ch5 inheritance
 
Static keyword ppt
Static keyword pptStatic keyword ppt
Static keyword ppt
 
Internationalization
InternationalizationInternationalization
Internationalization
 

Destaque

Destaque (20)

Basics of file handling
Basics of file handlingBasics of file handling
Basics of file handling
 
Java Basics
Java BasicsJava Basics
Java Basics
 
PALASH SL GUPTA
PALASH SL GUPTAPALASH SL GUPTA
PALASH SL GUPTA
 
Programming with Java: the Basics
Programming with Java: the BasicsProgramming with Java: the Basics
Programming with Java: the Basics
 
Java Course 3: OOP
Java Course 3: OOPJava Course 3: OOP
Java Course 3: OOP
 
Java Basics
Java BasicsJava Basics
Java Basics
 
Java Course 2: Basics
Java Course 2: BasicsJava Course 2: Basics
Java Course 2: Basics
 
Introduction to basics of java
Introduction to basics of javaIntroduction to basics of java
Introduction to basics of java
 
Basics of java 2
Basics of java 2Basics of java 2
Basics of java 2
 
Java basics notes
Java basics notesJava basics notes
Java basics notes
 
Java basics
Java basicsJava basics
Java basics
 
Java Programming for Designers
Java Programming for DesignersJava Programming for Designers
Java Programming for Designers
 
Java Notes
Java NotesJava Notes
Java Notes
 
Core java Basics
Core java BasicsCore java Basics
Core java Basics
 
Java basics
Java basicsJava basics
Java basics
 
Java Basics
Java BasicsJava Basics
Java Basics
 
OOPs in Java
OOPs in JavaOOPs in Java
OOPs in Java
 
Core Java Basics
Core Java BasicsCore Java Basics
Core Java Basics
 
Java basics part 1
Java basics part 1Java basics part 1
Java basics part 1
 
Java Basics
Java BasicsJava Basics
Java Basics
 

Semelhante a 2. Basics of Java

Semelhante a 2. Basics of Java (20)

L1 basics
L1 basicsL1 basics
L1 basics
 
Introduction to Java Programming
Introduction to Java ProgrammingIntroduction to Java Programming
Introduction to Java Programming
 
L1 basics
L1 basicsL1 basics
L1 basics
 
Genesis and Overview of Java
Genesis and Overview of Java Genesis and Overview of Java
Genesis and Overview of Java
 
U1 JAVA.pptx
U1 JAVA.pptxU1 JAVA.pptx
U1 JAVA.pptx
 
Java buzzwords.pptx
Java buzzwords.pptxJava buzzwords.pptx
Java buzzwords.pptx
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
Presentation on java
Presentation on javaPresentation on java
Presentation on java
 
Getting Started with JAVA
Getting Started with JAVAGetting Started with JAVA
Getting Started with JAVA
 
JAVA PROGRAMMING- OOP Concept
JAVA PROGRAMMING- OOP ConceptJAVA PROGRAMMING- OOP Concept
JAVA PROGRAMMING- OOP Concept
 
JAVA INTRODUCTION - 1
JAVA INTRODUCTION - 1JAVA INTRODUCTION - 1
JAVA INTRODUCTION - 1
 
Core java programming tutorial - Brainsmartlabs
Core java programming tutorial - BrainsmartlabsCore java programming tutorial - Brainsmartlabs
Core java programming tutorial - Brainsmartlabs
 
JAVA-History-buzzwords-JVM_architecture.pptx
JAVA-History-buzzwords-JVM_architecture.pptxJAVA-History-buzzwords-JVM_architecture.pptx
JAVA-History-buzzwords-JVM_architecture.pptx
 
JAVA PROGRAM CONSTRUCTS OR LANGUAGE BASICS.pptx
JAVA PROGRAM CONSTRUCTS OR LANGUAGE BASICS.pptxJAVA PROGRAM CONSTRUCTS OR LANGUAGE BASICS.pptx
JAVA PROGRAM CONSTRUCTS OR LANGUAGE BASICS.pptx
 
Java programming language
Java programming languageJava programming language
Java programming language
 
CS8392 OOP
CS8392 OOPCS8392 OOP
CS8392 OOP
 
Java notes | All Basics |
Java notes | All Basics |Java notes | All Basics |
Java notes | All Basics |
 
oop unit1.pptx
oop unit1.pptxoop unit1.pptx
oop unit1.pptx
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Java chapter 1 basic introduction Unit-1.pptx
Java chapter  1 basic introduction Unit-1.pptxJava chapter  1 basic introduction Unit-1.pptx
Java chapter 1 basic introduction Unit-1.pptx
 

Mais de Nilesh Dalvi

Mais de Nilesh Dalvi (17)

14. Linked List
14. Linked List14. Linked List
14. Linked List
 
13. Queue
13. Queue13. Queue
13. Queue
 
12. Stack
12. Stack12. Stack
12. Stack
 
11. Arrays
11. Arrays11. Arrays
11. Arrays
 
3. Data types and Variables
3. Data types and Variables3. Data types and Variables
3. Data types and Variables
 
Standard Template Library
Standard Template LibraryStandard Template Library
Standard Template Library
 
Templates
TemplatesTemplates
Templates
 
File handling
File handlingFile handling
File handling
 
Input and output in C++
Input and output in C++Input and output in C++
Input and output in C++
 
Strings
StringsStrings
Strings
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
 
Inheritance : Extending Classes
Inheritance : Extending ClassesInheritance : Extending Classes
Inheritance : Extending Classes
 
Operator Overloading
Operator OverloadingOperator Overloading
Operator Overloading
 
Constructors and destructors
Constructors and destructorsConstructors and destructors
Constructors and destructors
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
 
Introduction to cpp
Introduction to cppIntroduction to cpp
Introduction to cpp
 
Introduction to oops concepts
Introduction to oops conceptsIntroduction to oops concepts
Introduction to oops concepts
 

Último

Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 

Último (20)

Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 

2. Basics of Java

  • 1. Basics of JavaBasics of Java By Nilesh Dalvi Lecturer, Patkar-Varde College.Lecturer, Patkar-Varde College. http://www.slideshare.net/nileshdalvi01 Java and Data StructuresJava and Data Structures
  • 2. Introduction • Java is a object-oriented programming language. • Related to C++, which is an offspring of C-Language. • Much of the characteristics of Java inherited from C-Language & C++. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W). C-Language C++ Java Syntax Oops features
  • 3. History of Java • General purpose object-oriented language developed by sun microsystems in 1991. • It is initially called ‘oak’, was renamed as ‘Java’ in 1995. • Originally designed to develop software for consumers electronic devices like toasters, TVs, etc. • First language that is not tied to any particular H/W or OS • Java is platform-neutral language. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 4. Java applets and Application • Used to create two types of programs: Applications and Applets. • Application: program that runs on your computer, under the os of that computer. • Applet: application designed to be transmitted over the internet and executed by a Java-compatible web browser. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 5. Difference between C++ and Java • Java does not support operator overloading • Java does not have template classes as in C++. • Java does not support multiple inheritance of classes. Accomplished by “interfaces” • Java does not support global variables, every variable & method is declared within a class. • Java does not use pointers. • Java has replaced destructor function with a finalize() method. • There are no header files in java. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 6. Java Features Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W). Simpl e Object- Oriented Platform-independent Secured Robust Architecture-neutral Portable Dynamic Interpreted High Performance Multi-threaded Distributed
  • 7. Java Features Simple: • According to Sun, Java is simple because: – Syntax is based on C and C++ (so easier for programmers to learn it after C++). – Removed many confusing and/or rarely-used features e.g., explicit pointers, operator overloading etc.        – No need to remove unreferenced objects because there is Automatic Garbage Collection in java. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 8. Java Features Object-Oriented: • Object-oriented programming(OOPs) is a methodology that simplify software development and maintenance by providing some rules. • Basic concepts of OOPs are: – Classes and Objects – Inheritance – Polymorphism – Abstraction – Encapsulation Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 9. Java Features Platform-independent • A platform is the hardware or software environment in which a programs runs. • Java platforms has to components – JVM (Java Virtual Machine) – Java application programming Interface(API) • Java programs can be easily moved from one computer system to another, any where any time, changes in OS, processors and system resources will not force any changes in java programs. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 10. Java Features Platform-independent Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 11. Java Features Secure: • With java secure features it enable us to develop virus free, temper free system. • Java program always runs in Java runtime environment with almost null interaction with system OS, hence it is more secure. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 12. Java Features Robust: • Robust simply means strong. – Java uses strong memory management. – There are lack of pointers that avoids security problem. – There is automatic garbage collection in java. – There is exception handling and type checking mechanism in java. • All these points makes java robust. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 13. Java Features Architecture-neutral : • There is no implementation dependent features • e.g. size of primitive types is set. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 14. Java Features Portable : • Java byte code can be carried to any platform. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 15. Java Features High -Performance: • Java enables performance with the use of just-in- time compiler. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 16. Java Features Distributed: • Java is designed as a distributed language for creating applications on networks. • It has ability to share both data and programs. • This enables multiple programmers at multiple remote locations to collaborate and work together on a single project. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 17. Java Features Multi-threaded: • A thread is like a separate program, executing concurrently. • We can write Java programs that deal with many tasks at once by defining multiple threads. • This means that we need not wait for the application to finish one task before beginning another. • The main advantage of multi-threading is that it shares the same memory. • Threads are important for multi-media, Web applications etc. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 18. Java Features Dynamic: • Java is a dynamic language. • Java is capable of dynamically linking in new class libraries, methods and objects. • Java programs supports functions written in other languages such as C and C++. These functions are known as native methods. • Native methods are linked dynamically at runtime. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 19. Java Features Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W). SimplSimpl ee Object-Object- OrientedOriented Platform-independentPlatform-independent SecuredSecured RobustRobust Architecture-neutralArchitecture-neutral PortablePortable DynamicDynamic InterpretedInterpreted High PerformanceHigh Performance Multi-threadedMulti-threaded DistributedDistributed
  • 20. Java Development Kit JDK contains a collections of tools that are used for developing and running Java programs  javac (java compiler) – converts source code into java bytecode.  java (java interpreter) – An interpreter interpret the class files generated by the javac compiler.  jar (archiver) - which packages related class libraries into a single jar file.  javadoc - documentation generator, which automatically generates documentation from source code comments (HTML format)  jdb (debugger)- Helps to finds errors in our programs  javap (disassember) – enables to convert byte code files into a program source code.  appletviewer – This tool can be used to run and debug java aaplets without a web browser.  javah – Produces header files for use with native methods. Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W).
  • 21. JVM Architecture Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W). Java File .class .class .class javac Java compiler Compile-time
  • 22. JVM Architecture Nilesh Dalvi, Lecturer@Patkar-Varde College, Goregaon(W). Class Loader Class Segment Heap Segment Stack Segment Native Methods Interface Java Native Libraries Operating System Just In-time Compiler Ram Memory Memory Mgmt Execution Engine Exception Handling .class JRE API JVM
  • 23. Q & A