SlideShare a Scribd company logo
Unit 1
Introduction to Java
What is Object-Oriented Programming?
• Object-oriented programming (OOP) is a programming
standard based on the concept of “objects”.
• These objects can contain data known as attributes and code
known as methods.
• The core concept of the object-oriented approach is to break
complex problems into smaller objects.
Introduction to Java
• Java is object-oriented programming language where
programs are written using classes.
• It allows application developers to write once, and run
anywhere (WORA)
• This means that compiled Java code can run on all platforms
that support Java without the need for recompilation.
• Java is widely used for developing applications for desktop,
web, and mobile devices.
• Java is simple, robust, and secure.
Explain Java Features
1. Simple, easy and familiar :
– Java is easy to learn because its syntax is just like c++.
– It is simple because it does not use header files and does not use
pointers
2. Compiled and Interpreted :
– Java code is translated into byte code after compilation and the byte
code is interpreted by JVM (Java Virtual Machine).
3. Platform Independent :
– Compiler converts source code to bytecode and then the JVM executes
the bytecode generated by the compiler.
– This bytecode can run on any platform like Windows, Linux, or macOS
which means if we compile a program on Windows, then we can run it
on Linux and vice versa.
4. Object-Oriented :
– Java is Object oriented - which means no coding outside of class
definitions, including main().
5. Robust :
– Robust means inbuilt capabilities to handle errors/exceptions.
6. Secure :
– it enables to develop virus-free systems.
– It has strong authentication techniques .
7. Multithreaded :
– It is possible to write a single program that can perform many tasks
simultaneously.
8. Dynamic flexibility :
– Java gives us the flexibility to add classes, new methods to existing
classes, and even create new classes through sub-classes.
What is Java Architecture. Explain
• Java Architecture is a collection of components JVM,
JRE, and JDK.
• Java Architecture explains each and every step of how a java
program is compiled and executed.
• Java Architecture can be explained by using the following
steps:
– There is a process of compilation and interpretation in Java.
– Java compiler converts the Java code into byte code.
– After that, the JVM converts the byte code into machine code.
– The machine code is then executed by the machine.
Java Architecture
Java Virtual Machine
• The main feature of Java is Write Once Run Anywhere.
• Java Virtual Machine makes it possible to write our code once
and use it on any operating system.
• JVM converts byte code into machine code.
• It loads the code into memory, verifies it and then executes
the code
Java Runtime Environment and Java Development Kit
• The JRE contains libraries and software needed by your Java
programs to run.
• JRE takes our Java code, uses the required libraries, and
then starts the JVM to execute it.
• JDK is a software development environment used in the
development of Java applications and applets.
• Java Development Kit contains JRE, a compiler, an interpreter
, and many development tools in it.
List Java Applications
• Mobile App Development :
– The Java programming language is used for building android applications .
• Eg. Spotify and Twitter
• Desktop GUI Applications :
– Java provides tools which contain pre-assembled components for developing
the GUI based desktop application.
• Web-based Applications :
– Java is used for developing the web-based application using Servlet and JSP.
• Gaming Applications :
– Java is widely used for developing gaming applications
– Eg. Minecraft, Mission Impossible III, etc.
• Cloud-based Applications :
– Java provides the environment to develop cloud-based applications
– The cloud applications are widely used to share data between companies or to
develop applications remotely.
• IoT Applications :
– IoT is found almost in all the small devices such as smartphones, wearables,
smart lighting, TVs, etc.
– For developing the IoT application Java is used, because of its security,
flexibility, and versatility.
Describe structure of Java program
A Java program involves the following sections:
• Documentation Section
• Package Statement
• Import Statements
• Interface Statement
• Class Definition
• Main Method Class
– Main Method Definition
• Documentation Section Comments can be written in this
section. They help the programmer to understand the code.
These are optional
• Package statement A package is a group of classes that are
defined by a name. If it is required to declare many classes
within one element, it can be declared within a package. It is
an optional part of the program. package keyword is used to
create a a package. Eg. package program;
• Import statement This statement is used if it is required to
use a class of another package by specifying the package
name and the class name separated with a dot operator.
Eg. import calc.add;
• Interface statement Interfaces are like a class that includes a
group of method declarations. It's an optional section and can
be used when programmers want to implement multiple
inheritances in a program.
• Class Definition A Java program may contain several class
definitions. Classes are the essential elements of any Java
program.
• Main Method Class Every Java program requires the main
method, which is the starting point of the program. There may
be many classes in a Java program, but, only one class
defines the main method. Methods contain data type
declaration and executable statements.
A Simple Java Program
//First Java program single line comment
public class Hello
{
/* Description: multi line comment
Writes the words "Hello Java" on the screen */
public static void main(String[] args)
{
System.out.println("Hello Java");
}
}
Note:
Class name : Hello
Keywords : public, static, void
Data type : String
Array name : args
Write steps for Compiling and Executing a Java program taking an
example of a simple Java program
Steps to save the file, compile, and execute the program.
• Open notepad and add the Java code.
• Save the file as: Hello.java.
• Open a command prompt window and go to the directory
where you saved the java code.
• Type javac Hello.java and press enter to compile your code.
If there are no errors in your code, the command prompt will
take you to the next line.
• Now, type java Hello to run your program.
• You will be able to see Hello Java printed on the screen.
Ad

More Related Content

Similar to unit1.pptx (20)

PPS Java Overview Unit I.ppt
PPS Java Overview Unit I.pptPPS Java Overview Unit I.ppt
PPS Java Overview Unit I.ppt
RajeshSukte1
 
Notes of java first unit
Notes of java first unitNotes of java first unit
Notes of java first unit
gowher172236
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
Java Lover
 
Java ppt-class_Introduction_class_Objects.ppt
Java ppt-class_Introduction_class_Objects.pptJava ppt-class_Introduction_class_Objects.ppt
Java ppt-class_Introduction_class_Objects.ppt
VGaneshKarthikeyan
 
Java Programming concept
Java Programming concept Java Programming concept
Java Programming concept
Prakash Poudel
 
Letest
LetestLetest
Letest
Prakash Poudel
 
Java introduction
Java introductionJava introduction
Java introduction
logeswarisaravanan
 
Java ppt-class_basic data types methods definitions
Java ppt-class_basic data types methods definitionsJava ppt-class_basic data types methods definitions
Java ppt-class_basic data types methods definitions
ganeshkarthy
 
C,c++,java,php,.net training institute in delhi, best training institute for ...
C,c++,java,php,.net training institute in delhi, best training institute for ...C,c++,java,php,.net training institute in delhi, best training institute for ...
C,c++,java,php,.net training institute in delhi, best training institute for ...
MCM COmpetitive Classes
 
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf
10322210023
 
Java Introduction
Java IntroductionJava Introduction
Java Introduction
sunmitraeducation
 
JavaClassPresentation
JavaClassPresentationJavaClassPresentation
JavaClassPresentation
juliasceasor
 
JAVA PROGRAMING NOTE FOR BEGINNERS 20242
JAVA PROGRAMING NOTE FOR BEGINNERS 20242JAVA PROGRAMING NOTE FOR BEGINNERS 20242
JAVA PROGRAMING NOTE FOR BEGINNERS 20242
boatengsolo963
 
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
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
 
Unit-IV_Introduction to Java.pdf
Unit-IV_Introduction to Java.pdfUnit-IV_Introduction to Java.pdf
Unit-IV_Introduction to Java.pdf
Assistant Professor, Shri Shivaji Science College, Amravati
 
object oriented programming unit one ppt
object oriented programming unit one pptobject oriented programming unit one ppt
object oriented programming unit one ppt
isiagnel2
 
Java Programming
Java ProgrammingJava Programming
Java Programming
Elizabeth alexander
 
Object oriented programming-with_java
Object oriented programming-with_javaObject oriented programming-with_java
Object oriented programming-with_java
Harry Potter
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
James Wong
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
Luis Goldster
 
PPS Java Overview Unit I.ppt
PPS Java Overview Unit I.pptPPS Java Overview Unit I.ppt
PPS Java Overview Unit I.ppt
RajeshSukte1
 
Notes of java first unit
Notes of java first unitNotes of java first unit
Notes of java first unit
gowher172236
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
Java Lover
 
Java ppt-class_Introduction_class_Objects.ppt
Java ppt-class_Introduction_class_Objects.pptJava ppt-class_Introduction_class_Objects.ppt
Java ppt-class_Introduction_class_Objects.ppt
VGaneshKarthikeyan
 
Java Programming concept
Java Programming concept Java Programming concept
Java Programming concept
Prakash Poudel
 
Java ppt-class_basic data types methods definitions
Java ppt-class_basic data types methods definitionsJava ppt-class_basic data types methods definitions
Java ppt-class_basic data types methods definitions
ganeshkarthy
 
C,c++,java,php,.net training institute in delhi, best training institute for ...
C,c++,java,php,.net training institute in delhi, best training institute for ...C,c++,java,php,.net training institute in delhi, best training institute for ...
C,c++,java,php,.net training institute in delhi, best training institute for ...
MCM COmpetitive Classes
 
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf
10322210023
 
JavaClassPresentation
JavaClassPresentationJavaClassPresentation
JavaClassPresentation
juliasceasor
 
JAVA PROGRAMING NOTE FOR BEGINNERS 20242
JAVA PROGRAMING NOTE FOR BEGINNERS 20242JAVA PROGRAMING NOTE FOR BEGINNERS 20242
JAVA PROGRAMING NOTE FOR BEGINNERS 20242
boatengsolo963
 
object oriented programming unit one ppt
object oriented programming unit one pptobject oriented programming unit one ppt
object oriented programming unit one ppt
isiagnel2
 
Object oriented programming-with_java
Object oriented programming-with_javaObject oriented programming-with_java
Object oriented programming-with_java
Harry Potter
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
James Wong
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
Luis Goldster
 

Recently uploaded (20)

Fonepaw Data Recovery Crack 2025 with key free Download
Fonepaw Data Recovery Crack 2025 with key free DownloadFonepaw Data Recovery Crack 2025 with key free Download
Fonepaw Data Recovery Crack 2025 with key free Download
mampisoren09
 
AnyDesk 5.2.1 Crack License Key Full Version 2019 {Latest}
AnyDesk 5.2.1 Crack License Key Full Version 2019 {Latest}AnyDesk 5.2.1 Crack License Key Full Version 2019 {Latest}
AnyDesk 5.2.1 Crack License Key Full Version 2019 {Latest}
yousfhashmi786
 
Bone Tubeoudgkaitaurauraurarhafhau4rculosis.pptx
Bone   Tubeoudgkaitaurauraurarhafhau4rculosis.pptxBone   Tubeoudgkaitaurauraurarhafhau4rculosis.pptx
Bone Tubeoudgkaitaurauraurarhafhau4rculosis.pptx
gaisga4er
 
荷兰代尔夫特理工大学毕业证书文凭定制TUDelft成绩单定制
荷兰代尔夫特理工大学毕业证书文凭定制TUDelft成绩单定制荷兰代尔夫特理工大学毕业证书文凭定制TUDelft成绩单定制
荷兰代尔夫特理工大学毕业证书文凭定制TUDelft成绩单定制
Taqyea
 
Mischief and cheating - yashita (2405230008).pptx
Mischief and cheating - yashita (2405230008).pptxMischief and cheating - yashita (2405230008).pptx
Mischief and cheating - yashita (2405230008).pptx
YashitaAhuja
 
chapter hshs jsjshs sjjsjs kenshs kensh.pptx
chapter hshs jsjshs sjjsjs kenshs kensh.pptxchapter hshs jsjshs sjjsjs kenshs kensh.pptx
chapter hshs jsjshs sjjsjs kenshs kensh.pptx
vvghgjgf
 
the-importance-of-learning-french-140722055824-phpapp01.ppt
the-importance-of-learning-french-140722055824-phpapp01.pptthe-importance-of-learning-french-140722055824-phpapp01.ppt
the-importance-of-learning-french-140722055824-phpapp01.ppt
LipicaJasujaWadhwa
 
Need of t the thw stuf iobyu hionsbb 9hniosParsing.pptx
Need of t the thw stuf iobyu  hionsbb 9hniosParsing.pptxNeed of t the thw stuf iobyu  hionsbb 9hniosParsing.pptx
Need of t the thw stuf iobyu hionsbb 9hniosParsing.pptx
ParitoshShukla11
 
Wondershare Filmora Crack Free Download Latest 2025
Wondershare Filmora Crack Free Download Latest 2025Wondershare Filmora Crack Free Download Latest 2025
Wondershare Filmora Crack Free Download Latest 2025
yousfhashmi786
 
OSPF & DHCP PPT.pptx it is relATED TO NETWORKING
OSPF & DHCP PPT.pptx it is relATED TO NETWORKINGOSPF & DHCP PPT.pptx it is relATED TO NETWORKING
OSPF & DHCP PPT.pptx it is relATED TO NETWORKING
ritikghw
 
00804.pptvjlvpuvupvpyvupv6v07upv60v7vupv0v6p
00804.pptvjlvpuvupvpyvupv6v07upv60v7vupv0v6p00804.pptvjlvpuvupvpyvupv6v07upv60v7vupv0v6p
00804.pptvjlvpuvupvpyvupv6v07upv60v7vupv0v6p
hkrishna9495
 
Multilingual hand gesture to speech conversion system
Multilingual hand gesture to speech conversion systemMultilingual hand gesture to speech conversion system
Multilingual hand gesture to speech conversion system
Himabindu905359
 
hufman coding for compression algorithm.ppt
hufman coding for compression algorithm.ppthufman coding for compression algorithm.ppt
hufman coding for compression algorithm.ppt
alvishi254
 
Linepro - Product Profile- Capacitive Panels
Linepro - Product Profile- Capacitive PanelsLinepro - Product Profile- Capacitive Panels
Linepro - Product Profile- Capacitive Panels
PaulMalpan1
 
Adobe Illustrator CC Crack Version 2025?
Adobe Illustrator CC Crack Version 2025?Adobe Illustrator CC Crack Version 2025?
Adobe Illustrator CC Crack Version 2025?
yousfhashmi786
 
Biology SBK10.pdffgguhjjjjghjtrdrettdryttrdtr
Biology SBK10.pdffgguhjjjjghjtrdrettdryttrdtrBiology SBK10.pdffgguhjjjjghjtrdrettdryttrdtr
Biology SBK10.pdffgguhjjjjghjtrdrettdryttrdtr
abayamargaug
 
Microsoft Office 365 Crack Latest Version 2025?
Microsoft Office 365 Crack Latest Version 2025?Microsoft Office 365 Crack Latest Version 2025?
Microsoft Office 365 Crack Latest Version 2025?
yousfhashmi786
 
TabulationwjsnnanamamamNananaka of Data.pptx
TabulationwjsnnanamamamNananaka of Data.pptxTabulationwjsnnanamamamNananaka of Data.pptx
TabulationwjsnnanamamamNananaka of Data.pptx
sriyansh4443
 
Mutation-Breeding (1).pdf.pptxcoucy9f9yf69f9
Mutation-Breeding (1).pdf.pptxcoucy9f9yf69f9Mutation-Breeding (1).pdf.pptxcoucy9f9yf69f9
Mutation-Breeding (1).pdf.pptxcoucy9f9yf69f9
hkrishna9495
 
ppt untuk seminar proposal dan persiapannya
ppt untuk seminar proposal dan persiapannyappt untuk seminar proposal dan persiapannya
ppt untuk seminar proposal dan persiapannya
Rasidinmamakidin
 
Fonepaw Data Recovery Crack 2025 with key free Download
Fonepaw Data Recovery Crack 2025 with key free DownloadFonepaw Data Recovery Crack 2025 with key free Download
Fonepaw Data Recovery Crack 2025 with key free Download
mampisoren09
 
AnyDesk 5.2.1 Crack License Key Full Version 2019 {Latest}
AnyDesk 5.2.1 Crack License Key Full Version 2019 {Latest}AnyDesk 5.2.1 Crack License Key Full Version 2019 {Latest}
AnyDesk 5.2.1 Crack License Key Full Version 2019 {Latest}
yousfhashmi786
 
Bone Tubeoudgkaitaurauraurarhafhau4rculosis.pptx
Bone   Tubeoudgkaitaurauraurarhafhau4rculosis.pptxBone   Tubeoudgkaitaurauraurarhafhau4rculosis.pptx
Bone Tubeoudgkaitaurauraurarhafhau4rculosis.pptx
gaisga4er
 
荷兰代尔夫特理工大学毕业证书文凭定制TUDelft成绩单定制
荷兰代尔夫特理工大学毕业证书文凭定制TUDelft成绩单定制荷兰代尔夫特理工大学毕业证书文凭定制TUDelft成绩单定制
荷兰代尔夫特理工大学毕业证书文凭定制TUDelft成绩单定制
Taqyea
 
Mischief and cheating - yashita (2405230008).pptx
Mischief and cheating - yashita (2405230008).pptxMischief and cheating - yashita (2405230008).pptx
Mischief and cheating - yashita (2405230008).pptx
YashitaAhuja
 
chapter hshs jsjshs sjjsjs kenshs kensh.pptx
chapter hshs jsjshs sjjsjs kenshs kensh.pptxchapter hshs jsjshs sjjsjs kenshs kensh.pptx
chapter hshs jsjshs sjjsjs kenshs kensh.pptx
vvghgjgf
 
the-importance-of-learning-french-140722055824-phpapp01.ppt
the-importance-of-learning-french-140722055824-phpapp01.pptthe-importance-of-learning-french-140722055824-phpapp01.ppt
the-importance-of-learning-french-140722055824-phpapp01.ppt
LipicaJasujaWadhwa
 
Need of t the thw stuf iobyu hionsbb 9hniosParsing.pptx
Need of t the thw stuf iobyu  hionsbb 9hniosParsing.pptxNeed of t the thw stuf iobyu  hionsbb 9hniosParsing.pptx
Need of t the thw stuf iobyu hionsbb 9hniosParsing.pptx
ParitoshShukla11
 
Wondershare Filmora Crack Free Download Latest 2025
Wondershare Filmora Crack Free Download Latest 2025Wondershare Filmora Crack Free Download Latest 2025
Wondershare Filmora Crack Free Download Latest 2025
yousfhashmi786
 
OSPF & DHCP PPT.pptx it is relATED TO NETWORKING
OSPF & DHCP PPT.pptx it is relATED TO NETWORKINGOSPF & DHCP PPT.pptx it is relATED TO NETWORKING
OSPF & DHCP PPT.pptx it is relATED TO NETWORKING
ritikghw
 
00804.pptvjlvpuvupvpyvupv6v07upv60v7vupv0v6p
00804.pptvjlvpuvupvpyvupv6v07upv60v7vupv0v6p00804.pptvjlvpuvupvpyvupv6v07upv60v7vupv0v6p
00804.pptvjlvpuvupvpyvupv6v07upv60v7vupv0v6p
hkrishna9495
 
Multilingual hand gesture to speech conversion system
Multilingual hand gesture to speech conversion systemMultilingual hand gesture to speech conversion system
Multilingual hand gesture to speech conversion system
Himabindu905359
 
hufman coding for compression algorithm.ppt
hufman coding for compression algorithm.ppthufman coding for compression algorithm.ppt
hufman coding for compression algorithm.ppt
alvishi254
 
Linepro - Product Profile- Capacitive Panels
Linepro - Product Profile- Capacitive PanelsLinepro - Product Profile- Capacitive Panels
Linepro - Product Profile- Capacitive Panels
PaulMalpan1
 
Adobe Illustrator CC Crack Version 2025?
Adobe Illustrator CC Crack Version 2025?Adobe Illustrator CC Crack Version 2025?
Adobe Illustrator CC Crack Version 2025?
yousfhashmi786
 
Biology SBK10.pdffgguhjjjjghjtrdrettdryttrdtr
Biology SBK10.pdffgguhjjjjghjtrdrettdryttrdtrBiology SBK10.pdffgguhjjjjghjtrdrettdryttrdtr
Biology SBK10.pdffgguhjjjjghjtrdrettdryttrdtr
abayamargaug
 
Microsoft Office 365 Crack Latest Version 2025?
Microsoft Office 365 Crack Latest Version 2025?Microsoft Office 365 Crack Latest Version 2025?
Microsoft Office 365 Crack Latest Version 2025?
yousfhashmi786
 
TabulationwjsnnanamamamNananaka of Data.pptx
TabulationwjsnnanamamamNananaka of Data.pptxTabulationwjsnnanamamamNananaka of Data.pptx
TabulationwjsnnanamamamNananaka of Data.pptx
sriyansh4443
 
Mutation-Breeding (1).pdf.pptxcoucy9f9yf69f9
Mutation-Breeding (1).pdf.pptxcoucy9f9yf69f9Mutation-Breeding (1).pdf.pptxcoucy9f9yf69f9
Mutation-Breeding (1).pdf.pptxcoucy9f9yf69f9
hkrishna9495
 
ppt untuk seminar proposal dan persiapannya
ppt untuk seminar proposal dan persiapannyappt untuk seminar proposal dan persiapannya
ppt untuk seminar proposal dan persiapannya
Rasidinmamakidin
 
Ad

unit1.pptx

  • 2. What is Object-Oriented Programming? • Object-oriented programming (OOP) is a programming standard based on the concept of “objects”. • These objects can contain data known as attributes and code known as methods. • The core concept of the object-oriented approach is to break complex problems into smaller objects.
  • 3. Introduction to Java • Java is object-oriented programming language where programs are written using classes. • It allows application developers to write once, and run anywhere (WORA) • This means that compiled Java code can run on all platforms that support Java without the need for recompilation. • Java is widely used for developing applications for desktop, web, and mobile devices. • Java is simple, robust, and secure.
  • 4. Explain Java Features 1. Simple, easy and familiar : – Java is easy to learn because its syntax is just like c++. – It is simple because it does not use header files and does not use pointers 2. Compiled and Interpreted : – Java code is translated into byte code after compilation and the byte code is interpreted by JVM (Java Virtual Machine). 3. Platform Independent : – Compiler converts source code to bytecode and then the JVM executes the bytecode generated by the compiler. – This bytecode can run on any platform like Windows, Linux, or macOS which means if we compile a program on Windows, then we can run it on Linux and vice versa. 4. Object-Oriented : – Java is Object oriented - which means no coding outside of class definitions, including main(). 5. Robust : – Robust means inbuilt capabilities to handle errors/exceptions.
  • 5. 6. Secure : – it enables to develop virus-free systems. – It has strong authentication techniques . 7. Multithreaded : – It is possible to write a single program that can perform many tasks simultaneously. 8. Dynamic flexibility : – Java gives us the flexibility to add classes, new methods to existing classes, and even create new classes through sub-classes.
  • 6. What is Java Architecture. Explain • Java Architecture is a collection of components JVM, JRE, and JDK. • Java Architecture explains each and every step of how a java program is compiled and executed. • Java Architecture can be explained by using the following steps: – There is a process of compilation and interpretation in Java. – Java compiler converts the Java code into byte code. – After that, the JVM converts the byte code into machine code. – The machine code is then executed by the machine.
  • 8. Java Virtual Machine • The main feature of Java is Write Once Run Anywhere. • Java Virtual Machine makes it possible to write our code once and use it on any operating system. • JVM converts byte code into machine code. • It loads the code into memory, verifies it and then executes the code
  • 9. Java Runtime Environment and Java Development Kit • The JRE contains libraries and software needed by your Java programs to run. • JRE takes our Java code, uses the required libraries, and then starts the JVM to execute it. • JDK is a software development environment used in the development of Java applications and applets. • Java Development Kit contains JRE, a compiler, an interpreter , and many development tools in it.
  • 10. List Java Applications • Mobile App Development : – The Java programming language is used for building android applications . • Eg. Spotify and Twitter • Desktop GUI Applications : – Java provides tools which contain pre-assembled components for developing the GUI based desktop application. • Web-based Applications : – Java is used for developing the web-based application using Servlet and JSP. • Gaming Applications : – Java is widely used for developing gaming applications – Eg. Minecraft, Mission Impossible III, etc.
  • 11. • Cloud-based Applications : – Java provides the environment to develop cloud-based applications – The cloud applications are widely used to share data between companies or to develop applications remotely. • IoT Applications : – IoT is found almost in all the small devices such as smartphones, wearables, smart lighting, TVs, etc. – For developing the IoT application Java is used, because of its security, flexibility, and versatility.
  • 12. Describe structure of Java program A Java program involves the following sections: • Documentation Section • Package Statement • Import Statements • Interface Statement • Class Definition • Main Method Class – Main Method Definition
  • 13. • Documentation Section Comments can be written in this section. They help the programmer to understand the code. These are optional • Package statement A package is a group of classes that are defined by a name. If it is required to declare many classes within one element, it can be declared within a package. It is an optional part of the program. package keyword is used to create a a package. Eg. package program; • Import statement This statement is used if it is required to use a class of another package by specifying the package name and the class name separated with a dot operator. Eg. import calc.add; • Interface statement Interfaces are like a class that includes a group of method declarations. It's an optional section and can be used when programmers want to implement multiple inheritances in a program.
  • 14. • Class Definition A Java program may contain several class definitions. Classes are the essential elements of any Java program. • Main Method Class Every Java program requires the main method, which is the starting point of the program. There may be many classes in a Java program, but, only one class defines the main method. Methods contain data type declaration and executable statements.
  • 15. A Simple Java Program //First Java program single line comment public class Hello { /* Description: multi line comment Writes the words "Hello Java" on the screen */ public static void main(String[] args) { System.out.println("Hello Java"); } } Note: Class name : Hello Keywords : public, static, void Data type : String Array name : args
  • 16. Write steps for Compiling and Executing a Java program taking an example of a simple Java program Steps to save the file, compile, and execute the program. • Open notepad and add the Java code. • Save the file as: Hello.java. • Open a command prompt window and go to the directory where you saved the java code. • Type javac Hello.java and press enter to compile your code. If there are no errors in your code, the command prompt will take you to the next line. • Now, type java Hello to run your program. • You will be able to see Hello Java printed on the screen.