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]