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

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers - Order By Newest

   
 Q31. Is delete a keyword in Java ?Core Java
Ans. No, delete is not a keyword in Java. Destruction of objects is taken care by Java Garbage Collection mechanism.

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

   Like         Discuss         Correct / Improve     delete  keywords     Asked in 1 Companies


 Q32. Is exit a keyword in Java ?Core Java
Ans. No exit is a method to exit execution of a program.

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

   Like         Discuss         Correct / Improve     exit  keywords  exit a program     Asked in 1 Companies


 Q33. Which of the following applies to Final ?

It is a keyword
It is a modifier
It is an access modifier
Core Java
Ans. It is a keyword and a modifier but not an access modifier.

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

   Like         Discuss         Correct / Improve     keyword  modifier


 Q34. Which of the following applies to "private"?

It is a keyword
It is a modifier
It is an access modifier
Core Java
Ans. Yes, all of them applies to private keyword. It is an access modifier.

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

   Like         Discuss         Correct / Improve     keyword  modifier


 Q35. What is a difference between Identifier and keyword ?Core Java
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


 Q36. Can we use java keywords as identifiers ?Core Java
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


 Q37. Can we use true and false as identifiers in java ? Are they keywords in Java ?Core Java
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


 Q38. Why is goto not used in Java?Core Java
Ans. Goto statement results in unstructured jumps in control from one code location to another and hence makes the code very difficult
to read , maintain and debug. Moreover Goto can always be replaced using other statements like break / continue and hence results in structured movement of programming control.

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

   Like         Discuss         Correct / Improve     goto  keywords


 Q39. Which are the reserved words in Java ?Core Java
Ans. All Keywords , modifiers ( public , static , final etc ) as well as non modifier keywords ( for, if,switch etc ) are reserved words in java and hence cannot be used as identifiers. Along with keywords , there are few literals that have predefined meaning and hence cannot be used as identifiers, these are true , false and null.

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

   Like         Discuss         Correct / Improve     java keywords  java reserved words


 Q40. What is the use of final keyword ?Core Java
Ans. final keyword is a modifier that means differently when applied to variables, methods and classes.

1. Final variable cannot be changed once initialized
2. Final method cannot be overridden
3. Final class cannot be sub classed

  Sample Code for final variable

  Sample Code for final method

  Sample Code for final class

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

   Like         Discuss         Correct / Improve     final  final keyword     Asked in 1 Companies      Basic        frequent


 Q41. How different is it when final applied to variables and object references ? Core Java
Ans. final when assigned to object references doesn't make them immutable. It means that the references cannot be de-referenced.

final when applied to variables means that the value cannot be changed.

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

   Like         Discuss         Correct / Improve     final keyword  final variable


 Q42. Why Java has final class ?Core Java
 This question was recently asked at 'Avis'.This question is still unanswered. Can you please provide an answer.


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

   Like         Discuss         Correct / Improve     final class   final keyword     Asked in 1 Companies      basic


 Q43. Are final methods faster than regular instance methods ?Core Java
Ans. Yes. As they cannot be overridden , there is no use of virtual table concept which is used for dynamic binding resolution.

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

   Like         Discuss         Correct / Improve     final methods   final keyword      expert


 Q44. Can we declare an Interface with abstract keyword ? Core Java
Ans. Yes

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

   Like         Discuss         Correct / Improve     abstract keyword


 Q45. What is the Main Advantage of the native Key Word?Core Java
 This question is still unanswered. Can you please provide an answer.


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

   Like         Discuss         Correct / Improve     native keyword


 Q46. What will be the output of following code ?

public class BuggyBread {

   private int x;

   private BuggyBread(int x){
      x = x;
   };

   public static void main(String[] args){
      BuggyBread buggybread = new BuggyBread(5);
      System.out.println(buggybread.x);
   }
}
Core Java
a. compilation error
b. undefined
c. 0
d. 5

Ans.c. 0

 Q47. The use of volatile keyword facilitates ..Core Java
a. Making Use of Cache for better Performance
b. Avoiding use of Cache
c. Making use of Backward as well as Forward Cache
d. Keeping only one copy of variable in Cache

Ans.b. Avoiding use of Cache

 Q48. Which of following keyword is not allowed for Outer Class ?Core Java
a. public
b. private
c. abstract
d. final

Ans.b. private

 Q49. Which of the following keyword restrict the class from being extended ?Core Java
a. Private
b. Abstract
c. Final
d. Static

Ans.c. Final

 Q50. Which of the following keyword restrict the class from being instantiated ?Core Java
a. Private
b. Abstract
c. Final
d. Static

Ans.b. Abstract

previous 30   

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: