Author: Rakesh Singh

If we try to insert duplicate values in a “Set”, what will happen? Do we get any complier error?

Just it doesn’t add duplicate values. Boolean add(E e) – Adds the specified element to this set if it is not already present (optional operation). As, add() method returns Boolean and on adding duplicates it will return false. Below java source code example works fine and JVM (Java Virtual Machine) doesn’t complain.   If we insert duplicate values to the Set, we don’t get any compile time or…

Read the full article

What is benefits of constructor overloading in c++ -Real Time Example

Benefits of constructor overloading in c++ interview question – We need to answer why constructor overloading is required in C++ program? and what are advantages of it? and also, with real time example from your project. Answer: Benefits of constructor overloading in C++ is that, it gives the flexibility of creating multiple type of objects…

Read the full article