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 Rating

   
 Q41. Which of the following is false for final ?

a. Final methods cannot be overriden
b. Final methods cannot be overloaded
c. Final classes cannot be subclassed
d. Final class cannot be abstract
Ans. Final methods cannot be overloaded

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

   Like         Discuss         Correct / Improve     java   final   java keyword


 Q42. Which of the following combination of keywords is illegal in Java ?

a. static and transient
b. transient and final
c. static and synchronized
d. abstract and final
Core Java
Ans. abstract and final

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

   Like         Discuss         Correct / Improve     java   java keywords     Asked in 2 Companies      basic


 Q43. Which of the following keyword is not permitted for outer class ?

a. public
b. abstract
c. final
d. protected
Ans. protected

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

   Like         Discuss         Correct / Improve     java   java keywords


 Q44. Can we add more elements to an array list that has been marked as final ?
Ans. Yes, the array list can hold more elements. Final only puts the restriction that the array list reference cannot hold any other array list.

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

   Like         Discuss         Correct / Improve     ebay   collections   arraylist   final keyword


 Q45. Why can't we declare a class abstract as well as final ?Core Java
Ans. Abstract means that the class is only meant to be subclassed whereas final means that it cannot be subclassed so both concepts - abstract and final are actually mutually exclusive and hence not permitted together.

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

   Like         Discuss         Correct / Improve     abstract   final   java keywords     Asked in 1 Companies


 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: