SlideShare una empresa de Scribd logo
1 de 10
A
PPT PERSENTATION
ON
JAVA PROGRAMMING LANGUAGE
BY
SUBHASH KUMAR
18BTCSE009
Java Programming Language
• Java is one of the most popular and widely used programming language.
• Java has been one of the most popular programming language for many years.
• Java is Object Oriented. However it is not considered as pure object oriented as it provides support for primitive data types (like
int, char, etc)
• The Java codes are first compiled into byte code (machine independent code). Then the byte code is run on Java Virtual Machine
(JVM) regardless of the underlying architecture.
• Java syntax is similar to C/C++. But Java does not provide low level programming functionalities like pointers. Also, Java codes
are always written in the form of classes and objects.
• Java is used in all kind of applications like Mobile Applications (Android is Java based), desktop applications, web applications,
client server applications, enterprise applications and many more.
• When compared with C++, Java codes are generally more maintainable because Java does not allow many things which may lead
bad/inefficient programming if used incorrectly. For example, non-primitives are always references in Java. So we cannot pass
large objects (like we can do in C++) to functions, we always pass references in Java. One more example, since there are no
pointers, bad memory access is also not possible.
• When compared with Python, Java kind of fits between C++ and Python. The programs written in Java typically run faster than
corresponding Python programs and slower than C++. Like C++, Java does static type checking, but Python does not.
About Java
• Java is a simple language: Java is easy to learn and its syntax is clear and concise. It is based on C++ (so it is easier for
programmers who know C++). Java has removed many confusing and rarely-used features e.g. explicit pointers, operator
overloading, etc. Java also takes care of memory management and it also provides an automatic garbage collector. This
collects the unused objects automatically.
• Java is a platform-independent language: The programs written in Java language, after compilation, are converted into
an intermediate level language called the bytecode which is a part of the Java platform irrespective of the machine on
which the programs run. This makes java highly portable as its bytecodes can be run on any machine by an interpreter
called the Java Virtual Machine(JVM) and thus java provides ‘reusability of code’.
• Java is an object-oriented programming language: OOP makes the complete program simpler by dividing it into a
number of objects. The objects can be used as a bridge to have data flow from one function to another. We can easily
modify data and function’s as per the requirements of the program.
• Java is a robust language: Java programs must be reliable because they are used in both consumer and mission-critical
applications, ranging from Blu-ray players to navigation systems.
• Java is a multithreaded language: Java can perform many tasks at once by defining multiple threads. For example, a
program that manages a Graphical User Interface (GUI) while waiting for input from a network connection uses another
thread to perform and wait’s instead of using the default GUI thread for both tasks. This keeps the GUI responsive.
• Java programs can create applets: Applets are programs that run in web browsers. But applets support was deprecated
in Java 9 release and has been removed in Java 11 release due to warning browser support for the Java plugin.
• Java does not require any preprocessor: It does not require inclusion of header files for creating a Java application.
• Therefore, Java is a very successful language and it is gaining popularity day by day.
Data types in Java
Loops in Java
• Java provides three ways for executing the loops. While all the ways provide similar
basic functionality, they differ in their syntax and condition checking time.
while loop: A while loop is a control flow statement that allows code to be executed
repeatedly based on a given Boolean condition. The while loop can be thought of as a
repeating if statement.
for loop: for loop provides a concise way of writing the loop structure. Unlike a while
loop, a for statement consumes the initialization, condition and increment/decrement in
one line thereby providing a shorter, easy to debug structure of looping.
do while: do while loop is similar to while loop with only difference that it checks for
condition after executing the statements, and therefore is an example of Exit Control
Loop.
Infinite loop: One of the most common mistakes while implementing any sort of looping
is that that it may not ever exit, that is the loop runs for infinite time. This happens when
the condition fails for some reason
Classes and Objects in Java
A class is a user defined blueprint or prototype from which objects are created. It
represents the set of properties or methods that are common to all objects of one type.
In general, class declarations can include these components, in order:
Modifiers : A class can be public or has default access .
class keyword: class keyword is used to create a class.
Class name: The name should begin with a initial letter (capitalized by convention).
Superclass(if any): The name of the class’s parent (superclass), if any, preceded by the
keyword extends. A class can only extend (subclass) one parent.
Interfaces(if any): A comma-separated list of interfaces implemented by the class, if
any, preceded by the keyword implements. A class can implement more than one
interface.
Body: The class body surrounded by braces, { }.
Object
• It is a basic unit of Object Oriented Programming and represents the real life
entities. A typical Java program creates many objects, which as you know, interact by
invoking methods. An object consists of :
State : It is represented by attributes of an object. It also reflects the properties of an
object.
Behavior : It is represented by methods of an object. It also reflects the response of an
object with other objects.
Identity : It gives a unique name to an object and enables one object to interact with
other objects.
OOP concepts
• Inheritance in Java
• Encapsulation in Java
• Abstraction in Java
• Method Overloading
• Input and Output
• Input and Output
• Constructors
CERTIFICATE
THANKYOU
REGARDS

Más contenido relacionado

La actualidad más candente

Java for Recruiters
Java for RecruitersJava for Recruiters
Java for Recruitersph7 -
 
Introduction to java
Introduction to java Introduction to java
Introduction to java Java Lover
 
Java Programming for Designers
Java Programming for DesignersJava Programming for Designers
Java Programming for DesignersR. Sosa
 
Java programming(unit 1)
Java programming(unit 1)Java programming(unit 1)
Java programming(unit 1)SURBHI SAROHA
 
java tutorial for beginner - Free Download
java tutorial for beginner - Free Downloadjava tutorial for beginner - Free Download
java tutorial for beginner - Free DownloadTIB Academy
 
A seminar report on core java
A  seminar report on core javaA  seminar report on core java
A seminar report on core javaAisha Siddiqui
 
Introduction to java
Introduction to java Introduction to java
Introduction to java Sandeep Rawat
 
Introduction to Java -unit-1
Introduction to Java -unit-1Introduction to Java -unit-1
Introduction to Java -unit-1RubaNagarajan
 
Introduction to Java Programming
Introduction to Java Programming Introduction to Java Programming
Introduction to Java Programming Saravanakumar R
 
Learn java in hindi
Learn java in hindiLearn java in hindi
Learn java in hindiVipin sharma
 
Introduction to java (revised)
Introduction to java (revised)Introduction to java (revised)
Introduction to java (revised)Sujit Majety
 

La actualidad más candente (20)

Java Programming
Java ProgrammingJava Programming
Java Programming
 
Java for Recruiters
Java for RecruitersJava for Recruiters
Java for Recruiters
 
Bn1005 demo ppt core java
Bn1005 demo ppt core javaBn1005 demo ppt core java
Bn1005 demo ppt core java
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
Java chapter 1
Java   chapter 1Java   chapter 1
Java chapter 1
 
Java seminar
Java seminarJava seminar
Java seminar
 
Java Programming for Designers
Java Programming for DesignersJava Programming for Designers
Java Programming for Designers
 
Java programming(unit 1)
Java programming(unit 1)Java programming(unit 1)
Java programming(unit 1)
 
java tutorial for beginner - Free Download
java tutorial for beginner - Free Downloadjava tutorial for beginner - Free Download
java tutorial for beginner - Free Download
 
A seminar report on core java
A  seminar report on core javaA  seminar report on core java
A seminar report on core java
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
Introduction to Java -unit-1
Introduction to Java -unit-1Introduction to Java -unit-1
Introduction to Java -unit-1
 
Java basics
Java basicsJava basics
Java basics
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Introduction to Java Programming
Introduction to Java Programming Introduction to Java Programming
Introduction to Java Programming
 
00 intro to java
00 intro to java00 intro to java
00 intro to java
 
Java 3 rd sem. 2012 aug.ASSIGNMENT
Java 3 rd sem. 2012 aug.ASSIGNMENTJava 3 rd sem. 2012 aug.ASSIGNMENT
Java 3 rd sem. 2012 aug.ASSIGNMENT
 
Learn java in hindi
Learn java in hindiLearn java in hindi
Learn java in hindi
 
Introduction to java (revised)
Introduction to java (revised)Introduction to java (revised)
Introduction to java (revised)
 
Core java course syllabus
Core java course syllabusCore java course syllabus
Core java course syllabus
 

Similar a Java programming language

Similar a Java programming language (20)

Java training in bangalore
Java training in bangaloreJava training in bangalore
Java training in bangalore
 
Java features
Java  features Java  features
Java features
 
Java1
Java1Java1
Java1
 
Java
Java Java
Java
 
JAVA PROGRAMMING-Unit I - Final PPT.pptx
JAVA PROGRAMMING-Unit I - Final PPT.pptxJAVA PROGRAMMING-Unit I - Final PPT.pptx
JAVA PROGRAMMING-Unit I - Final PPT.pptx
 
Getting Started with JAVA
Getting Started with JAVAGetting Started with JAVA
Getting Started with JAVA
 
Core java programming tutorial - Brainsmartlabs
Core java programming tutorial - BrainsmartlabsCore java programming tutorial - Brainsmartlabs
Core java programming tutorial - Brainsmartlabs
 
Presentación rs232 java
Presentación rs232 javaPresentación rs232 java
Presentación rs232 java
 
Java questions and answers jan bask.net
Java questions and answers jan bask.netJava questions and answers jan bask.net
Java questions and answers jan bask.net
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
 
Unit 1 Core Java for Compter Science 3rd
Unit 1 Core Java for Compter Science 3rdUnit 1 Core Java for Compter Science 3rd
Unit 1 Core Java for Compter Science 3rd
 
Introduction to Java Programming.pdf
Introduction to Java Programming.pdfIntroduction to Java Programming.pdf
Introduction to Java Programming.pdf
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
 
Unit1 introduction to Java
Unit1 introduction to JavaUnit1 introduction to Java
Unit1 introduction to Java
 
JAVA FEATURES
JAVA FEATURESJAVA FEATURES
JAVA FEATURES
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
Classes and Objects
Classes and ObjectsClasses and Objects
Classes and Objects
 
0f0cef_1dac552af56c4338ab0672859199e693.pdf
0f0cef_1dac552af56c4338ab0672859199e693.pdf0f0cef_1dac552af56c4338ab0672859199e693.pdf
0f0cef_1dac552af56c4338ab0672859199e693.pdf
 
130700548484460000
130700548484460000130700548484460000
130700548484460000
 
Unit1 JAVA.pptx
Unit1 JAVA.pptxUnit1 JAVA.pptx
Unit1 JAVA.pptx
 

Más de SubhashKumar329

Dbms (www.gate2016.info)
Dbms (www.gate2016.info)Dbms (www.gate2016.info)
Dbms (www.gate2016.info)SubhashKumar329
 
Understanding blockchaintechnology
Understanding blockchaintechnology Understanding blockchaintechnology
Understanding blockchaintechnology SubhashKumar329
 
Operation systems (www.gate2016.info)
Operation systems (www.gate2016.info)Operation systems (www.gate2016.info)
Operation systems (www.gate2016.info)SubhashKumar329
 
Graph theory (www.gate2016.info)
Graph theory (www.gate2016.info)Graph theory (www.gate2016.info)
Graph theory (www.gate2016.info)SubhashKumar329
 
Digital logic (www.gate2016.info)
Digital logic (www.gate2016.info)Digital logic (www.gate2016.info)
Digital logic (www.gate2016.info)SubhashKumar329
 
Understanding blockchaintechnology
Understanding blockchaintechnologyUnderstanding blockchaintechnology
Understanding blockchaintechnologySubhashKumar329
 
With cities and urban areas getting crowded by the minute (1)
With cities and urban areas getting crowded by the minute (1)With cities and urban areas getting crowded by the minute (1)
With cities and urban areas getting crowded by the minute (1)SubhashKumar329
 
Living in cities can be troubling
Living in cities can be troublingLiving in cities can be troubling
Living in cities can be troublingSubhashKumar329
 

Más de SubhashKumar329 (9)

Dbms (www.gate2016.info)
Dbms (www.gate2016.info)Dbms (www.gate2016.info)
Dbms (www.gate2016.info)
 
Understanding blockchaintechnology
Understanding blockchaintechnology Understanding blockchaintechnology
Understanding blockchaintechnology
 
Operation systems (www.gate2016.info)
Operation systems (www.gate2016.info)Operation systems (www.gate2016.info)
Operation systems (www.gate2016.info)
 
Graph theory (www.gate2016.info)
Graph theory (www.gate2016.info)Graph theory (www.gate2016.info)
Graph theory (www.gate2016.info)
 
Digital logic (www.gate2016.info)
Digital logic (www.gate2016.info)Digital logic (www.gate2016.info)
Digital logic (www.gate2016.info)
 
Understanding blockchaintechnology
Understanding blockchaintechnologyUnderstanding blockchaintechnology
Understanding blockchaintechnology
 
With cities and urban areas getting crowded by the minute (1)
With cities and urban areas getting crowded by the minute (1)With cities and urban areas getting crowded by the minute (1)
With cities and urban areas getting crowded by the minute (1)
 
Living in cities can be troubling
Living in cities can be troublingLiving in cities can be troubling
Living in cities can be troubling
 
Blockchain technology
Blockchain technologyBlockchain technology
Blockchain technology
 

Último

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 

