Convert float from primitive type to object type in java.

Convert float from primitive type to object type in java.


Posted in : Core Java Posted on : October 4, 2010 at 4:11 PM Comments : [ 0 ]

Convert float from primitive type to object type in java.

Convert boolean to string java.

In this example, you will see how two convert a boolean value into string in java.
This program helps you in converting the Boolean type data into a string. The toString() method reads the Boolean type object and it converts into a string format. This method returns a string object and represents the boolean?s value. The Boolean object represents either ?true? or false".

Code:

BooleanToString.java
package com.devmanuals;

public class BooleanToString {
public static void main(String[] arg) {
	Boolean boolObject = new Boolean(true);
	String str = boolObject.toString();
	System.out.println("String value of boolean object : " + str);
	}
}
Output:
String value of boolean object : true

Download this code.

Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics