SlideShare a Scribd company logo
1 of 8
Identifier :
 A name in java program is called identifier. It may be class name,
method name, variable name and label name.
Example:
Rules to define java identifiers:
Rule 1:
The only allowed characters in java identifiers are:
1) a to z
2) 2) A to Z
3) 3) 0 to 9
4) 4) _ (underscore)
5) 5) $
Rule 2:
 If we are using any other character we will get compile time error.
Example:
1. total_number-------valid
2. Total#------------------invalid
Rule 3:
 identifiers are not allowed to starts with digit.
Example:
1. ABC123---------valid
2. 123ABC---------invalid
Rule 4:
 java identifiers are case sensitive up course java language itself treated as case
sensitive language
Example:
class Test
{
int number=10;
int Number=20;
int NUMBER=20; we can differentiate with case.
int NuMbEr=30;
}
Rule 5:
 There is no length limit for java identifiers but it is not recommended to take
more than 15 lengths.
Rule 6:
 We can't use reserved words as identifiers.
Example:
int if=10; --------------invalid
Rule 7:
All predefined java class names and interface names we use as identifiers.
Example1:
class Test
{
public static void main(String[] args){
int String=10;
System.out.println(String);
}}
Output:
10
Example 2:
class Test
{
public static void main(String[] args){
int Runnable=10;
System.out.println(Runnable);
}}
Output:
10
 Even though it is legal to use class names and interface names as identifiers but
it is not a good programming practice.
Which of the following are valid java identifiers?

More Related Content

What's hot

classes and objects in C++
classes and objects in C++classes and objects in C++
classes and objects in C++HalaiHansaika
 
Java And Multithreading
Java And MultithreadingJava And Multithreading
Java And MultithreadingShraddha
 
Java variable types
Java variable typesJava variable types
Java variable typesSoba Arjun
 
Operator Overloading
Operator OverloadingOperator Overloading
Operator OverloadingNilesh Dalvi
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++rprajat007
 
oops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaoops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaCPD INDIA
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Conceptsthinkphp
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++Vineeta Garg
 
Modules and packages in python
Modules and packages in pythonModules and packages in python
Modules and packages in pythonTMARAGATHAM
 
INLINE FUNCTION IN C++
INLINE FUNCTION IN C++INLINE FUNCTION IN C++
INLINE FUNCTION IN C++Vraj Patel
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Michelle Anne Meralpis
 
operator overloading & type conversion in cpp over view || c++
operator overloading & type conversion in cpp over view || c++operator overloading & type conversion in cpp over view || c++
operator overloading & type conversion in cpp over view || c++gourav kottawar
 

What's hot (20)

Constructor in java
Constructor in javaConstructor in java
Constructor in java
 
classes and objects in C++
classes and objects in C++classes and objects in C++
classes and objects in C++
 
Methods in Java
Methods in JavaMethods in Java
Methods in Java
 
Java threading
Java threadingJava threading
Java threading
 
Java And Multithreading
Java And MultithreadingJava And Multithreading
Java And Multithreading
 
Interface in java
Interface in javaInterface in java
Interface in java
 
C# classes objects
C#  classes objectsC#  classes objects
C# classes objects
 
Java variable types
Java variable typesJava variable types
Java variable types
 
Operator Overloading
Operator OverloadingOperator Overloading
Operator Overloading
 
Java awt
Java awtJava awt
Java awt
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++
 
oops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaoops concept in java | object oriented programming in java
oops concept in java | object oriented programming in java
 
5bit field
5bit field5bit field
5bit field
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
Inheritance in c++
Inheritance in c++Inheritance in c++
Inheritance in c++
 
Modules and packages in python
Modules and packages in pythonModules and packages in python
Modules and packages in python
 
INLINE FUNCTION IN C++
INLINE FUNCTION IN C++INLINE FUNCTION IN C++
INLINE FUNCTION IN C++
 
Chapter 07 inheritance
Chapter 07 inheritanceChapter 07 inheritance
Chapter 07 inheritance
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
 
operator overloading & type conversion in cpp over view || c++
operator overloading & type conversion in cpp over view || c++operator overloading & type conversion in cpp over view || c++
operator overloading & type conversion in cpp over view || c++
 

Viewers also liked

Cpl Science, Engineering & Construction Brochure 2014
Cpl Science, Engineering & Construction Brochure 2014Cpl Science, Engineering & Construction Brochure 2014
Cpl Science, Engineering & Construction Brochure 2014Claire McCormack BBS HRM
 
