What is critical section in java multithreading?

Answer: A critical section in java multithreading is a piece of code that access shared resources. Resources can be static variable, any Abstract data types or Data structures e.g. List, queue, stack and vector etc.  And File IO etc. For example, in below class function func has a critical section block i.e. int j =…

Read the full article

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 is delegates in C# Programming?

Answer: Delegates in C# programming  is a type safe function pointer that points to a function by having a reference to that function. To create a delegate we use “delegate” keyword. For example public delegate int FunctionPointer(int x,int y); Now, “FunctionPointer” is called a delegate that accept two int values as parameters and returns int…

Read the full article

Real time use of delegates in C# application without Event

Answer includes real time use of delegates in c# application without event used in  software projects. Question: Tell me the real time scenario where you have used delegates in C# application without using event. Answer: You can explain a real time use of delegates from your software products or projects, if you have used it.…

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

Can you delete this pointer inside a class member function in C++?

Answer: Yes, we can delete “this” pointer inside a member function only if the function call is made by the class object that has been created dynamically i.e. using “new” keyword. As, delete can only be applied on the object that has been created by using “new” keyword only. If we call the function using…

Read the full article