Shriansh Kumar has Published 324 Articles

Difference between List and Tuples in Python

Shriansh Kumar

Shriansh Kumar

Updated on 30-Jul-2024 16:43:11

14K+ Views

List and Tuples are built-in data types of Python programming language. They serve as a container to hold multiple values of same type as well as different data types. We can find several differences in both of these containers. Read this article to learn more about lists and tuples ... Read More

Java Program to Create a Matrix and Fill it With Prime Numbers

Shriansh Kumar

Shriansh Kumar

Updated on 30-Jul-2024 16:41:29

724 Views

As per the problem statement, we have to create an empty matrix and fill that matrix with the prime numbers starting from the smallest prime number i.e. 2. A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. For instance, ... Read More

JavaScript clearTimeout() & clearInterval() Method

Shriansh Kumar

Shriansh Kumar

Updated on 30-Jul-2024 16:32:42

2K+ Views

In JavaScript, the clearTimeout() and clearInterval() methods are used to clear timers. When we set a timer using setTimeout() or setInterval() methods, the browser allocates memory to track it. Therefore, we use these methods to release that memory and avoid unnecessary function calls. It is best practice to clear timers ... Read More

Java @Target Annotations

Shriansh Kumar

Shriansh Kumar

Updated on 23-Jul-2024 18:51:00

2K+ Views

When we start learning Java, we often wonder about symbols like @override and @inherited written within the code blocks. They are a special kind of tag termed as Annotations that can be applied to classes, methods, fields, parameters, and other elements of the code. The @Target annotation is one of ... Read More

Interesting interview question on hashCode and equals method

Shriansh Kumar

Shriansh Kumar

Updated on 17-Aug-2023 10:27:15

825 Views

One of the most interesting interview questions that I have encountered in my Java programming career is about the hashCode and equals methods. Interviewers always check whether the candidate knows equals() and hasCode() methods as they are the most important yet most confusing methods of the Java Object class. Both ... Read More

Interesting and Cool Tricks in Java

Shriansh Kumar

Shriansh Kumar

Updated on 17-Aug-2023 09:59:56

243 Views

Java is a widely used programming language available nowadays. It serves to develop a variety of software including web and mobile applications. It is also preferable when it comes to developing a backend system. Java has made tremendous progress over the year that has changed the world. This is the ... Read More

Is there any equivalent to typedef of C/C++ in Java?

Shriansh Kumar

Shriansh Kumar

Updated on 17-Aug-2023 09:57:11

843 Views

We can find many similarities between Java and C/C++ programming languages in terms of syntaxes and features. But, there are several functionalities that have been omitted from Java like 'typedef'. If someone coming from a C/C++ background, must have heard the 'typedef' keyword, and often wonders, is there any equivalent ... Read More

Iterate Over Unmodifiable Collection in Java

Shriansh Kumar

Shriansh Kumar

Updated on 17-Aug-2023 09:49:19

471 Views

Being a programmer we must have developed an application that performs CRUD operations. Here, the term CRUD means Create, Read, Update and delete. The collection on which these operations can be performed is called as modifiable collection. However, there is a way to make a collection unmodifiable so that one ... Read More

What is Iterable Interface in Java?

Shriansh Kumar

Shriansh Kumar

Updated on 17-Aug-2023 09:47:54

1K+ Views

In simple words, the iterable interface is a common interface that allows us to iterate over a collection of objects. It was first introduced with the release of JDK 1.5 and made available in 'java.lang' package. The Java Collection Framework extends this interface, hence all the classes available in this ... Read More

What is Interface Naming Conflicts in Java?

Shriansh Kumar

Shriansh Kumar

Updated on 17-Aug-2023 09:41:48

403 Views

In Java, interfaces serve two purposes pure abstraction and multiple inheritance. Generally, an interface consists of abstract methods and variables that define the behavior which a class can implement. If we create two interfaces that contain methods and variables with the same name, then interface naming conflicts may arise. However, ... Read More

Advertisements