Showing posts with label Rules for Defining Identifier. Show all posts
Showing posts with label Rules for Defining Identifier. Show all posts

Java- Identifiers /Chapter - 1 /Language Fundamental



Que: What is Identifier in JAVA?
Ans:  Any name in a java program is called identifier. It can be a class name, variable name, method name, label name.

example:-
Q. How many identifiers are in the following program?



 Ans is
(D)
Description:-

Test, String & System are class names means 3.
main()  & println()are methods means 2.
args is a reference variable of String[] means 1
Hence there are total 3+2+1= 6 identifiers..Rules For Defining Java Identifier

Rules For Defining Java Identifier




Rule 1.
a to z
A to Z
0 to 9
$ and _



example:-
total_number           (valid)

total#                      (invalid) 


If we are using other than this we will get compile time error.

Java- Identifiers /Chapter - 1 /Language Fundamental

javabychetan.blogspot.com



 Que: What is Identifier in JAVA?
Ans:  Any name in a java program is called identifier. It can be a class name, variable name,method name,label name.







example:-
Q. How many identifiers are in the following program?



 Ans is
(D)
Description:-

Test,String & System are class name means 3.
main()  & println()are methods means 2.
args is a reference variable of String[] means 1
Hence there are total 3+2+1= 6 identifiers..


Rules For Defining a Java Identifier

Flipkart End Of Season Sale






© Copyright 2017 Javabychetan.blogspot.com