Shriansh Kumar has Published 324 Articles

Does Java support multi-dimensional Arrays?

Shriansh Kumar

Shriansh Kumar

Updated on 16-May-2025 19:12:57

582 Views

A multi-dimensional array is nothing but an array of arrays, and yes, it is supported by the Java programming language. It is used to store data within a table, grid, or matrix having rows and columns. In Java, these arrays are also called ragged arrays or jagged arrays. Let's understand ... Read More

What are the different steps involved to execute a Java program?

Shriansh Kumar

Shriansh Kumar

Updated on 16-May-2025 19:05:14

3K+ Views

Java is an object-oriented programming language that provides various features like platform independence, security, garbage collection, etc. Unlike other programming languages, programs written in Java go through a specific sequence of steps during the compilation and execution process. Java follows the same process no matter where and how you ... Read More

What are the differences between recursion and iteration in Java?

Shriansh Kumar

Shriansh Kumar

Updated on 16-May-2025 19:03:05

3K+ Views

The Recursion and Iteration both repeatedly execute the set of instructions. Recursion is when a function calls itself repeatedly. The iteration is when a loop repeatedly executes until the controlling condition becomes false. The primary difference between recursion and iteration is that recursion repeats the statement in a function, whereas ... Read More

What are the differences between ClassNotFoundException and NoClassDefFoundError in Java?

Shriansh Kumar

Shriansh Kumar

Updated on 16-May-2025 18:44:03

5K+ Views

In Java, both ClassNotFoundException and NoClassDefFoundError are issues that occur when the JVM or ClassLoader is not able to find the appropriate class at the time of loading (run-time). The ClassNotFoundException is a checked exception, and NoClassDefFoundError is an Error that comes under unchecked. There are different types of ClassLoaders, each ... Read More

Can we write any code after throw statement in Java?

Shriansh Kumar

Shriansh Kumar

Updated on 16-May-2025 18:29:43

2K+ Views

No, we can not place any code after throw statement, it leads to compile time error. The compiler will show this error as unreachable statement. In Java, the throw statement immediately terminates the current flow of execution, therefore, the code immediate to a throw statement will not be executed. The ... Read More

How to implement an interface using an anonymous inner class in Java?

Shriansh Kumar

Shriansh Kumar

Updated on 16-May-2025 17:46:18

2K+ Views

What is an Anonymous Inner Class In Java, an anonymous inner class is a class that doesn't have a name, we will directly define it at the time of instantiation. You can use it in cases where you need to override methods of a class (or interface) only once, without ... Read More

Is it possible to create a class without a name in Java?

Shriansh Kumar

Shriansh Kumar

Updated on 16-May-2025 15:51:21

1K+ Views

Yes, we can create a class without a name in Java using the anonymous class. It is a type of inner class which does not have a name and whose instance is created at the time of the creation of the class itself. You can create this class in a ... Read More

Why String class is immutable or final in Java?

Shriansh Kumar

Shriansh Kumar

Updated on 16-May-2025 15:48:37

9K+ Views

The general meaning of immutable is something that cannot be changed or modified after creation. In Java, a string is immutable; we cannot change the object itself, but we can change the reference to the object. The string is made final to not allow others to extend and modify it. ... Read More

How to handle the Runtime Exception in Java?

Shriansh Kumar

Shriansh Kumar

Updated on 14-May-2025 14:21:29

13K+ Views

The error that occurs at runtime after successful compilation of the Java program is called a runtime error or unchecked exception. It disrupts the normal flow of a program’s execution and terminates the program abruptly.These errors are not detected by the compiler but by JVM. The runtime errors in Java are ... Read More

How to solve an IllegalArgumentException in Java?

Shriansh Kumar

Shriansh Kumar

Updated on 12-May-2025 11:34:05

30K+ Views

In Java, an IllegalArgumentException is thrown in order to indicate that a method has been passed an illegal argument. An illegal argument is one that does not meet the required input from user. This exception extends the RuntimeException class and thus, belongs to those exceptions that can be thrown during ... Read More

Previous 1 ... 6 7 8 9 10 ... 33 Next
Advertisements