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
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
Excel is a powerful tool that offers a variety of functions for data manipulation and analysis. To extract all but first /last word in Excel, you can use a combination of text functions like FIND, LEN, and SUBSTITUTE. Here's a step−by−step guide: Extracting All But First Word in Excel Let us see a simple process to know how to extract all but first word in Excel. Step 1: Consider an Excel sheet where you have a list of sentences as shown in the below image. Now, first click on an empty cell in our case B2 and enter the formula ... Read More
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
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
CSV (Comma−Separated Values) is a plain text file format used to store tabular data. It is a widely supported and commonly used format for exchanging data between different applications, particularly in spreadsheet software like Microsoft Excel, Google Sheets, and others. When working with CSV files, it's essential to be mindful of the delimiter used, handle special characters appropriately, and ensure data integrity and consistency. Steps to Export a Range of Cells in Excel to CSV To export range of cells in Excel data to CSV (Comma−Separated Values) format, you can follow these steps: Step 1 Open your Excel workbook where ... Read More
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
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
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. One way to fix this ClassCastException is by using a custom comparator. Let's discuss it in detail. The general syntax for TreeSet is as ... Read More
In the previous 10 years, mega web platforms were the most prominent enhancement of cultural change. With broad reception and close to boundless scale, enormous tech stages were sold as a public decent and development liberated from moral responsibilities regarding each buyer and business to profit from. The Dangerous Remedy In their urgency to safeguard their information and foundation, a few organizations have gone to a dangerous remedy: putting away information on their servers or building confidential mists. While this approach might appear consistent, it can build the gamble of cyber-attacks and information breaches. Constructing and keeping a confidential cloud ... Read More