Tuesday, August 10, 2010

HOW TO CAST BOOLEAN TO STRING IN JAVA PROGRAMMING

It is simple just create class from Boolean1 and write this code and save .java extention and run it.

public class Boolean1{
public static void main(String[] args){
boolean b = true;
String s = new Boolean(b).toString();
System.out.println("String is:"+ s);
}
}

No comments:

Post a Comment

How to find middle node of LinkedList without using extra memory in java

To find the middle node of a LinkedList without using extra memory in Java, you can use the "tortoise and hare" algorithm. This al...