Moumita has Published 175 Answers

Which one is faster Array or List in Java

Moumita

Moumita

Updated on 30-Jul-2019 22:30:21

The array is faster in case of access to an element while List is faster in case of adding/deleting an element from the collection.

What does 'using namespace std' mean in C++?

Moumita

Moumita

Updated on 30-Jul-2019 22:30:21

Consider a situation, when we have two persons with the same name, Piyush, in the same class. Whenever we need to differentiate them definitely we would have to use some additional information along with their name, like either the area, if they live in a different area or their mother’s ... Read More

What is the scope of protected access modifier in Java?

Moumita

Moumita

Updated on 30-Jul-2019 22:30:20

When a variable, method or constructor that are declared protected in a superclass can be accessed only by the subclasses in other package or any class within the package of the protected members' class. The protected access modifier cannot be applied to class and interfaces. Methods, fields can be declared ... Read More

How to use the final modifier in Java?

Moumita

Moumita

Updated on 30-Jul-2019 22:30:20

The final modifier can be associated with methods, classes and variables. Once declared final − A final class cannot be instantiated. A final method cannot be overridden. A final variable cannot be reassigned. Example Live Demo class TestExample { final int value = ... Read More

Identify all duplicates irrespective of the order of the input

Moumita

Moumita

Updated on 30-Jul-2019 22:30:20

Indeed your problem is weird as the order is not fixed otherwise it was a straightforward requirement.In order to get your task done, you need to search in all names individually and to be sure that you don’t get the entries which are super set of your search, you need ... Read More

Advertisements