Java - Interview Questions and Answers for 'Identifier' | Search Java Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com
Share

Search Java Interview Questions


 2098 questions in repository.
 There are more than 200 unanswered questions.
Click here and help us by providing the answer.
Label / Company      Label / Company / Text

   



Interview Questions and Answers for 'Identifier' - 6 question(s) found - Order By Newest

 Q1. Is it a valid identifier in Java ?

int 123Abc = 5;
Core Java2016-10-25 09:10:02

Ans. No, identifier in java cannot start with a numeral.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     identifiers


 Q2. Is synchronized a keyword , modifier, identifier? what is it ?Core Java2017-04-26 19:48:55

Ans. synchronized is a keyword and a modifier. The synchronized keyword is used to indicate that a method can be accessed exclusively by one thread at a time.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     synchronization  synchronized  modifier  identifier     HCL Technologies


 Q3. What is a difference between Identifier and keyword ?Core Java2017-04-26 20:01:21

Ans. Keyword is a reserved word that has a pre defined meaning for the compiler and hence cannot be used as an identifier, for example - final, private , for etc.

Identifier is the name given by the programmer to a programming construct, for example - class and method names etc.

java Keywords cannot be used as an identifier in java.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     identifier  keyword


 Q4. Can we use java keywords as identifiers ?Core Java2017-04-26 20:02:06

Ans. No, keyword has pre defined meaning for compiler and hence cannot be used as identifiers.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     keywords  identifier


 Q5. Can we use true and false as identifiers in java ? Are they keywords in Java ?Core Java2017-04-30 09:40:17

Ans. true and false are literals in java. No we cannot use them as identifiers.

  Sample Code for literal

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     identifiers  keywords  literals


 Q6. What is the difference between keywords, identifiers and literals in java ?Core Java2017-04-30 09:45:27

Ans. Keywords are the reserved words that have a pre defined meaning for the compiler and hence are restricted to be used as identifiers.

Identifiers are the name assigned to different programming constructs like classes, interfaces, methods , variables etc.

Literals are the values that are assigned to Identifiers.

For example

int count = 0;

in the above statement "int" is a keyword, "count" is an identifier and "0" is a literal

  Sample Code for keywords

  Sample Code for identifiers

  Sample Code for literals

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     keywords  literals  identifiers




Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus
 

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked:
         

X Close this

X Close this

Help Us Improve.
Please share your
interview experience.

Company Name:   


Questions Asked: