Interview Questions and Answers for 'Program' | 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

   
 Q41. 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


 Q42. How are the concept of Association related to Composition and Inheritance ?Core Java
Ans. Composition and Inheritance are the different types of Associations for Classes.

Composition is a has-a association between classes.
Inheritance is a is-a association between classes.

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

   Like         Discuss         Correct / Improve     composition  object oriented programming (oops)  oops concepts  inheritance  object oriented programming (oops)  oops concepts  association  relationship between objects


 Q43. Which of the two - compile time and run time polymorphism - requires signature of the method to be different ?Core Java
Ans. runtime polymorphism or method overriding doesn't require method name and signature to be different whereas compile time polymorphism or method overloading requires method name to be same but the signature to be different.

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

   Like         Discuss         Correct / Improve     polymorphism  object oriented programming (oops)  oops concepts  overloading  overriding      basic


 Q44. What is "dynamic method dispatch" in java ?Core Java
Ans. dynamic method dispatch is a process in which a call to an
overridden method is resolved at runtime rather than at compile-time. This is used to achieve runtime polymorphism in java.

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

   Like         Discuss         Correct / Improve     overriding  runtime polymorphism  object oriented programming (oops)  oops concepts


 Q45. What is dynamic dispatch in Java ?Core Java
Ans. Dynamic dispatch in java is also known as runtime polymorphism.It is a process in which a call to an overriden method is resolved at runtime.

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

   Like         Discuss         Correct / Improve     dynamic dispatch  runtime polymorphism  object oriented programming (oops)  oops concepts


 Q46. What happens to private variables during inheritance ?Core Java
Ans. Private variables are not inherited. They are simply ignored and not made part of the derived object body.

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

   Like         Discuss         Correct / Improve     private variables  inheritance  object oriented programming (oops)  oops concepts


 Q47. How can we hide a class in Java ?Core Java
Ans. By encapsulating it within another class and declaring it private. In such a case, it will only be accessible through parent class or parent class object.

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

   Like         Discuss         Correct / Improve     private class   private inner class  class hiding  encapsulation  object oriented programming (oops)  oops concepts  inner classes   nested classes


 Q48. How would you explain the statement "Java Programs are collection of objects" ?Core Java
Ans. Java Programs are collection of objects that communicates with each other to get a task accomplished. To add to those objects, there are common spaces ( static i.e common for objects belonging to a class ) that are used too.

We can visualize objects as departments of an organization in real world. Just like Task gets initiated in one department and then files are moved across different departments to get work done. In a similar fashion, a task is initiated in one object ( having main method ) and then information ( through POJOs / DTOs ) is moved across objects to accomplish a task.

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

   Like         Discuss         Correct / Improve     objects  Java Programs are collection of objects  real life example of object communication


 Q49. Write a method, that compare two numbers and return the bigger one ?Core Java
Ans. int compare(int a, int b) {
a>b? return a: return b;
}

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

   Like         Discuss         Correct / Improve     code  program  coding     Asked in 1 Companies      basic


 Q50. Write a Program for insertion sort.Core Java
 This question was recently asked at 'Ola Cabs'.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     program  code  coding  insertion sort   sort     Asked in 1 Companies


Very frequently asked. Usually among very first few questions.
 Q51. Define encapsulation in Java ?Core Java
Ans. Encapsulation is a feature of OOP's that binds the data and it's associated methods together as a single unit and facilitate protection and data hiding by providing minimal interface to outside. For example - member variables are declared private and are accessed through public methods. Moreover we have private methods that can only be used internally and hence providing minimal interface to outside class through use of public methods.

  Sample Code for encapsulation

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

   Like         Discuss         Correct / Improve     encapsulation  object oriented programming (oops)  oops concepts  oops  oops concepts  oops features     Asked in 4 Companies      Basic        frequent


 Q52. What are the different types of advices in AOP ?Spring
 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     spring app  spring  aspect oriented programming


 Q53. Explain Inheritance and Polymorphism.Core Java
Ans. Getting parent class object properties into child class is called Inheritance.

The process of representing one form into multiple forms is called polymorphism.

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

   Like         Discuss         Correct / Improve     inheritance  object oriented programming (oops)  oops concepts  polymorphism  object oriented programming (oops)  oops concepts     Asked in 1 Companies      Basic        frequent


 Q54. Is Runtime Polymorphism possible without Inheritance ?Core Java
Ans. Yes, Runtime Polymprohism requires either Class inheritance or Interface implementation.

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

   Like         Discuss         Correct / Improve     runtime polymorphism  object oriented programming (oops)  oops concepts  method overriding  inheritance  object oriented programming (oops)  oops concepts


 Q55. What is composition ?Core Java
 This question was recently asked at 'MST Solutions'.This question is still unanswered. Can you please provide an answer.


  Sample Code for composition

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

   Like         Discuss         Correct / Improve     composition  object oriented programming (oops)  oops concepts  oops concepts     Asked in 1 Companies      basic        frequent


 Q56. What are the drawbacks of Reactive extensions ?ReactiveX
Ans. Reactive extensions have a steep learning curve which makes it confusing for beginner and intermediate developers.

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

   Like         Discuss         Correct / Improve     RxJava  ReactiveX  Reactive Programming


 Q57. What is virtual table with respect to method overriding in Java ?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     vtable  virtual method table   method overriding  runtime polymorphism  object oriented programming (oops)  oops concepts


 Q58. How is the virtual method table implemented in Java?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     virtual method table   method overriding  runtime polymorphism  object oriented programming (oops)  oops concepts      expert        rare


 Q59. How many VTables are there for each class ? Core Java
Ans. There is one VTable for each class.

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

   Like         Discuss         Correct / Improve     virtual table method  vtable  runtime polymorphism  object oriented programming (oops)  oops concepts   method overriding      intermediate        rare


 Q60. Can a class extend itself in Java ?Core Java
Ans. No

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

   Like         Discuss         Correct / Improve     inheritance  object oriented programming (oops)  oops concepts


 Q61. If Java will die in next few year what will you do ?Programming Language
 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     


 Q62. What is the difference between bubble sort using Java and C++ ?Programming Language
 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     C++ vs Java


 Q63. What are inline functions ?Programming Language
Ans. Inline functions , just like C++ Macros is an optimized technique used by compiler to reduce the execution time. If the function is working on pre identified values ( which aren't resolved at runtime ), the function can execute the method and evaluate the outcome at compile time only instead of making a function call at runtime.

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

   Like         Discuss         Correct / Improve     inline functions  inline methods  C++     Asked in 1 Companies


 Q64. How Object-Oriented Programming is implemented in JavaScript? How they differ from other languages?Javascript
 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     object oriented programming in javascript  oops in javascript


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: