Java Array class deepToString(Object[] a) example
Array class deepToString(Object[] a) method example
Array class deepToString(Object[] a)method example. This example shows you how to use deepToString(Object[] a)method.This method Returns a string representation of the "deep contents" of the specified array.
Here is the code:-
/**
* @Program that Returns a string representation of the "deep contents" of the
* specified array.
* deepToStringArray.java
* Author:-RoseIndia Team
* Date:-15-May-2008
*/
import java.util.*;
public class deepToStringArray {
public static void main(String[] args) {
//creating an object array
Object o[]={"Rose","India","Net","Limited","Rohini"};
String i=Arrays.deepToString(o);
System.out.println("The String Representation is:-"+i);
}
} |
Output of the program:-
| The String Representation is:-[Rose, India, Net, Limited, Rohini] |
|