Author: Rakesh Singh

C++ frequently asked interview questions | Short – Real

This section contains list of real C++ short interview questions and answers frequently asked in IT industries for freshers and experienced. Q-Tell me one important properties of “delete” operator except de-allocation of memory. Answer – “delete” operator calls the destructor of a class. Q – Can we overload destructor of a class? Answer– No, we…

Read the full article

Java Thread Interview Questions and Answers | Short – Real

This section contains java multi threading real short interview questions and answers asked in IT industries to freshers and experienced. Generally, this kind of questions are asked in software job interview questions to judge candidate skills over multiple areas in the subject in short span of time. Q-Which method must be implemented by all java…

Read the full article

Java Collections short interview FAQs with answers – Real

List of Java Collection short interview questions and answer asked in software job / technical interviews. This list is helpful for telephonic or face to face technical interviews for freshers and experience developers/professionals. These interview questions are collected from various job interviews   Q-What is difference between Add() and Offer() methods of a queue? Answer…

Read the full article

What are advantages of comparator in Java over comparable?

Answer includes advantages of comparator over comparable interfaces and difference between both in Java collections. Note that advantages  of comparator over coparable and when would you use comparable and comparator interface is a frequently asked java interview question. You may read what is comparable and comparator interface in java collections before reading difference and advantages. Answer: Comparable Vs Comparator…

Read the full article

What is difference between Iterator and ListIterator?

Answer: Here is the differences and advantages of ListIterator over Iterator. 1-Iterator is available to all Collection classes whereas ListIterator is available to only List classes e.g ArrayList, Linkedlist and Vector. Note: Since List classes are also a collection, so, both Iterator and ListIterator are available to List classes. ListIterator can only be used with…

Read the full article

Write a program to sort employees by their experience. Employee class is not allowed to implement any interface.

Answer: For sorting employees we need to use either Comparable or comparator interface. Since, as per question, the Employee class is not allowed to implement any Interface, only option is, to create a new comparator class that implements Comparator interface. And in “compare()” method of comparator class, write the comparison code for the employee class…

Read the full article