Evaluation October 2015
Evaluation October 2015Evaluation October 2015
Evaluation October 2015Arsen Tomic
 
инклюзия
инклюзияинклюзия
инклюзияIrina Kost
 
Best_Sourcing_Practices - Final
Best_Sourcing_Practices - FinalBest_Sourcing_Practices - Final
Best_Sourcing_Practices - FinalAshley Zito Rowe
 
Past work (design / layout)
Past work (design / layout)Past work (design / layout)
Past work (design / layout)Kumi Kawai
 
Portfolio for john hawkins linkdin
Portfolio for john hawkins linkdinPortfolio for john hawkins linkdin
Portfolio for john hawkins linkdinJohn Hawkins
 
LeonCordeau_resume_2016.1
LeonCordeau_resume_2016.1LeonCordeau_resume_2016.1
LeonCordeau_resume_2016.1Leon Cordeau
 
FEDOROV, A. FILM STUDIES IN THE UNIVERSITY STUDENTS' AUDIENCE: FROM ENTERTAIN...
FEDOROV, A. FILM STUDIES IN THE UNIVERSITY STUDENTS' AUDIENCE: FROM ENTERTAIN...FEDOROV, A. FILM STUDIES IN THE UNIVERSITY STUDENTS' AUDIENCE: FROM ENTERTAIN...
FEDOROV, A. FILM STUDIES IN THE UNIVERSITY STUDENTS' AUDIENCE: FROM ENTERTAIN...Alexander Fedorov
 
Additive manufacturing technology
Additive manufacturing technologyAdditive manufacturing technology
Additive manufacturing technologyRAMESH R
 
Minteer, 777X Fuel System Team Lead Historical Resume 170201
Minteer, 777X Fuel System Team Lead Historical Resume 170201Minteer, 777X Fuel System Team Lead Historical Resume 170201
Minteer, 777X Fuel System Team Lead Historical Resume 170201David Minteer
 

Viewers also liked (16)

Cpl Science, Engineering & Construction Brochure 2014
Cpl Science, Engineering & Construction Brochure 2014Cpl Science, Engineering & Construction Brochure 2014
Cpl Science, Engineering & Construction Brochure 2014
 
Evaluation October 2015
Evaluation October 2015Evaluation October 2015
Evaluation October 2015
 
инклюзия
инклюзияинклюзия
инклюзия
 
2015 resume
2015 resume2015 resume
2015 resume
 
Best_Sourcing_Practices - Final
Best_Sourcing_Practices - FinalBest_Sourcing_Practices - Final
Best_Sourcing_Practices - Final
 
Digital literacyumrav
Digital literacyumravDigital literacyumrav
Digital literacyumrav
 
Past work (design / layout)
Past work (design / layout)Past work (design / layout)
Past work (design / layout)
 
Mrs k Goulding Smith
Mrs k Goulding Smith Mrs k Goulding Smith
Mrs k Goulding Smith
 
Portfolio for john hawkins linkdin
Portfolio for john hawkins linkdinPortfolio for john hawkins linkdin
Portfolio for john hawkins linkdin
 
LeonCordeau_resume_2016.1
LeonCordeau_resume_2016.1LeonCordeau_resume_2016.1
LeonCordeau_resume_2016.1
 
FEDOROV, A. FILM STUDIES IN THE UNIVERSITY STUDENTS' AUDIENCE: FROM ENTERTAIN...
FEDOROV, A. FILM STUDIES IN THE UNIVERSITY STUDENTS' AUDIENCE: FROM ENTERTAIN...FEDOROV, A. FILM STUDIES IN THE UNIVERSITY STUDENTS' AUDIENCE: FROM ENTERTAIN...
FEDOROV, A. FILM STUDIES IN THE UNIVERSITY STUDENTS' AUDIENCE: FROM ENTERTAIN...
 
Certificate_Master
Certificate_MasterCertificate_Master
Certificate_Master
 
Test ppt
Test pptTest ppt
Test ppt
 
Additive manufacturing technology
Additive manufacturing technologyAdditive manufacturing technology
Additive manufacturing technology
 
Minteer, 777X Fuel System Team Lead Historical Resume 170201
Minteer, 777X Fuel System Team Lead Historical Resume 170201Minteer, 777X Fuel System Team Lead Historical Resume 170201
Minteer, 777X Fuel System Team Lead Historical Resume 170201
 
RIAZI-CV
RIAZI-CVRIAZI-CV
RIAZI-CV
 

