TCS Java Interview Questions

In this post, we covered the TCS java interview questions. The candidate got asked about the Java 8 Stream operations where he was given two list and he has to do concatenation of two lists. After that he has to find the unique elements from the list and finally he Read more…

How Generics Work in Java?

Let’s examine how generics work in Java. Also, we will look at how generics is a compile-time feature. To demonstrate this concept, we are going to mix generic and non-generic types. But in the real world never mix these two types. Let’s try to mix the generic and non-generic types Read more…

Autoboxing with Generics in Java

In this post, we are going to look at how autoboxing works with Generics in Java. Autoboxing is a feature that got introduced in Java 1.5 and it plays a very important role while using generics. As we know generic collections can only hold object types. But Java also has Read more…

Why Generics in Java?

Generics got introduced in Java SE 5.0, but the question is why use generics in the first place? In this tutorial, we are going to look at some of the problems that developers faced before generics. Before generics, it is the developer’s responsibility to add the correct types of elements Read more…

Python program to find out the number of CPUs

Use the multiprocessing module of python to find the number of CPUs. cpu_count() is the function that returns the count of CPUs. Algorithm Start Import multiprocessing module Use the cpu_count() function provided in the multiprocessing module, it will return the number of CPU Display the count End Program Output CPUs Read more…