The toString() method of StringBuffer class can be used to convert StringBuffer content to a String. This method returns a String object that represents the… [Read More]
Convert boolean Primitive to Boolean object in Java
Description Program to convert boolean primitive to Boolean object Example class BooleanPrimToBooleanObj { public static void main(String[] args) { boolean bvar = true; /* Method… [Read More]
Convert String to boolean primitive in Java: parseBoolean() method
Description How to convert String object to boolean primitive in Java. Example: Complete conversion code In this example we are converting string to boolean using… [Read More]
Convert String Object to Boolean Object in Java
Description How to convert String object to Boolean object. Example In this example we are gonna see two methods of String to Boolean object conversion…. [Read More]
Java program for binary to decimal conversion
There are two following ways to convert binary number to decimal number: 1) Using Integer.parseInt() method of Integer class.2) Do conversion by writing your own… [Read More]
Java Program for Decimal to Hexadecimal Conversion
There are two following ways to convert a decimal number to hexadecimal number: 1) Using toHexString() method of Integer class.2) Do conversion by writing your… [Read More]
Java Program for Decimal to Octal Conversion
In this guide, we will discuss the following two ways to convert decimal to octal in Java. Using predefined method toOctalString(int num) of Integer class… [Read More]
Java program to convert decimal to binary
There are three following ways to convert Decimal number to binary number: 1) Using toBinaryString() method of Integer class. 2) Do conversion by writing your… [Read More]
How To Convert Char To String and a String to char in Java
In this tutorial, we will see programs for char to String and String to char conversion. Program to convert char to String We have following… [Read More]
How to convert a char array to a string in Java?
There are two ways to convert a char array (char[]) to String in Java: 1) Creating String object by passing array name to the constructor… [Read More]
Java String to long Conversion
In this tutorial, you will learn how to convert String to long in Java. We can use Long wrapper class for this purpose, this class… [Read More]
How To Convert InputStream To String In Java
Here is the complete example of how to read and convert an InputStream to a String. The steps involved are: 1) I have initialized the… [Read More]
Java Convert String to Double examples
In this guide we will see how to convert String to Double in Java. There are three ways to convert String to double. 1. Java… [Read More]
Java String to int Conversion
In this tutorial, you will learn how to convert a String to int in Java. If a String is made up of digits like 1,2,3… [Read More]
Convert String to date in Java
In this tutorial we will see how to convert a String to Date in Java. Convert String to Date: Function After this section I have… [Read More]