<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-4708295469068081857</atom:id><lastBuildDate>Fri, 01 Nov 2024 10:38:20 +0000</lastBuildDate><title>Sample Java Codes</title><description></description><link>http://java-techsavy.blogspot.com/</link><managingEditor>noreply@blogger.com (Techsavy)</managingEditor><generator>Blogger</generator><openSearch:totalResults>61</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4708295469068081857.post-6492781247622622334</guid><pubDate>Sun, 28 Jun 2009 06:28:00 +0000</pubDate><atom:updated>2009-06-27T23:29:46.669-07:00</atom:updated><title>How to Read Text from a File</title><description>try {&lt;br /&gt;        BufferedReader in = new BufferedReader(new FileReader(&quot;C:/temp/temp.txt&quot;));&lt;br /&gt;        String str;&lt;br /&gt;        while ((str = in.readLine()) != null) {&lt;br /&gt;            System.out.println(str);&lt;br /&gt;        }&lt;br /&gt;        in.close();&lt;br /&gt;    } catch (IOException e) {&lt;br /&gt;    }</description><link>http://java-techsavy.blogspot.com/2009/06/how-to-read-text-from-file.html</link><author>noreply@blogger.com (Techsavy)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4708295469068081857.post-7044539076529229922</guid><pubDate>Sun, 28 Jun 2009 06:26:00 +0000</pubDate><atom:updated>2009-06-27T23:28:32.843-07:00</atom:updated><title>How to Read Text from Standard Input</title><description>try {&lt;br /&gt;    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));&lt;br /&gt;    String str = &quot;&quot;;&lt;br /&gt;    while (str != null) {      &lt;br /&gt;        str = in.readLine();&lt;br /&gt;        System.out.println(str);&lt;br /&gt;    }&lt;br /&gt;} catch (IOException e) {&lt;br /&gt;}</description><link>http://java-techsavy.blogspot.com/2009/06/how-to-read-text-from-standard-input.html</link><author>noreply@blogger.com (Techsavy)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4708295469068081857.post-2465594114513404714</guid><pubDate>Sun, 28 Jun 2009 06:24:00 +0000</pubDate><atom:updated>2009-06-27T23:26:14.682-07:00</atom:updated><title>How to Delete a Directory</title><description>&lt;span style=&quot;font-family: monospace;&quot;&gt;boolean success = (new File(&quot;directoryName&quot;)).delete();&lt;br /&gt;if (success) {&lt;br /&gt;    // Deletion successful&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</description><link>http://java-techsavy.blogspot.com/2009/06/how-to-delete-directory.html</link><author>noreply@blogger.com (Techsavy)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4708295469068081857.post-8118576901855277483</guid><pubDate>Sun, 28 Jun 2009 06:23:00 +0000</pubDate><atom:updated>2009-06-27T23:24:50.511-07:00</atom:updated><title>How to Get the Current Working Directory</title><description>&lt;pre&gt;String currrentDirectory = System.getProperty(&quot;user.dir&quot;);&lt;/pre&gt;</description><link>http://java-techsavy.blogspot.com/2009/06/how-to-get-current-working-directory.html</link><author>noreply@blogger.com (Techsavy)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4708295469068081857.post-8718970609186248749</guid><pubDate>Sun, 28 Jun 2009 01:48:00 +0000</pubDate><atom:updated>2009-06-27T18:49:30.502-07:00</atom:updated><title>How to Rename a File</title><description>File oldFile = new File(&quot;C:/temp/oldTemp.txt&quot;);&lt;br /&gt;File newFile = new File(&quot;C:/temp/newTemp.txt&quot;);&lt;br /&gt;// Rename file&lt;br /&gt;boolean success = oldFile.renameTo(newFile);&lt;br /&gt;if (success) {&lt;br /&gt;    // File was successfully renamed&lt;br /&gt;}</description><link>http://java-techsavy.blogspot.com/2009/06/how-to-rename-file.html</link><author>noreply@blogger.com (Techsavy)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4708295469068081857.post-1715411534255477942</guid><pubDate>Sun, 28 Jun 2009 01:45:00 +0000</pubDate><atom:updated>2009-06-27T18:45:33.599-07:00</atom:updated><title>How Delete a File</title><description>boolean success = (new File(&quot;C:/temp/temp.txt&quot;)).delete();&lt;br /&gt;if (success) {&lt;br /&gt;    // Deletion succeeded&lt;br /&gt;}</description><link>http://java-techsavy.blogspot.com/2009/06/how-delete-file.html</link><author>noreply@blogger.com (Techsavy)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4708295469068081857.post-7140366077120177401</guid><pubDate>Sun, 28 Jun 2009 01:42:00 +0000</pubDate><atom:updated>2009-06-27T18:44:09.765-07:00</atom:updated><title>How to Get the Size of a File</title><description>File file = new File(&quot;C:/temp/temp.txt&quot;);&lt;br /&gt;// Get the number of bytes in the file&lt;br /&gt;long length = file.length();</description><link>http://java-techsavy.blogspot.com/2009/06/how-to-get-size-of-file.html</link><author>noreply@blogger.com (Techsavy)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4708295469068081857.post-648212671496964181</guid><pubDate>Sun, 28 Jun 2009 01:39:00 +0000</pubDate><atom:updated>2009-06-27T18:42:50.191-07:00</atom:updated><title>How to Determine If a File or Directory Exists</title><description>boolean existsFlag = (new File(&quot;C:/temp/temp.txt&quot;)).exists();&lt;br /&gt;if (existsFlag) {&lt;br /&gt;    // File or directory exists&lt;br /&gt;} else {&lt;br /&gt;    // File or directory does not exist&lt;br /&gt;}</description><link>http://java-techsavy.blogspot.com/2009/06/how-to-determine-if-file-or-directory.html</link><author>noreply@blogger.com (Techsavy)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4708295469068081857.post-4505005229933956855</guid><pubDate>Sun, 28 Jun 2009 01:37:00 +0000</pubDate><atom:updated>2009-06-27T18:39:34.944-07:00</atom:updated><title>How to Create a File</title><description>try {&lt;br /&gt;        File file = new File(&quot;C:/temp/temp.txt&quot;);&lt;br /&gt;} catch (IOException e) {&lt;br /&gt;}</description><link>http://java-techsavy.blogspot.com/2009/06/how-to-create-file.html</link><author>noreply@blogger.com (Techsavy)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4708295469068081857.post-1482546395222416595</guid><pubDate>Sun, 28 Jun 2009 01:34:00 +0000</pubDate><atom:updated>2009-06-27T18:37:21.763-07:00</atom:updated><title>How to Determine If a File Path Is a File or a Directory</title><description>File file = new File(&quot;filepath&quot;);   &lt;br /&gt;boolean isDirectory = file.isDirectory();&lt;br /&gt;if (isDirectory) {&lt;br /&gt;    // file is a directory&lt;br /&gt;} else {&lt;br /&gt;    // file is a file&lt;br /&gt;}</description><link>http://java-techsavy.blogspot.com/2009/06/how-to-determine-if-file-path-is-file.html</link><author>noreply@blogger.com (Techsavy)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4708295469068081857.post-7080313855044796124</guid><pubDate>Sun, 28 Jun 2009 01:30:00 +0000</pubDate><atom:updated>2009-06-27T18:34:36.282-07:00</atom:updated><title>How to Get an Absolute File Path</title><description>File file = new File(&quot;C:&quot;+File.separatorChar+&quot;temp&quot;+File.separatorChar+&quot;temp.txt&quot;);&lt;br /&gt;file = file.getAbsoluteFile();  // c:\temp\temp.txt</description><link>http://java-techsavy.blogspot.com/2009/06/how-to-get-absolute-file-path.html</link><author>noreply@blogger.com (Techsavy)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4708295469068081857.post-3038249308727508445</guid><pubDate>Sun, 28 Jun 2009 01:23:00 +0000</pubDate><atom:updated>2009-06-27T18:30:11.242-07:00</atom:updated><title>How to Construct a File Path</title><description>String path = File.separator +&quot;temp&quot;; // /temp</description><link>http://java-techsavy.blogspot.com/2009/06/how-to-construct-file-path.html</link><author>noreply@blogger.com (Techsavy)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4708295469068081857.post-273827955690016307</guid><pubDate>Fri, 26 Jun 2009 03:36:00 +0000</pubDate><atom:updated>2009-06-25T20:37:37.701-07:00</atom:updated><title>How to Compare Dates</title><description>Calendar cal1 = new GregorianCalendar(2007, Calendar.SEPTEMBER, 1);           &lt;br /&gt;Calendar cal2 = new GregorianCalendar(2007, Calendar.SEPTEMBER, 15);&lt;br /&gt;           &lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;// Determine which is earlier&lt;/span&gt;&lt;br /&gt;boolean b = cal1.after(cal2);            // false&lt;br /&gt;b = cal1.before(cal2);                   // true&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;// Get difference in milliseconds&lt;/span&gt;&lt;br /&gt;long diffMillis = cal2.getTimeInMillis()-cal1.getTimeInMillis(); //1209600000</description><link>http://java-techsavy.blogspot.com/2009/06/how-to-compare-dates.html</link><author>noreply@blogger.com (Techsavy)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4708295469068081857.post-8864124639573479349</guid><pubDate>Fri, 26 Jun 2009 03:36:00 +0000</pubDate><atom:updated>2009-06-25T20:36:51.970-07:00</atom:updated><title>How to Create a Date Object</title><description>Calendar cal = new GregorianCalendar(2007, Calendar.SEPTEMBER, 1);&lt;br /&gt;Date date = cal.getTime(); // Sat Sep 01 00:00:00 PDT 2007</description><link>http://java-techsavy.blogspot.com/2009/06/how-to-create-date-object.html</link><author>noreply@blogger.com (Techsavy)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4708295469068081857.post-7417279335491109867</guid><pubDate>Fri, 26 Jun 2009 03:35:00 +0000</pubDate><atom:updated>2009-06-25T20:36:24.980-07:00</atom:updated><title>How to Get the Current Date</title><description>Calendar cal = new GregorianCalendar();&lt;br /&gt;            &lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;// Get the components of the date&lt;/span&gt;&lt;br /&gt;int era = cal.get(Calendar.ERA);               // 1&lt;br /&gt;int year = cal.get(Calendar.YEAR);             // 2009&lt;br /&gt;int month = cal.get(Calendar.MONTH);           // 0=Jan, 1=Feb, ...&lt;br /&gt;int day = cal.get(Calendar.DAY_OF_MONTH);      // 25&lt;br /&gt;int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK); // 1=Sunday, 2=Monday, ...</description><link>http://java-techsavy.blogspot.com/2009/06/how-to-get-current-date.html</link><author>noreply@blogger.com (Techsavy)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4708295469068081857.post-4379940567205832569</guid><pubDate>Fri, 26 Jun 2009 03:35:00 +0000</pubDate><atom:updated>2009-06-25T20:35:51.809-07:00</atom:updated><title>How to Get the Current Time in Another Time Zone</title><description>&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;// Get the current time in London&lt;/span&gt;&lt;br /&gt;Calendar cal = new GregorianCalendar(TimeZone.getTimeZone(&quot;London&quot;));&lt;br /&gt;   &lt;br /&gt;int hour12 = cal.get(Calendar.HOUR);       &lt;br /&gt;int minutes = cal.get(Calendar.MINUTE);    &lt;br /&gt;int seconds = cal.get(Calendar.SECOND);    &lt;br /&gt;int am = cal.get(Calendar.AM_PM);           &lt;br /&gt;   &lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;// Get the current hour-of-day at GMT&lt;/span&gt;&lt;br /&gt;cal.setTimeZone(TimeZone.getTimeZone(&quot;GMT&quot;));&lt;br /&gt;int hour24 = cal.get(Calendar.HOUR_OF_DAY);</description><link>http://java-techsavy.blogspot.com/2009/06/how-to-get-current-time-in-another-time.html</link><author>noreply@blogger.com (Techsavy)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4708295469068081857.post-5498013431751684687</guid><pubDate>Fri, 26 Jun 2009 03:34:00 +0000</pubDate><atom:updated>2009-06-25T20:35:03.356-07:00</atom:updated><title>How to Get the Current Time</title><description>Calendar cal = new GregorianCalendar();&lt;br /&gt;   &lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;// Get the components of the time&lt;/span&gt;&lt;br /&gt;int hour12 = cal.get(Calendar.HOUR);&lt;br /&gt;int hour24 = cal.get(Calendar.HOUR_OF_DAY);&lt;br /&gt;int minute = cal.get(Calendar.MINUTE);&lt;br /&gt;int second = cal.get(Calendar.SECOND);&lt;br /&gt;int millisecond = cal.get(Calendar.MILLISECOND);&lt;br /&gt;int ampm = cal.get(Calendar.AM_PM);</description><link>http://java-techsavy.blogspot.com/2009/06/how-to-get-current-time.html</link><author>noreply@blogger.com (Techsavy)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4708295469068081857.post-3567326249808794296</guid><pubDate>Fri, 26 Jun 2009 03:34:00 +0000</pubDate><atom:updated>2009-06-25T20:34:32.425-07:00</atom:updated><title>How to Sort an Array</title><description>String[] strArray = new String[] {&quot;x&quot;, &quot;y&quot;, &quot;Z&quot;};&lt;br /&gt;Arrays.sort(strArray);&lt;br /&gt;// [Z, x, y]</description><link>http://java-techsavy.blogspot.com/2009/06/how-to-sort-array.html</link><author>noreply@blogger.com (Techsavy)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4708295469068081857.post-8135050822733495822</guid><pubDate>Fri, 26 Jun 2009 03:33:00 +0000</pubDate><atom:updated>2009-06-25T20:33:59.144-07:00</atom:updated><title>How to Use Sorted Map</title><description>Keys in the TreeMap will automatically be sorted.&lt;br /&gt;&lt;br /&gt;Map map = new TreeMap();&lt;br /&gt;map.put(&quot;a&quot;, new Integer(1));&lt;br /&gt;map.put(&quot;c&quot;, new Integer(3));&lt;br /&gt;map.put(&quot;b&quot;, new Integer(2));&lt;br /&gt;// [a=1, b=2, c=3]</description><link>http://java-techsavy.blogspot.com/2009/06/how-to-use-sorted-map.html</link><author>noreply@blogger.com (Techsavy)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4708295469068081857.post-3887608691743981790</guid><pubDate>Fri, 26 Jun 2009 03:32:00 +0000</pubDate><atom:updated>2009-06-25T20:33:31.466-07:00</atom:updated><title>How to Use Hash Table</title><description>Difference between HashMap and Hashtable :&lt;br /&gt;&lt;br /&gt;1) HashMap accepts null key, whereas Hashtable doesn&#39;t.&lt;br /&gt;2) HashMap is not thread-safe, whereas Hashtable is thread-safe.&lt;br /&gt;&lt;br /&gt;Map map = new Hashtable();&lt;br /&gt;map.put(&quot;a&quot;, new Integer(1));&lt;br /&gt;map.put(&quot;b&quot;, new Integer(2));&lt;br /&gt;map.put(&quot;c&quot;, new Integer(3));&lt;br /&gt;//map.put(null, new Integer(1)); // not allowed</description><link>http://java-techsavy.blogspot.com/2009/06/how-to-use-hash-table.html</link><author>noreply@blogger.com (Techsavy)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4708295469068081857.post-4834377956651822147</guid><pubDate>Fri, 26 Jun 2009 03:31:00 +0000</pubDate><atom:updated>2009-06-25T20:32:41.734-07:00</atom:updated><title>How to Retain the Insertion Order in a Map</title><description>Use LinkedHashMap to retain&lt;br /&gt;&lt;br /&gt;Map map = new LinkedHashMap();&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;// Add some elements&lt;/span&gt;&lt;br /&gt;map.put(&quot;a&quot;, new Integer(1));&lt;br /&gt;map.put(&quot;b&quot;, new Integer(2));&lt;br /&gt;map.put(&quot;c&quot;, new Integer(3));&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;// List the entries&lt;/span&gt;&lt;br /&gt;for (Iterator it=map.keySet().iterator(); it.hasNext(); ) {&lt;br /&gt;    Object key = it.next();&lt;br /&gt;    Object value = map.get(key);&lt;br /&gt;}&lt;br /&gt;// [a=1, b=2, c=3]</description><link>http://java-techsavy.blogspot.com/2009/06/how-to-retain-insertion-order-in-map.html</link><author>noreply@blogger.com (Techsavy)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4708295469068081857.post-7879907353134410038</guid><pubDate>Fri, 26 Jun 2009 03:30:00 +0000</pubDate><atom:updated>2009-06-25T20:31:45.841-07:00</atom:updated><title>How to Iterate the Map</title><description>&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;// Iterate over the keys in the map&lt;/span&gt;&lt;br /&gt;Iterator it = map.keySet().iterator();&lt;br /&gt;while (it.hasNext()) {&lt;br /&gt;    &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;// Get key&lt;/span&gt;&lt;br /&gt;    Object key = it.next();&lt;br /&gt;}&lt;br /&gt;   &lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;// Iterate over the values in the map&lt;/span&gt;&lt;br /&gt;it = map.values().iterator();&lt;br /&gt;while (it.hasNext()) {&lt;br /&gt;    // Get value&lt;br /&gt;    Object value = it.next();&lt;br /&gt;}</description><link>http://java-techsavy.blogspot.com/2009/06/how-to-iterate-map.html</link><author>noreply@blogger.com (Techsavy)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4708295469068081857.post-8514755564049720350</guid><pubDate>Fri, 26 Jun 2009 03:30:00 +0000</pubDate><atom:updated>2009-06-25T20:30:54.891-07:00</atom:updated><title>How to Remove the Entry from the Map</title><description>&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;// Create a hash map&lt;/span&gt;&lt;br /&gt;Map map = new HashMap();&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 204, 204);&quot;&gt;// Add key/value pairs to the map&lt;/span&gt;&lt;br /&gt;map.put(&quot;a&quot;, new Integer(1));&lt;br /&gt;map.put(&quot;b&quot;, new Integer(2));&lt;br /&gt;map.put(&quot;c&quot;, new Integer(3));&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;// remove method returns the value of removed key&lt;/span&gt;&lt;br /&gt;oldValue = map.remove(&quot;c&quot;);  // 3</description><link>http://java-techsavy.blogspot.com/2009/06/how-to-remove-entry-from-map.html</link><author>noreply@blogger.com (Techsavy)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4708295469068081857.post-773651159177285965</guid><pubDate>Fri, 26 Jun 2009 03:29:00 +0000</pubDate><atom:updated>2009-06-25T20:30:07.543-07:00</atom:updated><title>How to Create a Map</title><description>Map is a list of key-value pairs&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;// Create a hash map&lt;/span&gt;&lt;br /&gt;Map map = new HashMap();&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;// Add key/value pairs to the map&lt;/span&gt;&lt;br /&gt;map.put(&quot;a&quot;, new Integer(1));&lt;br /&gt;map.put(&quot;b&quot;, new Integer(2));&lt;br /&gt;map.put(&quot;c&quot;, new Integer(3));</description><link>http://java-techsavy.blogspot.com/2009/06/how-to-create-map.html</link><author>noreply@blogger.com (Techsavy)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4708295469068081857.post-5582748451213958405</guid><pubDate>Fri, 26 Jun 2009 03:28:00 +0000</pubDate><atom:updated>2009-06-25T20:29:25.834-07:00</atom:updated><title>How to Use Sorted Set</title><description>Elements in the TreeSet will automatically be arranged in sorted form.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;// Create the sorted set&lt;/span&gt;&lt;br /&gt;Set set = new TreeSet();&lt;br /&gt;   &lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;// Add elements to the set&lt;/span&gt;&lt;br /&gt;set.add(&quot;b&quot;);&lt;br /&gt;set.add(&quot;c&quot;);&lt;br /&gt;set.add(&quot;a&quot;);&lt;br /&gt;&lt;br /&gt;//[a,b,C]</description><link>http://java-techsavy.blogspot.com/2009/06/how-to-use-sorted-set.html</link><author>noreply@blogger.com (Techsavy)</author><thr:total>0</thr:total></item></channel></rss>