How to Replace Blank Characters in a String

How to Replace Blank Characters in a String

There are many ways to replace blank characters in a String in Java. Regex is one of the most popul…

How to Square a Number in Java?

How to Square a Number in Java?

There are many ways to square a number in Java, the simplest of which is multiplying the number by …

What is a Java IOException?

What is a Java IOException?

Introduction IOException means any input-output exception that can occur while reading a file or…

String Formatting using format in Java

String Formatting using format in Java

We usually use System.out.println or System.err.println to print messages on the console. But to us…

Java String to Float

Java String to Float

Many beginners want to know how to convert Java String to Java float. All String operations are eas…

Java Best Practice: Return a List, not a LinkedList

Java Best Practice: Return a List, not a LinkedList

Java List is used to store an array of similar objects, for example, groups of numbers, categories …

Java String length (String size)

Java String length (String size)

There is only one method to find the length of a string i.e. the length() method. We will see multi…

How to Populate a Static List in Java?

How to Populate a Static List in Java?

In previous articles, we have seen methods to add numbers from a static list using Java 7 and 8 ver…

Java ternary operator examples

Java ternary operator examples

Java ternary operators make the code short and easy to understand. They can replace an entire set o…

How to read a file from a Jar

How to read a file from a Jar

Introduction If you are trying to read a text file from Jar using the File class, stop right the…

How to encode java string to send web server URL

How to encode java string to send web server URL

If you work on web applications, it is essential to know how to encode a String to pass it in URL s…

How to use DecimalFormat?

How to use DecimalFormat?

NumberFormat classes, including DecimalFormat, are packaged in the java.text package in Java. These…