JAVA


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 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 IOException in Java?

What is IOException in Java?

 Java is a general-purpose programming language used to develop various applications, websites…

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 …

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…

Finally block in Java

Finally block in Java

Java allows the use of the finally block that allows you to execute the critical code. This block w…