Java String valueOf(Object obj) Example
String class valueOf(Object obj) method example
String class valueOf(Object obj) method example. This example shows you how to use valueOf(Object obj) method.This method Returns the string representation of the Object argument.
Here is the code:-
/**
* @(#) ValueOf7string.java
*Program that Returns the string representation of the Object argument.
* @Version 01-May-2008
* @author Rose India Team
*/
public class ValueOf7string
{
public static void main(String args[]){
String str = "Hello World";
Object objStr = str;
// Returns the string representation of the Object argument.
System.out.println( str.valueOf(objStr) );
}
} |
null
|