Shriansh Kumar has Published 173 Articles

Integer.MAX_VALUE and Integer.MIN_VALUE in Java with Examples

Shriansh Kumar

Shriansh Kumar

Updated on 20-Jul-2023 17:03:12

4K+ Views

The Integer class of Java provides two constants named Integer.MAX_VALUE and Integer.MIN_VALUE represents the maximum and minimum possible values for an integer variable in Java. The actual value of Integer.MAX_VALUE is 231 -1 which is equivalent to 2147483647 and the actual value of Integer.MIN_VALUE is -231 which is equivalent to ... Read More

IntConsumer Interface in Java with Examples

Shriansh Kumar

Shriansh Kumar

Updated on 20-Jul-2023 17:00:36

118 Views

The IntConsumer Interface is a functional interface that represents an operation that accepts a single int-valued argument and returns no result. This is the int-consuming primitive specialization of the Consumer interface. Here, the functional interface means an interface that contains only a single abstract method and exhibits single functionality. Some ... Read More

Instance Control Flow in Java

Shriansh Kumar

Shriansh Kumar

Updated on 20-Jul-2023 16:53:21

328 Views

Instance control flow is a fundamental concept of Java programming language that a beginner, as well as an experienced one, must know about. In Java, the instance control flow is a step by step process of execution of members lies within the class. The members that exist inside a class ... Read More

Inner Class And Anonymous Inner Class that Implements Runnable in Java

Shriansh Kumar

Shriansh Kumar

Updated on 20-Jul-2023 16:50:54

426 Views

In Java, the Inner class and Anonymous inner class are two types of Nested classes. Here, nested class means a class within another class. The inner class is a nested class defined without the static keyword, i.e., the inner class is a non-static nested class. The type of nested inner ... Read More

Iterate TreeMap in Reverse Order in Java

Shriansh Kumar

Shriansh Kumar

Updated on 20-Jul-2023 16:47:58

674 Views

TreeMap is a class of Java Collection Framework that implements NavigableMap Interface. It stores the elements of the map in a tree structure and provides an efficient alternative to store the key-value pairs in sorted order. In other words, it always returns the elements in ascending order. However, Java provides ... Read More

How to Get and Set Default Character Encoding or Charset in Java?

Shriansh Kumar

Shriansh Kumar

Updated on 20-Jul-2023 16:44:22

1K+ Views

In Java, the default character encoding is determined by the 'file.encoding' which is a system property and is usually set by the operating system or the JVM. However, sometimes a Java programmer may need to get or set the default character encoding programmatically for various reasons. For this purpose, the ... Read More

How to Generate MD5 Checksum for Files in Java?

Shriansh Kumar

Shriansh Kumar

Updated on 20-Jul-2023 16:41:13

337 Views

Checksum is an encrypted sequence of characters that are generated with the help of various hashing algorithms like MD5 and SHA-1. The checksum is applicable for the downloadable files. Whenever we generate a checksum for files, it stays the same as long as the file does not get altered or ... Read More

How to Fix "class, interface, or enum expected" Error in Java with Examples?

Shriansh Kumar

Shriansh Kumar

Updated on 20-Jul-2023 16:37:39

385 Views

Every Java programmer whether a beginner or experienced, encounters numerous errors while writing code. Generally, these errors are categorized as run time and compile time errors. The run-time error occurs while running the code after successful compilation and the compile-time error during compilation. The class, interface, or enum expected ... Read More

How to fix java.lang.ClassCastException while using the TreeMap in Java?

Shriansh Kumar

Shriansh Kumar

Updated on 20-Jul-2023 16:28:18

242 Views

TreeMap is a class of Java Collection Framework that implements NavigableMap Interface. It stores the elements of the map in a tree structure and provides an efficient alternative to store the key-value pairs in sorted order. Note that while creating objects of TreeMap it is necessary to use either the ... Read More

How to Fix java.lang.ClassCastException in TreeSet?

Shriansh Kumar

Shriansh Kumar

Updated on 20-Jul-2023 16:25:39

101 Views

The TreeSet is a generic class of Java Collection Framework that implements the SortedSet Interface. It stores the elements of the set in a tree structure. Furthermore, all the elements are stored in a sorted manner and they must be mutually comparable if we are attempting to add custom class ... Read More

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