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. |
|
| ||||
Interview Questions and Answers for 'Kellton Tech' - 3 question(s) found - Order By Rating | ||||
Basic and Very Frequently asked. | ||||
| ||||
Ans. Polymorphism means the condition of occurring in several different forms. Polymorphism in Java is achieved in two manners 1. Static polymorphism is the polymorphic resolution identified at compile time and is achieved through function overloading whereas 2. Dynamic polymorphism is the polymorphic resolution identified at runtime and is achieved through method overriding. | ||||
Sample Code for overloading Sample Code for overriding | ||||
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  oops concepts Asked in 108 Companies Basic   frequent | ||||
Try 2 Question(s) Test | ||||
Related Questions | ||||
What are points to consider in terms of access modifier when we are overriding any method? | ||||
If everything is an object , Cant we declare every object as Object obj = new String(); | ||||
Why do we need polymorphism in Java ? | ||||
How does java identifies which method to be called in method overriding or runtime polymorphism, when both methods share the same name and signature ? | ||||
Shouldn't we make a class with all static members is its just expected to be executed as a standalone program with just one thread. Moreover Lets assume that there is no runtime Polymorphism required and there is no need for serialization ? | ||||
Is this Polymorphism ? Map<String, List<String>> inventoryManagerCountMap = new HashMap<String, ArrayList<String>>(); | ||||
When are static and instance methods resolved ? During compile time or Runtime ? | ||||
Which of the following is not the difference between Singleton and Static class ( Class with static members only ) ? | ||||
Which of the following do you think is the primary reason you would never use a static class even the application doesn't need multiple requests or threads ? a. Serialization b. Runtime Polymorphism c. Lazy Loading d. Memory | ||||
| ||||
Ans. A child object constructor always first needs to construct its parent. In Java it is done via an implicit call to the no-args constructor as the first statement | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   constructor   constructor chaining   oops   call constructor explicitly Asked in 3 Companies | ||||
Try 2 Question(s) Test | ||||
Related Questions | ||||
What are the common uses of "this" keyword in java ? | ||||
Can we call constructor explicitly ? | ||||
Which of the following is not the use of this keyword ? | ||||
Very frequently asked. Favorite question in Walk in Drive of many Indian service companies. | ||||
| ||||
Ans. Underlying data structure for ArrayList is Array whereas LinkedList is the linked list and hence have following differences - 1. ArrayList needs continuous memory locations and hence need to be moved to a bigger space if new elements are to be added to a filled array which is not required for LinkedList. 2. Removal and Insertion at specific place in ArrayList requires moving all elements and hence leads to O(n) insertions and removal whereas its constant O(1) for LinkedList. 3. Random access using index in ArrayList is faster than LinkedList which requires traversing the complete list through references. 4. Though Linear Search takes Similar Time for both, Binary Search using LinkedList requires creating new Model called Binary Search Tree which is slower but offers constant time insertion and deletion. 5. For a set of integers you want to sort using quicksort, it's probably faster to use an array; for a set of large structures you want to sort using selection sort, a linked list will be faster. | ||||
Sample Code for ArrayList Sample Code for LinkedList | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  collections   java   data structures   arraylist   linkedlist   arraylist vs linkedlist Asked in 61 Companies Basic   frequent | ||||
Try 1 Question(s) Test | ||||
Related Questions | ||||
If you are given a choice to use either ArrayList and LinkedList, Which one would you use and Why ? | ||||
Will this code give error if i try to add two heterogeneous elements in the arraylist. ? and Why ? | ||||
In a Linked list with sorted numbers, insert a new numbers while maintaining the sort order. | ||||
Collections.sort can only be performed on .. a. Set b. List c. Map d. Any Collection implementation | ||||
Is this a valid initialization ? Explain. Collection<Collection> collection = new LinkedList<LinkedList>(); | ||||
What is the difference between List, Set and Map ? or What are the different Java Collections Interfaces ? | ||||
Difference between Vector and ArrayList ? | ||||
Overridden methods must have the same ... | ||||
Which of the following doesn't extend Collection interface ? | ||||