Último (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 

Java programming language

  • 1. A PPT PERSENTATION ON JAVA PROGRAMMING LANGUAGE BY SUBHASH KUMAR 18BTCSE009
  • 2. Java Programming Language • Java is one of the most popular and widely used programming language. • Java has been one of the most popular programming language for many years. • Java is Object Oriented. However it is not considered as pure object oriented as it provides support for primitive data types (like int, char, etc) • The Java codes are first compiled into byte code (machine independent code). Then the byte code is run on Java Virtual Machine (JVM) regardless of the underlying architecture. • Java syntax is similar to C/C++. But Java does not provide low level programming functionalities like pointers. Also, Java codes are always written in the form of classes and objects. • Java is used in all kind of applications like Mobile Applications (Android is Java based), desktop applications, web applications, client server applications, enterprise applications and many more. • When compared with C++, Java codes are generally more maintainable because Java does not allow many things which may lead bad/inefficient programming if used incorrectly. For example, non-primitives are always references in Java. So we cannot pass large objects (like we can do in C++) to functions, we always pass references in Java. One more example, since there are no pointers, bad memory access is also not possible. • When compared with Python, Java kind of fits between C++ and Python. The programs written in Java typically run faster than corresponding Python programs and slower than C++. Like C++, Java does static type checking, but Python does not.
  • 3. About Java • Java is a simple language: Java is easy to learn and its syntax is clear and concise. It is based on C++ (so it is easier for programmers who know C++). Java has removed many confusing and rarely-used features e.g. explicit pointers, operator overloading, etc. Java also takes care of memory management and it also provides an automatic garbage collector. This collects the unused objects automatically. • Java is a platform-independent language: The programs written in Java language, after compilation, are converted into an intermediate level language called the bytecode which is a part of the Java platform irrespective of the machine on which the programs run. This makes java highly portable as its bytecodes can be run on any machine by an interpreter called the Java Virtual Machine(JVM) and thus java provides ‘reusability of code’. • Java is an object-oriented programming language: OOP makes the complete program simpler by dividing it into a number of objects. The objects can be used as a bridge to have data flow from one function to another. We can easily modify data and function’s as per the requirements of the program. • Java is a robust language: Java programs must be reliable because they are used in both consumer and mission-critical applications, ranging from Blu-ray players to navigation systems. • Java is a multithreaded language: Java can perform many tasks at once by defining multiple threads. For example, a program that manages a Graphical User Interface (GUI) while waiting for input from a network connection uses another thread to perform and wait’s instead of using the default GUI thread for both tasks. This keeps the GUI responsive. • Java programs can create applets: Applets are programs that run in web browsers. But applets support was deprecated in Java 9 release and has been removed in Java 11 release due to warning browser support for the Java plugin. • Java does not require any preprocessor: It does not require inclusion of header files for creating a Java application. • Therefore, Java is a very successful language and it is gaining popularity day by day.
  • 5. Loops in Java • Java provides three ways for executing the loops. While all the ways provide similar basic functionality, they differ in their syntax and condition checking time. while loop: A while loop is a control flow statement that allows code to be executed repeatedly based on a given Boolean condition. The while loop can be thought of as a repeating if statement. for loop: for loop provides a concise way of writing the loop structure. Unlike a while loop, a for statement consumes the initialization, condition and increment/decrement in one line thereby providing a shorter, easy to debug structure of looping. do while: do while loop is similar to while loop with only difference that it checks for condition after executing the statements, and therefore is an example of Exit Control Loop. Infinite loop: One of the most common mistakes while implementing any sort of looping is that that it may not ever exit, that is the loop runs for infinite time. This happens when the condition fails for some reason
  • 6. Classes and Objects in Java A class is a user defined blueprint or prototype from which objects are created. It represents the set of properties or methods that are common to all objects of one type. In general, class declarations can include these components, in order: Modifiers : A class can be public or has default access . class keyword: class keyword is used to create a class. Class name: The name should begin with a initial letter (capitalized by convention). Superclass(if any): The name of the class’s parent (superclass), if any, preceded by the keyword extends. A class can only extend (subclass) one parent. Interfaces(if any): A comma-separated list of interfaces implemented by the class, if any, preceded by the keyword implements. A class can implement more than one interface. Body: The class body surrounded by braces, { }.
  • 7. Object • It is a basic unit of Object Oriented Programming and represents the real life entities. A typical Java program creates many objects, which as you know, interact by invoking methods. An object consists of : State : It is represented by attributes of an object. It also reflects the properties of an object. Behavior : It is represented by methods of an object. It also reflects the response of an object with other objects. Identity : It gives a unique name to an object and enables one object to interact with other objects.
  • 8. OOP concepts • Inheritance in Java • Encapsulation in Java • Abstraction in Java • Method Overloading • Input and Output • Input and Output • Constructors