Category Archives: Java Tutorial
The simple Date class of java.util package does not provide enough methods to work with the date formatting in Java applications. The Date() class is good to use if you intend to work with the current date.
The equals method of the String class is used to compare two strings whether two are the same or not.
Until now, we learned what is the Java programming. After setting up the environment (JDK) to execute the Java code, it is time to write our first program of Java i.e. the “hello world” program.
Java has eight primitive data types to store data in its programs. The boolean Java is one of the primitive data types.
You may convert the variable of data type double to int and int to double quite easily in Java programming. The example below shows how to convert that.
The Java toString is a String class method. This method returns an object’s string representation.
The Java split method of the String class is used to split the given string. The whole string will be broken by the given regular expression (regex).
The replace method of the String class is used to replace existing characters in a given string to the new given characters.
In the previous chapter, we learned how to convert strings to int data type in Java. You can also convert an int to a string by using the built-in methods provided by Java. These methods are explained below with examples.