public
String toString()
Returns
a string representation of this collection.
import java.util.*; class TreeSetToString{ public static void main(String args[]){ TreeSet<Double> mySet = new TreeSet<> (); /* Add Elements to the Set */ mySet.add(55.6); mySet.add(10.01); System.out.println(mySet.toString()); } }
Output
[10.01, 55.6]
No comments:
Post a Comment