Similar to Identifier

Similar to Identifier (20)

Core_Java_with_SCJP_OCJP_Notes_By_Durga.pdf
Core_Java_with_SCJP_OCJP_Notes_By_Durga.pdfCore_Java_with_SCJP_OCJP_Notes_By_Durga.pdf
Core_Java_with_SCJP_OCJP_Notes_By_Durga.pdf
 
CHAPTER 3 - VALUE AND DATA TYPES LECTURE 1.pdf
CHAPTER 3 - VALUE AND DATA TYPES LECTURE 1.pdfCHAPTER 3 - VALUE AND DATA TYPES LECTURE 1.pdf
CHAPTER 3 - VALUE AND DATA TYPES LECTURE 1.pdf
 
Overview of java Language-3.pdf
Overview of java Language-3.pdfOverview of java Language-3.pdf
Overview of java Language-3.pdf
 
OCA Java SE 8 Exam Chapter 1 Java Building Blocks
OCA Java SE 8 Exam Chapter 1 Java Building BlocksOCA Java SE 8 Exam Chapter 1 Java Building Blocks
OCA Java SE 8 Exam Chapter 1 Java Building Blocks
 
Lec 1.3 Object Oriented Programming
Lec 1.3 Object Oriented ProgrammingLec 1.3 Object Oriented Programming
Lec 1.3 Object Oriented Programming
 
c# keywords, identifiers and Naming Conventions
c# keywords, identifiers and Naming Conventionsc# keywords, identifiers and Naming Conventions
c# keywords, identifiers and Naming Conventions
 
Introduction to c++
Introduction to c++Introduction to c++
Introduction to c++
 
java intro.pptx.pdf
java intro.pptx.pdfjava intro.pptx.pdf
java intro.pptx.pdf
 
Java fundamentals
Java fundamentalsJava fundamentals
Java fundamentals
 
Core java
Core javaCore java
Core java
 
dizital pods session 2.pptx
dizital pods session 2.pptxdizital pods session 2.pptx
dizital pods session 2.pptx
 
Java basic concept
Java basic conceptJava basic concept
Java basic concept
 
OOPSCA1.pptx
OOPSCA1.pptxOOPSCA1.pptx
OOPSCA1.pptx
 
Learn To Code: Diving deep into java
Learn To Code: Diving deep into javaLearn To Code: Diving deep into java
Learn To Code: Diving deep into java
 
Java unit 2
Java unit 2Java unit 2
Java unit 2
 
Chapter 2 java
Chapter 2 javaChapter 2 java
Chapter 2 java
 
Object Oriented Principles
Object Oriented PrinciplesObject Oriented Principles
Object Oriented Principles
 
Java scjp-part1
Java scjp-part1Java scjp-part1
Java scjp-part1
 
Preparing Java 7 Certifications
Preparing Java 7 CertificationsPreparing Java 7 Certifications
Preparing Java 7 Certifications
 
Essential language features
Essential language featuresEssential language features
Essential language features
 

Recently uploaded

Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 

Recently uploaded (20)

Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 

Identifier

  • 1. Identifier :  A name in java program is called identifier. It may be class name, method name, variable name and label name. Example:
  • 2. Rules to define java identifiers: Rule 1: The only allowed characters in java identifiers are: 1) a to z 2) 2) A to Z 3) 3) 0 to 9 4) 4) _ (underscore) 5) 5) $
  • 3. Rule 2:  If we are using any other character we will get compile time error. Example: 1. total_number-------valid 2. Total#------------------invalid Rule 3:  identifiers are not allowed to starts with digit. Example: 1. ABC123---------valid 2. 123ABC---------invalid
  • 4. Rule 4:  java identifiers are case sensitive up course java language itself treated as case sensitive language Example: class Test { int number=10; int Number=20; int NUMBER=20; we can differentiate with case. int NuMbEr=30; }
  • 5. Rule 5:  There is no length limit for java identifiers but it is not recommended to take more than 15 lengths. Rule 6:  We can't use reserved words as identifiers. Example: int if=10; --------------invalid
  • 6. Rule 7: All predefined java class names and interface names we use as identifiers. Example1: class Test { public static void main(String[] args){ int String=10; System.out.println(String); }} Output: 10
  • 7. Example 2: class Test { public static void main(String[] args){ int Runnable=10; System.out.println(Runnable); }} Output: 10  Even though it is legal to use class names and interface names as identifiers but it is not a good programming practice.
  • 8. Which of the following are valid java identifiers?