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

More Related Content

What's hot

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
 

What's hot (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 to Java programming language

Similar to 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
 

More from 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
 

More from 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
 

Recently uploaded

Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 

Recently uploaded (20)

DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 

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