We often need to format numbers, such as taking two decimal places for a number, show only integer part of a number etc. Java provide java.text.DecimalFormat class, which can helps you to format numbers use your specified pattern as quickly as possible.
When you set a date time value in java, you may encounter time zone issue. You will find the date time you get use java.util.Calendar class will always use the system default timezone. This example will tell you how to change it to show date time in your desired timezone.
When you need to invoke java command after install JDK successfully, it is better to setup below Java related system environment variable, they are JAVA_HOME, CLASSPATH, PATH. This article will tell you how to set them up in windows and Linux.
Sometimes we need to check whether the user input is a valid number or not. If not, we need to tell the user to input a valid number again. In this example, we will show you two methods about how to verify a valid numeric value in a Java String variable.
Java has three character sequence manipulation class. They are java.lang.String, java.lang.StringBuffer and java.lang.StringBuilder. The most popular used class maybe java.lang.String, but there are a lot of difference between them.
Sometimes we need an 2D Array in java. But we do not know the size. So we can not create it at declaration time. An flexible way to do this is first save the data in a java List, then translate the List data to it. In this article we will show you how to …
This article will tell you how to add the JUnit 5 java library into the eclipse project. It introduces two methods, one is to add the JUnit 5 java library as standalone jar files to the eclipse project, the other is how to add JUnit 5 dependency in pom.xml of the eclipse maven project.
Java I/O(Input/Output) handles the task for getting data from a source or saving data to a target. Packages java.io and java.nio is used to handle I/O issues. In this topic we will give you a general overview about the two packages and introduce new features in java.nio.
If you have a good and effective understanding of Java variables and data types then you can make your programming skills excellent. In this chapter, we will introduce basic java variables and data types with easy understanding code examples to you.
This article will show you how to add the selenium server standalone java library into the eclipse java project and how to import selenium webdriver java jar files into the eclipse maven project.