Articles on Trending Technologies

Technical articles with clear explanations and examples

IntConsumer Interface in Java with Examples

Shriansh Kumar
Shriansh Kumar
Updated on 20-Jul-2023 599 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 examples of functional interfaces are Predicate, Runnable, and Comparable interfaces. In this article, we are going to explore the IntConsumer Interface and its built-in methods with the help of example programs. IntConsumer Interface in Java In Java, the IntConsumer Interface provides only two methods: ...

Read More

How to Extract All Duplicates from a Column in Excel

Pradeep Kumar
Pradeep Kumar
Updated on 20-Jul-2023 4K+ Views

To extract duplicate values from a column in Excel, you can use the COUNTIF formula combined with conditional formatting. First, apply the formula "=COUNTIF(A:A, A1)>1" to identify duplicate values in a new column. Then, use conditional formatting to highlight the cells that meet the condition. This will visually highlight the duplicate values. Additionally, you can filter the column by the duplicate values or use the Advanced Filter feature to extract them to a new column. These methods help you quickly identify and extract duplicate values in Excel. Steps to Extract Duplicate Values from a Column in Excel Step 1:Open your ...

Read More

Instance Control Flow in Java

Shriansh Kumar
Shriansh Kumar
Updated on 20-Jul-2023 823 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 include instance variables, instance methods, and instance blocks. Whenever we execute a Java program, JVM looks for the main() method first and then, it loads the class into memory. Moving further, the class gets initialized and its static block, if any, is executed. After the execution of the ...

Read More

Inner Class And Anonymous Inner Class that Implements Runnable in Java

Shriansh Kumar
Shriansh Kumar
Updated on 20-Jul-2023 902 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 class that has no name is called as anonymous class. The Runnable Interface is a way of creating threads in Java multithreading. Java provides the functionality of multithreading to perform multiple operations simultaneously. In it, the operation gets divided into multiple smaller parts called a thread. Let's explore ...

Read More

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

Shriansh Kumar
Shriansh Kumar
Updated on 20-Jul-2023 3K+ 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 'java.nio.charset' package provides various classes and methods. In this article, we are going to learn the different ways to get and set default character encoding or charset. Get and Set Default Character Encoding or Charset in Java First, let's discuss what is default character encoding or charset. ...

Read More

How to Generate MD5 Checksum for Files in Java?

Shriansh Kumar
Shriansh Kumar
Updated on 20-Jul-2023 969 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 corrupted. In this article, we are going to explore the MD5 checksum which is a hash value used to verify the integrity of files. It is a way of ensuring that the file one has downloaded or transferred is exactly the same as the original one. To generate MD5 checksum ...

Read More

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

Shriansh Kumar
Shriansh Kumar
Updated on 20-Jul-2023 1K+ 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 is an error thrown during the compilation of source code. It may occur due to several reasons, one of them being misplaced curly braces. In this article, we are going to explore the reasons for this error and corresponding ways to fix the class, interface, or enum expected error. ...

Read More

How to Extract Actual Addresses from Hyperlinks in Excel

Pradeep Kumar
Pradeep Kumar
Updated on 20-Jul-2023 1K+ Views

Excel is a powerful tool. You can use VBA code in Excel to extract actual addresses from hyperlinks. By looping through the range of cells containing hyperlinks, the code checks if each cell has a hyperlink, extracts the address, removes any prefixes like "mailto:" or "tel:", and updates the adjacent cell with the extracted address. With this VBA solution, you can automate the process of extracting actual addresses from hyperlinks in Excel, saving time and effort. Here are the steps of how you can do it: Step 1 Open the Excel file in which you want to export excel data ...

Read More

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

Shriansh Kumar
Shriansh Kumar
Updated on 20-Jul-2023 627 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 Comparable Interface or Comparator Interface so that we can maintain the sorting order of its elements otherwise, we will encounter a java.lang.ClassCastException. In this article, we are going to explain how to use the Comparable and Comparator Interfaces to fix this ClassCastException in TreeMap. Fixing java.lang.ClassCastException in TreeMap ...

Read More

How to Fix java.lang.ClassCastException in TreeSet?

Shriansh Kumar
Shriansh Kumar
Updated on 20-Jul-2023 295 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 objects otherwise we will encounter a java.lang.ClassCastException. Here, custom class objects mean user-defined objects that are created with the help of a constructor. To fix this ClassCastException in TreeSet we can use either the Comparator Interface or the Comparable Interface. Let's discuss them in detail. The general ...

Read More
Showing 19901–19910 of 61,248 articles
Advertisements