SlideShare a Scribd company logo
1 of 10
Download to read offline
Overview of java Language:
Where Java is used?
There are many devices where java is currently used. Some of them are as follows:
 Desktop Applications
 Web Applications
 Mobile
 Embedded System
 Robotics
 Games etc.
Types of Java Applications
 Application programs
Application programs are stand-alone programs that are written to carry
out certain tasks on local computer such as solving equations, reading and
writing files etc.
 Applet Programs
Applets are small Java programs developed for Internet applications.
An applet located in distant computer can be downloaded via Internet and
executed on a local computer using Java capable browser.
What is token in Java?
The Java compiler breaks the line of code into text (words) is called Java tokens.
These are the smallest element of the Java program. The Java compiler identified
these words as tokens. These tokens are separated by the delimiters. It is useful for
compilers to detect errors. Remember that the delimiters are not part of the Java
tokens.
token <= identifier | keyword | separator | operator | literal | comment
E.g., public, class, Demo, {, static, void, main, (, String, args, [, ], ), System, .,
out, println, javatpoint, etc. are the Java tokens.
Types of Tokens
Java token includes the following:
o Keywords
o Identifiers
o Literals
o Operators
o Separators
o Comments
Keywords: These are the pre-defined reserved words of any programming
language.
Identifier: Identifiers are used to name a variable, constant, function, class, and
array. It usually defined by the user. It uses letters, underscores, or a dollar sign as
the first character. The label is also known as a special kind of identifier that is used
in the goto statement.
There are some rules to declare identifiers are:
o The first letter of an identifier must be a letter, underscore or a dollar sign. It
cannot start with digits but may contain digits.
o The whitespace cannot be included in the identifier.
o Identifiers are case sensitive.
Some valid identifiers are:
PhoneNumber
PRICE
radius
a
a1
_phonenumber
$circumference
jagged_array
12radius //invalid
Literals: In programming literal is a notation that represents a fixed value (constant)
in the source code. It can be categorized as an integer literal, string literal, Boolean
literal, etc. It is defined by the programmer. Once it has been defined cannot be
changed. Java provides five types of literals are as follows:
o Integer
o Floating Point
o Character
o String
o Boolean
Literal Type
23 int
9.86 Double/float
false, true boolean
'K', '7', '-' char
"javatpoint" String
null any reference type
Operators: In programming, operators are the special symbol that tells the
compiler to perform a special operation. Java provides different types of
operators that can be classified according to the functionality they provide. There are
eight types of operators in Java, are as follows:
o Arithmetic Operators
o Assignment Operators
o Relational Operators
o Unary Operators
o Logical Operators
o Ternary Operators
o Bitwise Operators
o Shift Operators
Separators: The separators in Java is also known as punctuators. There are nine
separators in Java, are as follows:
1. separator <= ; | , | . | ( | ) | { | } | [ | ]
Note that the first three separators (; , and .) are tokens that separate other tokens, and the
last six (3 pairs of braces) separators are also known as delimiters. For example,
Math.pow(9, 3); contains nine tokens.
o Square Brackets []: It is used to define array elements. A pair of square
brackets represents the single-dimensional array, two pairs of square brackets
represent the two-dimensional array.
o Parentheses (): It is used to call the functions and parsing the parameters.
o Curly Braces {}: The curly braces denote the starting and ending of a code
block.
Operator Symbols
Arithmetic + , - , / , * , %
Unary ++ , - - , !
Assignment = , += , -= , *= , /= , %= , ^=
Relational ==, != , < , >, <= , >=
Logical && , ||
Ternary (Condition) ? (Statement1) : (Statement2);
Bitwise & , | , ^ , ~
Shift << , >> , >>>
o Comma (,): It is used to separate two values, statements, and parameters.
o Assignment Operator (=): It is used to assign a variable and constant.
o Semicolon (;): It is the symbol that can be found at end of the statements. It
separates the two statements.
o Period (.): It separates the package name form the sub-packages and class. It
also separates a variable or method from a reference variable.
Comments: Comments allow us to specify information about the program
inside our Java code. Java compiler recognizes these comments as tokens but
excludes it form further processing. The Java compiler treats comments as
whitespaces. Java provides the following two types of comments:
o Line Oriented: It begins with a pair of forwarding slashes (//).
o Block-Oriented: It begins with /* and continues until it founds */.
3.9 Implementing Java Program
Implementation of a Java application program involves a series of steps. They include :
 Creating the program
 Compiling the program
 Running the program
Java Command Line Arguments
The java command-line argument is an argument i.e. passed at the time of running
the java program.
The arguments passed from the console can be received in the java program and it
can be used as an input.
So, it provides a convenient way to check the behavior of the program for the
different values. You can pass N (1,2,3 and so on) numbers of arguments from the
command prompt.
1. compile by > javac A.java
2. run by > java A sonoo jaiswal 1 3 4 5 6

More Related Content

Similar to Overview of java Language-3.pdf

CSL101_Ch1.pptx
CSL101_Ch1.pptxCSL101_Ch1.pptx
CSL101_Ch1.pptxshivanka2
 
a basic java programming and data type.ppt
a basic java programming and data type.ppta basic java programming and data type.ppt
a basic java programming and data type.pptGevitaChinnaiah
 
Java for Mainframers
Java for MainframersJava for Mainframers
Java for MainframersRich Helton
 
Java OOP Concepts 1st Slide
Java OOP Concepts 1st SlideJava OOP Concepts 1st Slide
Java OOP Concepts 1st Slidesunny khan
 
Lecture2_MCS4_Evening.pptx
Lecture2_MCS4_Evening.pptxLecture2_MCS4_Evening.pptx
Lecture2_MCS4_Evening.pptxSaqlainYaqub1
 
Object-Oriented Programming with Java UNIT 1
Object-Oriented Programming with Java UNIT 1Object-Oriented Programming with Java UNIT 1
Object-Oriented Programming with Java UNIT 1SURBHI SAROHA
 
Class IX Input in Java using Scanner Class (1).pptx
Class IX  Input in Java using Scanner Class (1).pptxClass IX  Input in Java using Scanner Class (1).pptx
Class IX Input in Java using Scanner Class (1).pptxrinkugupta37
 
2013 bookmatter learn_javaforandroiddevelopment
2013 bookmatter learn_javaforandroiddevelopment2013 bookmatter learn_javaforandroiddevelopment
2013 bookmatter learn_javaforandroiddevelopmentCarlosPineda729332
 
Modern_2.pptx for java
Modern_2.pptx for java Modern_2.pptx for java
Modern_2.pptx for java MayaTofik
 

Similar to Overview of java Language-3.pdf (20)

Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Chapter 2 java
Chapter 2 javaChapter 2 java
Chapter 2 java
 
Chapter 2
Chapter 2Chapter 2
Chapter 2
 
CSL101_Ch1.ppt
CSL101_Ch1.pptCSL101_Ch1.ppt
CSL101_Ch1.ppt
 
CSL101_Ch1.pptx
CSL101_Ch1.pptxCSL101_Ch1.pptx
CSL101_Ch1.pptx
 
CSL101_Ch1.pptx
CSL101_Ch1.pptxCSL101_Ch1.pptx
CSL101_Ch1.pptx
 
CSL101_Ch1.ppt
CSL101_Ch1.pptCSL101_Ch1.ppt
CSL101_Ch1.ppt
 
a basic java programming and data type.ppt
a basic java programming and data type.ppta basic java programming and data type.ppt
a basic java programming and data type.ppt
 
Java_Roadmap.pptx
Java_Roadmap.pptxJava_Roadmap.pptx
Java_Roadmap.pptx
 
java token
java tokenjava token
java token
 
Java for Mainframers
Java for MainframersJava for Mainframers
Java for Mainframers
 
Core java
Core javaCore java
Core java
 
Java OOP Concepts 1st Slide
Java OOP Concepts 1st SlideJava OOP Concepts 1st Slide
Java OOP Concepts 1st Slide
 
Lecture2_MCS4_Evening.pptx
Lecture2_MCS4_Evening.pptxLecture2_MCS4_Evening.pptx
Lecture2_MCS4_Evening.pptx
 
Object-Oriented Programming with Java UNIT 1
Object-Oriented Programming with Java UNIT 1Object-Oriented Programming with Java UNIT 1
Object-Oriented Programming with Java UNIT 1
 
Java fundamentals
Java fundamentalsJava fundamentals
Java fundamentals
 
Class IX Input in Java using Scanner Class (1).pptx
Class IX  Input in Java using Scanner Class (1).pptxClass IX  Input in Java using Scanner Class (1).pptx
Class IX Input in Java using Scanner Class (1).pptx
 
2013 bookmatter learn_javaforandroiddevelopment
2013 bookmatter learn_javaforandroiddevelopment2013 bookmatter learn_javaforandroiddevelopment
2013 bookmatter learn_javaforandroiddevelopment
 
Modern_2.pptx for java
Modern_2.pptx for java Modern_2.pptx for java
Modern_2.pptx for java
 
Java unit 2
Java unit 2Java unit 2
Java unit 2
 

More from kumari36

Virtualize of IO Devices .docx
Virtualize of IO Devices .docxVirtualize of IO Devices .docx
Virtualize of IO Devices .docxkumari36
 
VIRTUALIZATION STRUCTURES TOOLS.docx
VIRTUALIZATION STRUCTURES TOOLS.docxVIRTUALIZATION STRUCTURES TOOLS.docx
VIRTUALIZATION STRUCTURES TOOLS.docxkumari36
 
Operating System extension.docx
Operating System extension.docxOperating System extension.docx
Operating System extension.docxkumari36
 
Levels of Virtualization.docx
Levels of Virtualization.docxLevels of Virtualization.docx
Levels of Virtualization.docxkumari36
 
Java Evolution-2.pdf
Java Evolution-2.pdfJava Evolution-2.pdf
Java Evolution-2.pdfkumari36
 
Inheritance in Java.pdf
Inheritance in Java.pdfInheritance in Java.pdf
Inheritance in Java.pdfkumari36
 
Constructors in Java (2).pdf
Constructors in Java (2).pdfConstructors in Java (2).pdf
Constructors in Java (2).pdfkumari36
 
Chapter4-var.pdf
Chapter4-var.pdfChapter4-var.pdf
Chapter4-var.pdfkumari36
 
softwareMaintenance.pdf
softwareMaintenance.pdfsoftwareMaintenance.pdf
softwareMaintenance.pdfkumari36
 
testing.pdf
testing.pdftesting.pdf
testing.pdfkumari36
 
Debugging.pdf
Debugging.pdfDebugging.pdf
Debugging.pdfkumari36
 
QualityAssurance.pdf
QualityAssurance.pdfQualityAssurance.pdf
QualityAssurance.pdfkumari36
 
Prediction of heart disease using machine learning.pptx
Prediction of heart disease using machine learning.pptxPrediction of heart disease using machine learning.pptx
Prediction of heart disease using machine learning.pptxkumari36
 
Fast Wavelet Based Image Characterization for Highly Adaptive Image Retrieval...
Fast Wavelet Based Image Characterization for Highly Adaptive Image Retrieval...Fast Wavelet Based Image Characterization for Highly Adaptive Image Retrieval...
Fast Wavelet Based Image Characterization for Highly Adaptive Image Retrieval...kumari36
 
Presentation1.4.pptx
Presentation1.4.pptxPresentation1.4.pptx
Presentation1.4.pptxkumari36
 
Presentation1.3.pptx
Presentation1.3.pptxPresentation1.3.pptx
Presentation1.3.pptxkumari36
 
Cloud 1.2.pptx
Cloud 1.2.pptxCloud 1.2.pptx
Cloud 1.2.pptxkumari36
 
Cloud Computing Introduction
 Cloud Computing Introduction Cloud Computing Introduction
Cloud Computing Introductionkumari36
 
Impact of Data Science
Impact of Data Science Impact of Data Science
Impact of Data Science kumari36
 
Morphological Image Processing
Morphological Image ProcessingMorphological Image Processing
Morphological Image Processingkumari36
 

More from kumari36 (20)

Virtualize of IO Devices .docx
Virtualize of IO Devices .docxVirtualize of IO Devices .docx
Virtualize of IO Devices .docx
 
VIRTUALIZATION STRUCTURES TOOLS.docx
VIRTUALIZATION STRUCTURES TOOLS.docxVIRTUALIZATION STRUCTURES TOOLS.docx
VIRTUALIZATION STRUCTURES TOOLS.docx
 
Operating System extension.docx
Operating System extension.docxOperating System extension.docx
Operating System extension.docx
 
Levels of Virtualization.docx
Levels of Virtualization.docxLevels of Virtualization.docx
Levels of Virtualization.docx
 
Java Evolution-2.pdf
Java Evolution-2.pdfJava Evolution-2.pdf
Java Evolution-2.pdf
 
Inheritance in Java.pdf
Inheritance in Java.pdfInheritance in Java.pdf
Inheritance in Java.pdf
 
Constructors in Java (2).pdf
Constructors in Java (2).pdfConstructors in Java (2).pdf
Constructors in Java (2).pdf
 
Chapter4-var.pdf
Chapter4-var.pdfChapter4-var.pdf
Chapter4-var.pdf
 
softwareMaintenance.pdf
softwareMaintenance.pdfsoftwareMaintenance.pdf
softwareMaintenance.pdf
 
testing.pdf
testing.pdftesting.pdf
testing.pdf
 
Debugging.pdf
Debugging.pdfDebugging.pdf
Debugging.pdf
 
QualityAssurance.pdf
QualityAssurance.pdfQualityAssurance.pdf
QualityAssurance.pdf
 
Prediction of heart disease using machine learning.pptx
Prediction of heart disease using machine learning.pptxPrediction of heart disease using machine learning.pptx
Prediction of heart disease using machine learning.pptx
 
Fast Wavelet Based Image Characterization for Highly Adaptive Image Retrieval...
Fast Wavelet Based Image Characterization for Highly Adaptive Image Retrieval...Fast Wavelet Based Image Characterization for Highly Adaptive Image Retrieval...
Fast Wavelet Based Image Characterization for Highly Adaptive Image Retrieval...
 
Presentation1.4.pptx
Presentation1.4.pptxPresentation1.4.pptx
Presentation1.4.pptx
 
Presentation1.3.pptx
Presentation1.3.pptxPresentation1.3.pptx
Presentation1.3.pptx
 
Cloud 1.2.pptx
Cloud 1.2.pptxCloud 1.2.pptx
Cloud 1.2.pptx
 
Cloud Computing Introduction
 Cloud Computing Introduction Cloud Computing Introduction
Cloud Computing Introduction
 
Impact of Data Science
Impact of Data Science Impact of Data Science
Impact of Data Science
 
Morphological Image Processing
Morphological Image ProcessingMorphological Image Processing
Morphological Image Processing
 

Recently uploaded

ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 

Recently uploaded (20)

ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 

Overview of java Language-3.pdf

  • 1. Overview of java Language: Where Java is used? There are many devices where java is currently used. Some of them are as follows:  Desktop Applications  Web Applications  Mobile  Embedded System  Robotics  Games etc. Types of Java Applications  Application programs Application programs are stand-alone programs that are written to carry out certain tasks on local computer such as solving equations, reading and writing files etc.  Applet Programs Applets are small Java programs developed for Internet applications. An applet located in distant computer can be downloaded via Internet and executed on a local computer using Java capable browser.
  • 2.
  • 3.
  • 4. What is token in Java? The Java compiler breaks the line of code into text (words) is called Java tokens. These are the smallest element of the Java program. The Java compiler identified these words as tokens. These tokens are separated by the delimiters. It is useful for compilers to detect errors. Remember that the delimiters are not part of the Java tokens. token <= identifier | keyword | separator | operator | literal | comment E.g., public, class, Demo, {, static, void, main, (, String, args, [, ], ), System, ., out, println, javatpoint, etc. are the Java tokens. Types of Tokens Java token includes the following: o Keywords o Identifiers o Literals
  • 5. o Operators o Separators o Comments Keywords: These are the pre-defined reserved words of any programming language. Identifier: Identifiers are used to name a variable, constant, function, class, and array. It usually defined by the user. It uses letters, underscores, or a dollar sign as the first character. The label is also known as a special kind of identifier that is used in the goto statement. There are some rules to declare identifiers are: o The first letter of an identifier must be a letter, underscore or a dollar sign. It cannot start with digits but may contain digits. o The whitespace cannot be included in the identifier. o Identifiers are case sensitive. Some valid identifiers are: PhoneNumber PRICE radius a a1 _phonenumber $circumference jagged_array 12radius //invalid Literals: In programming literal is a notation that represents a fixed value (constant) in the source code. It can be categorized as an integer literal, string literal, Boolean literal, etc. It is defined by the programmer. Once it has been defined cannot be changed. Java provides five types of literals are as follows:
  • 6. o Integer o Floating Point o Character o String o Boolean Literal Type 23 int 9.86 Double/float false, true boolean 'K', '7', '-' char "javatpoint" String null any reference type Operators: In programming, operators are the special symbol that tells the compiler to perform a special operation. Java provides different types of operators that can be classified according to the functionality they provide. There are eight types of operators in Java, are as follows: o Arithmetic Operators o Assignment Operators o Relational Operators o Unary Operators o Logical Operators o Ternary Operators o Bitwise Operators o Shift Operators
  • 7. Separators: The separators in Java is also known as punctuators. There are nine separators in Java, are as follows: 1. separator <= ; | , | . | ( | ) | { | } | [ | ] Note that the first three separators (; , and .) are tokens that separate other tokens, and the last six (3 pairs of braces) separators are also known as delimiters. For example, Math.pow(9, 3); contains nine tokens. o Square Brackets []: It is used to define array elements. A pair of square brackets represents the single-dimensional array, two pairs of square brackets represent the two-dimensional array. o Parentheses (): It is used to call the functions and parsing the parameters. o Curly Braces {}: The curly braces denote the starting and ending of a code block. Operator Symbols Arithmetic + , - , / , * , % Unary ++ , - - , ! Assignment = , += , -= , *= , /= , %= , ^= Relational ==, != , < , >, <= , >= Logical && , || Ternary (Condition) ? (Statement1) : (Statement2); Bitwise & , | , ^ , ~ Shift << , >> , >>>
  • 8. o Comma (,): It is used to separate two values, statements, and parameters. o Assignment Operator (=): It is used to assign a variable and constant. o Semicolon (;): It is the symbol that can be found at end of the statements. It separates the two statements. o Period (.): It separates the package name form the sub-packages and class. It also separates a variable or method from a reference variable. Comments: Comments allow us to specify information about the program inside our Java code. Java compiler recognizes these comments as tokens but excludes it form further processing. The Java compiler treats comments as whitespaces. Java provides the following two types of comments: o Line Oriented: It begins with a pair of forwarding slashes (//). o Block-Oriented: It begins with /* and continues until it founds */. 3.9 Implementing Java Program Implementation of a Java application program involves a series of steps. They include :  Creating the program  Compiling the program  Running the program
  • 9. Java Command Line Arguments The java command-line argument is an argument i.e. passed at the time of running the java program. The arguments passed from the console can be received in the java program and it can be used as an input. So, it provides a convenient way to check the behavior of the program for the different values. You can pass N (1,2,3 and so on) numbers of arguments from the command prompt. 1. compile by > javac A.java
  • 10. 2. run by > java A sonoo jaiswal 1 3 4 5 6