SlideShare a Scribd company logo
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

More Related Content

PPT
7. Multithreading
PPT
1. Overview of Java
PPT
9. Input Output in java
PPT
6. Exception Handling
PPT
5. Inheritances, Packages and Intefaces
PPT
4. Classes and Methods
PPT
10. Introduction to Datastructure
PPT
8. String
7. Multithreading
1. Overview of Java
9. Input Output in java
6. Exception Handling
5. Inheritances, Packages and Intefaces
4. Classes and Methods
10. Introduction to Datastructure
8. String

What's hot (11)

PDF
Methods and constructors
PDF
Keywords and classes
PPT
Object-oriented concepts
PPT
Basic concept of OOP's
PPT
Basic concepts of object oriented programming
PDF
OOPs Concepts - Android Programming
PPT
GETTING STARTED WITH JAVA(beginner)
PPT
Presentation on java
PPTX
Ch5 inheritance
PPTX
Static keyword ppt
PDF
Internationalization
Methods and constructors
Keywords and classes
Object-oriented concepts
Basic concept of OOP's
Basic concepts of object oriented programming
OOPs Concepts - Android Programming
GETTING STARTED WITH JAVA(beginner)
Presentation on java
Ch5 inheritance
Static keyword ppt
Internationalization
Ad

Viewers also liked (20)

PPTX
Basics of file handling
PPT
Java Basics
PPT
PALASH SL GUPTA
PPT
Programming with Java: the Basics
PDF
Java Course 3: OOP
PPT
Java Basics
PDF
Java Course 2: Basics
PDF
Introduction to basics of java
PPTX
Basics of java 2
PDF
Java basics notes
PPT
Java basics
PPT
Java Programming for Designers
PPT
Java Notes
PPT
Core java Basics
PPTX
Java basics
PPT
Java Basics
PPTX
OOPs in Java
PPT
Core Java Basics
PPTX
Java basics part 1
PPTX
Java Basics
Basics of file handling
Java Basics
PALASH SL GUPTA
Programming with Java: the Basics
Java Course 3: OOP
Java Basics
Java Course 2: Basics
Introduction to basics of java
Basics of java 2
Java basics notes
Java basics
Java Programming for Designers
Java Notes
Core java Basics
Java basics
Java Basics
OOPs in Java
Core Java Basics
Java basics part 1
Java Basics
Ad

Similar to 2. Basics of Java (20)

PPTX
Unit1 introduction to Java
PPTX
Getting Started with JAVA
PPTX
Java programming Introduction | Java basic architecture
PPTX
java basics concepts and the keywords needed
PPTX
UNIT 1 Programming in java Bsc program.pptx
PPTX
Basics of JAVA programming
PPTX
JAVA-History-buzzwords-JVM_architecture.pptx
PDF
Java Concepts and Features-Programming in Java
PPTX
Iintroduction to java , Java Coding , basics of java.pptx
PPT
Object Oriented Programming-JAVA
PPT
introduction_to_core_elementry_java-1.ppt
PPTX
Chapter 1 (1).pptx
PDF
A CASE STUDY JAVA IS SECURE PROGRAMMING LANGUAGE
PPTX
Presentation on java
PDF
Introduction to Java Programming
PPTX
PPTX
Chapter One Basics ofJava Programmming.pptx
DOCX
java introduction.docx
Unit1 introduction to Java
Getting Started with JAVA
Java programming Introduction | Java basic architecture
java basics concepts and the keywords needed
UNIT 1 Programming in java Bsc program.pptx
Basics of JAVA programming
JAVA-History-buzzwords-JVM_architecture.pptx
Java Concepts and Features-Programming in Java
Iintroduction to java , Java Coding , basics of java.pptx
Object Oriented Programming-JAVA
introduction_to_core_elementry_java-1.ppt
Chapter 1 (1).pptx
A CASE STUDY JAVA IS SECURE PROGRAMMING LANGUAGE
Presentation on java
Introduction to Java Programming
Chapter One Basics ofJava Programmming.pptx
java introduction.docx

More from Nilesh Dalvi (17)

PPT
14. Linked List
PPT
13. Queue
PPT
12. Stack
PPT
11. Arrays
PPT
3. Data types and Variables
PPT
Standard Template Library
PPT
Templates
PPT
File handling
PPT
Input and output in C++
PPT
Strings
PPT
Polymorphism
PPT
Inheritance : Extending Classes
PPT
Operator Overloading
PDF
Constructors and destructors
PDF
Classes and objects
PDF
Introduction to cpp
PDF
Introduction to oops concepts
14. Linked List
13. Queue
12. Stack
11. Arrays
3. Data types and Variables
Standard Template Library
Templates
File handling
Input and output in C++
Strings
Polymorphism
Inheritance : Extending Classes
Operator Overloading
Constructors and destructors
Classes and objects
Introduction to cpp
Introduction to oops concepts

Recently uploaded (20)

PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
Lesson notes of climatology university.
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
GDM (1) (1).pptx small presentation for students
PDF
Basic Mud Logging Guide for educational purpose
PDF
Classroom Observation Tools for Teachers
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Computing-Curriculum for Schools in Ghana
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
master seminar digital applications in india
PPTX
PPH.pptx obstetrics and gynecology in nursing
2.FourierTransform-ShortQuestionswithAnswers.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
Pharmacology of Heart Failure /Pharmacotherapy of CHF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Lesson notes of climatology university.
Sports Quiz easy sports quiz sports quiz
GDM (1) (1).pptx small presentation for students
Basic Mud Logging Guide for educational purpose
Classroom Observation Tools for Teachers
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Microbial disease of the cardiovascular and lymphatic systems
Computing-Curriculum for Schools in Ghana
Anesthesia in Laparoscopic Surgery in India
TR - Agricultural Crops Production NC III.pdf
Microbial diseases, their pathogenesis and prophylaxis
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
master seminar digital applications in india
PPH.pptx obstetrics and gynecology in nursing

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