<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='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'><id>tag:blogger.com,1999:blog-8479811475318271344</id><updated>2024-09-01T23:42:42.845-07:00</updated><category term="ASCII"/><category term="Autoboxing"/><category term="Comparable interface"/><category term="Error validating server certificate / The certificate is not issued by a trusted authority"/><category term="GlassFish 3.1 Server Full Profile vs Web Profile"/><category term="GlassFish Server Full Profile vs Web Profile"/><category term="How WTF’s improve code quality awareness"/><category term="JAR search engine"/><category term="JDBC Connection"/><category term="JDBC warnings"/><category term="JDO"/><category term="JDO implementations"/><category term="Jar"/><category term="Java Anonymous Classes"/><category term="Java Data Objects"/><category term="Java Freelancing"/><category term="Kathy Sierra&#39;s Java 5 Ebook"/><category term="Logger replaces Category"/><category term="Parameter vs Argument"/><category term="Persistance"/><category term="SVN commands"/><category term="SVN red book"/><category term="Tomcat"/><category term="Validation characterset"/><category term="desending sort algo"/><category term="loading JDBC driver"/><category term="log4j category vs logger"/><category term="relocating/switching SVN repository"/><category term="sorting array using Collection.sort"/><category term="sorting double array"/><category term="sorting list using Collection.sort"/><category term="static methods"/><category term="static variables"/><category term="svn credentials"/><category term="svn password"/><category term="svn switch"/><category term="svn switch - relocate"/><title type='text'>Java Talks</title><subtitle type='html'>&lt;strong&gt;&quot;Java talks&quot; is about Java technologies including:&#xa;Hibernate, JDO, JDBC, Servlet, JSP, Sturts, Web Services, Spring, AWS, Spring Boot, Spark, Scala etc.&lt;/strong&gt;</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>25</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8479811475318271344.post-2061559766629540830</id><published>2011-10-17T02:27:00.000-07:00</published><updated>2011-10-17T02:27:01.610-07:00</updated><title type='text'>How to upload an artifact to maven remote repository?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;If you want to deploy artifacts that were not build using maven, or which were build using maven but their POMs did not contains the deployment detials, then you need to deploy them using the following:&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
mvn -e deploy:deploy-file&lt;br /&gt;
-DgroupId=com.test.jpa&lt;br /&gt;
-DartifactId=jpa-demo&lt;br /&gt;
-Dversion=1.0.0&lt;br /&gt;
-Dpackaging=jar&lt;br /&gt;
-Dfile=jpa-demo-1.0.0.jar&lt;br /&gt;
-Durl=http://localhost:8080/archiva/repository/internal/&lt;br /&gt;
-DrepositoryId=reppoI&lt;/i&gt;d&lt;br /&gt;
&lt;br /&gt;
url: specifies the remote maven repository to where the jar is to be uploaded&lt;br /&gt;
repositoryId: Id repository is secured, repositoryId is used to specify the credentials that are to be used for uploading. Repositories are defined in settings.xml.&lt;br /&gt;
e.g.&lt;br /&gt;
&amp;lt;servers&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;server&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;id&amp;gt;deploymentRepo&amp;lt;/id&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;username&amp;gt;repouser&amp;lt;/username&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;password&amp;gt;repopwd&amp;lt;/password&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/server&amp;gt;&lt;br /&gt;
&amp;lt;/servers&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Maven repository will return code 401 if credentials are missing or invalid.&lt;br /&gt;
&lt;br /&gt;
Better way is to use deploy phase of the default build lifecycle. For that include a valid &amp;lt;distributionManagement/&amp;gt; section in project&#39;s pom.xml and define the remote repository using &amp;lt;repository/&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the repository is secured, you should configure your settings.xml file to define corresponding &amp;lt;server/&amp;gt; entries which provides authentication information.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;pom.xml&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;...&lt;br /&gt;
&amp;lt;distributionManagement&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;repository&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;id&amp;gt;my.internal.repo&amp;lt;/id&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;name&amp;gt;Internal Repository&amp;lt;/name&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;url&amp;gt;http://...&amp;lt;/url&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/repository&amp;gt;&lt;br /&gt;
&amp;lt;/distributionManagement&amp;gt;&lt;br /&gt;
...&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;settings.xml&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;...&lt;br /&gt;
&amp;lt;server&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;id&amp;gt;my.internal.repo&amp;lt;/id&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;username&amp;gt;user&amp;lt;/username&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;password&amp;gt;pass&amp;lt;/password&amp;gt;&lt;br /&gt;
&amp;lt;/server&amp;gt;&lt;br /&gt;
...&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
maven deploy&lt;/i&gt; will not deploy the artifact to your remote repository.&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/2061559766629540830/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8479811475318271344/2061559766629540830' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/2061559766629540830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/2061559766629540830'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/2011/10/how-to-upload-artifact-to-maven-remote.html' title='How to upload an artifact to maven remote repository?'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8479811475318271344.post-4186302236167353261</id><published>2011-08-01T01:06:00.000-07:00</published><updated>2011-08-01T01:06:41.058-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Error validating server certificate / The certificate is not issued by a trusted authority"/><title type='text'>Error validating server certificate / The certificate is not issued by a trusted authority</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;I was able to use SVN with ease (checkin, checkout, update code) until recently the SVN server went through some changes. I started to see the following on each SVN command:&lt;br /&gt;
&lt;br /&gt;
&lt;i style=&quot;color: red;&quot;&gt;Error validating server certificate for &#39;https://svn.myserver.com:443&#39;:&lt;br /&gt;
&amp;nbsp;- The certificate is not issued by a trusted authority. Use the&lt;br /&gt;
&amp;nbsp;&amp;nbsp; fingerprint to validate the certificate manually!&lt;br /&gt;
&amp;nbsp;- The certificate hostname does not match.&lt;br /&gt;
Certificate information:&lt;br /&gt;
&amp;nbsp;- Hostname: de-v-svn&lt;br /&gt;
&amp;nbsp;- Valid: from ...&lt;br /&gt;
&amp;nbsp;- Issuer: I...&lt;br /&gt;
&amp;nbsp;- Fingerprint: ...&lt;br /&gt;
(R)eject, accept (t)emporarily or accept (p)ermanently? &lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
It worked fine when I selected&amp;nbsp; (p)ermanently but had to do it again next time I used&amp;nbsp; SVN command.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Solution: &lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;Delete ~/.subversion folder.&lt;/span&gt;&lt;br style=&quot;color: #274e13;&quot; /&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;svn cleanup&lt;/span&gt;&lt;br style=&quot;color: #274e13;&quot; /&gt;&lt;span style=&quot;color: #274e13;&quot;&gt;svn up&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/4186302236167353261/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8479811475318271344/4186302236167353261' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/4186302236167353261'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/4186302236167353261'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/2011/08/error-validating-server-certificate.html' title='Error validating server certificate / The certificate is not issued by a trusted authority'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8479811475318271344.post-5656367766319421602</id><published>2011-07-19T07:44:00.000-07:00</published><updated>2011-07-19T08:17:42.606-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="log4j category vs logger"/><category scheme="http://www.blogger.com/atom/ns#" term="Logger replaces Category"/><title type='text'>log4j - use logger instead of category</title><content type='html'>&lt;b&gt;Do not use &#39;category&#39;.&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
In log4j 1.2, the Category class has marked as being deprecated and has been replaced by the Logger class. I am using log4j-1.2.14.jar and category didn&#39;t work for me.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&lt;div style=&quot;color: #274e13;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;logger name=&quot;com.test.pkg1&quot;&amp;gt;&amp;lt;level value=&quot;INFO&quot;/&amp;gt;&amp;lt;/logger&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #274e13;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;logger name=&quot;com.test.pkg2&quot;&amp;gt;&amp;lt;level value=&quot;INFO&quot;/&amp;gt;&amp;lt;/logger&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
Was:&lt;br /&gt;
&lt;div style=&quot;color: red;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;category name=&quot;com.test.pkg1&quot;&amp;gt;&amp;lt;priority value=&quot;INFO&quot;/&amp;gt;&amp;lt;/category&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: red;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;category name=&quot;com.test.pkg2&quot;&amp;gt;&amp;lt;priority value=&quot;INFO&quot;/&amp;gt;&amp;lt;/category&amp;gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/5656367766319421602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8479811475318271344/5656367766319421602' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/5656367766319421602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/5656367766319421602'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/2011/07/log4j-use-logger-instead-of-category.html' title='log4j - use logger instead of category'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8479811475318271344.post-469122420251195750</id><published>2011-06-17T11:06:00.000-07:00</published><updated>2011-06-17T11:10:06.088-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GlassFish 3.1 Server Full Profile vs Web Profile"/><category scheme="http://www.blogger.com/atom/ns#" term="GlassFish Server Full Profile vs Web Profile"/><title type='text'>GlassFish Server - Full Profile vs Web Profile</title><content type='html'>When you are about to download Glassfish server 3.x, you need to decide you want to download Full Profile or Web Profile version.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://download.oracle.com/docs/cd/E18930_01/html/821-2427/ggrlg.html#gkuap&quot;&gt;View the differences.&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/469122420251195750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8479811475318271344/469122420251195750' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/469122420251195750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/469122420251195750'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/2011/06/glassfish-server-full-profile-and-web.html' title='GlassFish Server - Full Profile vs Web Profile'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8479811475318271344.post-3533520701257848436</id><published>2011-01-03T02:01:00.000-08:00</published><updated>2011-01-03T02:03:35.273-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="svn credentials"/><category scheme="http://www.blogger.com/atom/ns#" term="svn password"/><title type='text'>svn credentials caching</title><content type='html'>SVN client has a built-in system for caching authentication credentials on disk. It saves the credentials in the user&#39;s private runtime configuration area&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;~/.subversion/auth/&lt;/span&gt; (Unix-like systems)&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;%APPDATA%/Subversion/auth/&lt;/span&gt; (Windows)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; If you dont want to catch the credeitials for a commit, use --no-auth-cache.&lt;br /&gt;&lt;span style=&quot;font-style: italic; font-weight: bold;&quot;&gt;$ svn commit --no-auth-cache&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here we are telling the svn client that dont cach authentication credentials.&lt;br /&gt;&lt;br /&gt;You can disable credential caching permanently by editing your runtime config file (located next to the auth/ directory). Set store-auth-creds to no.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; font-weight: bold;&quot;&gt;[auth]&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic; font-weight: bold;&quot;&gt;store-auth-creds = no&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/3533520701257848436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8479811475318271344/3533520701257848436' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/3533520701257848436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/3533520701257848436'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/2011/01/svn-credentials-caching.html' title='svn credentials caching'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8479811475318271344.post-5634122491502445340</id><published>2010-08-25T04:43:00.000-07:00</published><updated>2010-08-25T04:52:23.010-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Comparable interface"/><category scheme="http://www.blogger.com/atom/ns#" term="sorting array using Collection.sort"/><category scheme="http://www.blogger.com/atom/ns#" term="sorting list using Collection.sort"/><title type='text'>Comparable interface</title><content type='html'>Lists and Arrays of objects that implement Comparable interface can be sorted automatically by Collections.sort and Arrays.sort respectively.&lt;br /&gt;&lt;br /&gt;Implementation Comparable is easy. You just have to implement compareTo(Object o). It should return negative integer, zero, or a positive integer as this object is less than, equal to,or greater than the specified object.&lt;br /&gt;&lt;br /&gt;Here goes an example:&lt;br /&gt;&lt;br /&gt; &lt;span style=&quot;;font-family:arial;font-size:85%;&quot;  &gt;  public void testListSort(){&lt;br /&gt;&lt;br /&gt;       Calendar cal = Calendar.getInstance();&lt;br /&gt;       cal.set(2010, 10, 1);&lt;br /&gt;       License msWindows7 = new License(&quot;Windows&quot;, &quot;7&quot;,new Date(cal.getTimeInMillis()));&lt;br /&gt;       cal.clear();&lt;br /&gt;       cal.set(2010, 11, 10);&lt;br /&gt;       License msWindowsVista = new License(&quot;Windows&quot;, &quot;Vista&quot;, new Date(cal.getTimeInMillis()));&lt;br /&gt;       cal.clear();&lt;br /&gt;       cal.set(2010, 11, 5);&lt;br /&gt;       License lotusNotes = new License(&quot;Notes&quot;, &quot;1.1&quot;, new Date(cal.getTimeInMillis()));&lt;br /&gt;&lt;br /&gt;       List&lt;license&gt; list = new ArrayList&lt;license&gt;(3);&lt;br /&gt;&lt;br /&gt;       list.add(lotusNotes);&lt;br /&gt;       list.add(msWindowsVista);&lt;br /&gt;       list.add(msWindows7);&lt;br /&gt;&lt;br /&gt;       Collections.sort(list);&lt;br /&gt;&lt;br /&gt;       for(License l : list){&lt;br /&gt;           System.out.println(l);&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt; &lt;br /&gt;   private  class License implements Comparable&lt;license&gt;{&lt;br /&gt;       String id;&lt;br /&gt;       String version;&lt;br /&gt;       Date expiryDate;&lt;br /&gt;&lt;br /&gt;       public License(String id, String version,&lt;br /&gt;               Date expiryDate) {&lt;br /&gt;           this.id = id;&lt;br /&gt;           this.version = version;&lt;br /&gt;           this.expiryDate = expiryDate;&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;       @Override&lt;br /&gt;       public int compareTo(License license) {&lt;br /&gt;           // Returns a negative integer, zero, or a positive integer as this object is less than,&lt;br /&gt;           // equal to,or greater than the specified object.&lt;br /&gt;&lt;br /&gt;           if(this.expiryDate.after(license.expiryDate)){&lt;br /&gt;               return 1;&lt;br /&gt;           }&lt;br /&gt;           else{&lt;br /&gt;               return 0;&lt;br /&gt;           }&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;       @Override&lt;br /&gt;       public String toString(){&lt;br /&gt;           return &quot;id: &quot; + id + &quot;\n&quot; +&lt;br /&gt;           &quot;version: &quot; + version + &quot;\n&quot; +&lt;br /&gt;           &quot;expiryDate: &quot; + expiryDate + &quot;\n\n&quot;;&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;Your comments are welcome as always :)</content><link rel='replies' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/5634122491502445340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8479811475318271344/5634122491502445340' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/5634122491502445340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/5634122491502445340'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/2010/08/comparable-interface.html' title='Comparable interface'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8479811475318271344.post-4586233252433310463</id><published>2010-08-25T03:00:00.000-07:00</published><updated>2010-08-25T03:03:07.907-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="desending sort algo"/><category scheme="http://www.blogger.com/atom/ns#" term="sorting double array"/><title type='text'>desending sort algo</title><content type='html'>&lt;span style=&quot;font-family: arial;font-size:85%;&quot; &gt;...&lt;br /&gt;        double []test = new double []{88.6,88.9,-1,25,88.6};&lt;br /&gt;        int size = test.length;&lt;br /&gt;       &lt;br /&gt;        System.out.println(&quot;*** un-sorted ***&quot;);&lt;br /&gt;        for (double d : test){&lt;br /&gt;            System.out.println(d);&lt;br /&gt;        }&lt;br /&gt;       &lt;br /&gt;        // descending sort algo *************************************&lt;br /&gt;        int counter = 0;&lt;br /&gt;        int indexOfMax = 0;&lt;br /&gt;       &lt;br /&gt;        // after each iteration of while, test[counter] should have the correct value&lt;br /&gt;        while (counter &lt; size){&lt;br /&gt;            indexOfMax = counter; // assuming that test[counter] has the max value&lt;br /&gt;            // this loop finds the index of max value (stores in indexOfMax) from the test   array starting from index counter+1&lt;br /&gt;            for(int i = counter+1; i &lt; size; i++){ &lt;br /&gt;            if (test[i]&gt;test[indexOfMax]){&lt;br /&gt;                indexOfMax = i;&lt;br /&gt;            }&lt;br /&gt;        } // end of for loop -- now indexOfMax should have the max value&lt;br /&gt;&lt;br /&gt;        // swapping&lt;br /&gt;        double tmp = test[counter];&lt;br /&gt;        test[counter] = test[indexOfMax];&lt;br /&gt;        test[indexOfMax] = tmp;&lt;br /&gt;        counter++;&lt;br /&gt;        }&lt;br /&gt;        // end of algo *********************************************&lt;br /&gt;       &lt;br /&gt;        System.out.println(&quot;*** sorted ***&quot;);&lt;br /&gt;        for (double d : test){&lt;br /&gt;            System.out.println(d);&lt;br /&gt;        }&lt;br /&gt;...&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/4586233252433310463/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8479811475318271344/4586233252433310463' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/4586233252433310463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/4586233252433310463'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/2010/08/desending-sort-algo.html' title='desending sort algo'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8479811475318271344.post-9076197948604216472</id><published>2010-08-02T05:05:00.000-07:00</published><updated>2010-08-02T05:09:51.076-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="relocating/switching SVN repository"/><category scheme="http://www.blogger.com/atom/ns#" term="svn switch"/><category scheme="http://www.blogger.com/atom/ns#" term="svn switch - relocate"/><title type='text'>relocating/switching SVN repository</title><content type='html'>My SVN repository changed recently and I was worried about associating my Java workspace with the new repository . Checking out from the new repository was always an option but of course, I would have lost my non committed changes.&lt;br /&gt;&lt;br /&gt;After googling for half an hour, I found a way to switch my SVN repository.&lt;br /&gt;&lt;br /&gt;1. Find the current repository&#39;s URL to which your files/folders are associated.&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;svn info &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;2. Switch the repo.&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;svn switch --relocate &lt;span style=&quot;font-style: italic;&quot;&gt;&lt;old_url&gt; &lt;new_url&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;3. Verify the current repo&#39;s URL.&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;svn info &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Hope this helps.</content><link rel='replies' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/9076197948604216472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8479811475318271344/9076197948604216472' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/9076197948604216472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/9076197948604216472'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/2010/08/relocatingswitching-svn-repository.html' title='relocating/switching SVN repository'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8479811475318271344.post-700053818636671204</id><published>2010-08-02T04:37:00.000-07:00</published><updated>2011-01-04T01:00:37.432-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SVN commands"/><title type='text'>Useful SVN commands</title><content type='html'>&lt;span style=&quot;font-weight: bold;&quot;&gt;svn info&lt;/span&gt;&lt;br /&gt;Print information about paths in your working copy.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;svn status / svn st&lt;/span&gt;&lt;br /&gt;Print the status of working copy files and            directories.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;svn update / svn up&lt;/span&gt;&lt;br /&gt;updates the working copy.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;svn commit -m &quot;message goes here&quot; / svn ci&lt;/span&gt;&lt;br /&gt;Send changes from your working copy to the repository&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;svn log -l 10&lt;/span&gt;&lt;br /&gt;Prints last 10 commits in reverse-chronological order by default.</content><link rel='replies' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/700053818636671204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8479811475318271344/700053818636671204' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/700053818636671204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/700053818636671204'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/2010/08/useful-svn-commands.html' title='Useful SVN commands'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8479811475318271344.post-3122709742799846684</id><published>2010-06-09T01:51:00.000-07:00</published><updated>2010-06-09T01:58:43.675-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SVN red book"/><title type='text'>SVN red book</title><content type='html'>I normally use Subclipse plugin for Eclipse for SVN operations. It really makes life easy. I am a novice when it comes to performing svn operations using SVN commands.&lt;br /&gt;&lt;br /&gt;I found a very useful resource for that:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://svnbook.red-bean.com/en/1.5/index.html&quot;&gt;HTML version of SVN red book (for subversion 1.5)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Hope you find this useful :)</content><link rel='replies' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/3122709742799846684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8479811475318271344/3122709742799846684' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/3122709742799846684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/3122709742799846684'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/2010/06/svn-red-book.html' title='SVN red book'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8479811475318271344.post-5827753229745046615</id><published>2010-03-02T07:26:00.000-08:00</published><updated>2010-03-02T07:27:58.049-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Tomcat"/><title type='text'>Tomcat for J2EE</title><content type='html'>Apache Tomcat now supports J2EE applications.</content><link rel='replies' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/5827753229745046615/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8479811475318271344/5827753229745046615' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/5827753229745046615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/5827753229745046615'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/2010/03/tomcat-for-j2ee.html' title='Tomcat for J2EE'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8479811475318271344.post-3619545495905305982</id><published>2009-09-01T02:47:00.000-07:00</published><updated>2009-09-01T02:50:11.659-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JAR search engine"/><title type='text'>JAR search engine</title><content type='html'>I have been using &lt;a href=&quot;http://www.findjar.com&quot;&gt;FindJar&lt;/a&gt; which is a JAR search engine that helps to find JAR files containing required Java classes. Try it out.</content><link rel='replies' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/3619545495905305982/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8479811475318271344/3619545495905305982' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/3619545495905305982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/3619545495905305982'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/2009/09/jar-search-engine.html' title='JAR search engine'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8479811475318271344.post-4774948980376504257</id><published>2009-06-30T11:16:00.000-07:00</published><updated>2009-06-30T11:18:48.121-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Parameter vs Argument"/><title type='text'>Parameter vs Argument</title><content type='html'>The parameter is the local variable in the method and the argument is the caller-supplied value/reference.&lt;br /&gt;&lt;br /&gt;In the given example, the parameter for doSomething is &#39;a&#39;  and the argument is 22.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;public static void doSomething(int a)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt; {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;      System.out.println(&quot;The argument was &quot; + a);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt; }&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt; public static void main(String[] s)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt; {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;      doSomething(22);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt; }&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/4774948980376504257/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8479811475318271344/4774948980376504257' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/4774948980376504257'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/4774948980376504257'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/2009/06/parameter-vs-argument.html' title='Parameter vs Argument'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8479811475318271344.post-5748449037260199730</id><published>2009-04-17T01:46:00.000-07:00</published><updated>2009-04-17T01:50:05.026-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="How WTF’s improve code quality awareness"/><title type='text'>measurement of code quality - WTF’s/minute</title><content type='html'>&lt;p class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;An Interesting article about how WTFs can improve Code quality in a team&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt;&lt;a href=&quot;http://www.gridshore.nl/2008/03/29/how-wtfs-improve-code-quality-awareness/&quot;&gt;How WTF’s improve code quality awareness&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;&quot; lang=&quot;EN-US&quot;&gt; &lt;/span&gt;&lt;/p&gt; &lt;span lang=&quot;EN-US&quot;&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/5748449037260199730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8479811475318271344/5748449037260199730' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/5748449037260199730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/5748449037260199730'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/2009/04/measurement-of-code-quality-wtfsminute.html' title='measurement of code quality - WTF’s/minute'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8479811475318271344.post-5694979812048742984</id><published>2009-03-22T12:58:00.000-07:00</published><updated>2009-03-22T13:00:37.505-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Kathy Sierra&#39;s Java 5 Ebook"/><title type='text'>SCJP resource (Kathy Sierra&#39;s EBook)</title><content type='html'>One of the best resource for SCJP is Kathy Sierra&#39;s Java 5 EBook.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://rs169.rapidshare.com/files/56642912/Sun_Certified_Java_Programmer_scjp_5__kathy_sierra_.zip&quot;&gt;Download from RapidShare&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/5694979812048742984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8479811475318271344/5694979812048742984' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/5694979812048742984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/5694979812048742984'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/2009/03/scjp-resource-kathy-sierras-ebook.html' title='SCJP resource (Kathy Sierra&#39;s EBook)'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8479811475318271344.post-6502484052786322324</id><published>2009-03-13T02:02:00.000-07:00</published><updated>2009-03-13T02:06:45.814-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Autoboxing"/><title type='text'>Autoboxing example</title><content type='html'>You can’t put a primitive value into a collection since collections can only hold object references. To do so, you need to box primitive values into the appropriate wrapper class. When retriving, you get an object out of the collection and you need to unbox the it. Java 5 provides autoboxing and unboxing feature that eliminates the pain.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:#7f0055;&quot;&gt;&lt;b&gt;import &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;java.util.ArrayList;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;     &lt;/span&gt;&lt;span style=&quot;color:#7f0055;&quot;&gt;&lt;b&gt;public class &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Autoboxing &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;       &lt;/span&gt;&lt;span style=&quot;color:#7f0055;&quot;&gt;&lt;b&gt;public static &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color:#7f0055;&quot;&gt;&lt;b&gt;void &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;main&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;[] &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;args&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;) {&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;           &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;ArrayList&lt;integer&gt; list = &lt;/span&gt;&lt;span style=&quot;color:#7f0055;&quot;&gt;&lt;b&gt;new &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;ArrayList&lt;integer&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;           &lt;/span&gt;&lt;span style=&quot;color:#7f0055;&quot;&gt;&lt;b&gt;for&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#7f0055;&quot;&gt;&lt;b&gt;int &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;i = &lt;/span&gt;&lt;span style=&quot;color:#990000;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;; i &lt; &lt;/span&gt;&lt;span style=&quot;color:#990000;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;; i++&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;){&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;              &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;list.add&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;i&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;           &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;           &lt;/span&gt;&lt;span style=&quot;color:#7f0055;&quot;&gt;&lt;b&gt;int &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;sum = &lt;/span&gt;&lt;span style=&quot;color:#990000;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;color:#7f0055;&quot;&gt;&lt;b&gt;for &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;( &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;Integer j : list&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;){&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;            &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;sum += j;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;          &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;         &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;System.out.printf&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color:#2a00ff;&quot;&gt;&quot;The sum is %d.&quot;&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;, sum &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;       &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ffffff;&quot;&gt;     &lt;/span&gt;&lt;span style=&quot;color:#000000;&quot;&gt;} &lt;/span&gt;&lt;/code&gt;</content><link rel='replies' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/6502484052786322324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8479811475318271344/6502484052786322324' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/6502484052786322324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/6502484052786322324'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/2009/03/autoboxing-example.html' title='Autoboxing example'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8479811475318271344.post-5419195106262952863</id><published>2009-03-04T05:18:00.000-08:00</published><updated>2009-03-04T05:27:26.836-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java Anonymous Classes"/><title type='text'>Anonymous Classes</title><content type='html'>Anonymous class is normally used to provide a simple implementation of an adapter class. Many developers don’t just wanna use these because they feel its not really required and is toocomplex.&lt;br /&gt;&lt;br /&gt;For sure you may do the required task without using anonymous classes but sometimes it is really wise to use these.  Let me list features of anonymous classes for you:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;is a local class without a name&lt;/li&gt;&lt;li&gt;is defined and instantiated in a single expression using the new operator&lt;/li&gt;&lt;li&gt;anonymous class definition is an expression&lt;/li&gt;&lt;li&gt;it can be included as part of a larger expression (method call)&lt;/li&gt;&lt;/ul&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;When to use it&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;When a local class is used only once, consider using anonymous class syntax. It places the definition and use of the class in exactly the same place.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Syntax&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;We use new keyword for defining an anonymous class and creating an instance of that class. It is followed by the name of a class and a class body definition in curly braces. If you wish to subclass your anonymous class, then the name following the new keyword should be the name of some superclass. This way the anonymous class is a subclass of the named class.&lt;br /&gt;&lt;br /&gt;If you wish your subclass to implement an interface, then the name following new should be an interface. This way your anonymous class implements that interface and extends Object. Remember that the syntax does not include any way to specify extends or implements keyword.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Example&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span style=&quot;font-style: italic;&quot;&gt;// The anonymous class is defined as part of the return statement&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;  return new MyClass() { &lt;/span&gt;&lt;br&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;    public String getName() {  &lt;/span&gt;&lt;br&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;    ...&lt;br&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;    }&lt;br&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;  };  &lt;br&gt;// Note the required semicolon: it terminates the return statement&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Since anonymous class has no name, it is not possible to define a constructor for it within the class body. But if you provide any arguments between the parentheses following the superclass name then they are implicitly passed to the superclass constructor.</content><link rel='replies' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/5419195106262952863/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8479811475318271344/5419195106262952863' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/5419195106262952863'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/5419195106262952863'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/2009/03/anonymous-classes.html' title='Anonymous Classes'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8479811475318271344.post-2762322715625198388</id><published>2009-02-23T14:14:00.000-08:00</published><updated>2009-02-23T14:22:22.500-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JDBC Connection"/><category scheme="http://www.blogger.com/atom/ns#" term="JDBC warnings"/><category scheme="http://www.blogger.com/atom/ns#" term="loading JDBC driver"/><title type='text'>Getting warnings from JDBC Connection</title><content type='html'>Sometimes it is a wise decision to retrieve the first warning reported by calls on this Connection object. This can be done using getWarnings() method. The code sample below shows how to print all the warnings with their sates and messages.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style=&quot;font-style:italic;&quot;&gt;&lt;br /&gt;Class.forName( &quot;sun.jdbc.odbc.JdbcOdbcDriver&quot; ) ;&lt;br /&gt;Connection conn = DriverManager.getConnection( &quot;jdbc:odbc:Database&quot; ) ;&lt;br /&gt;&lt;br /&gt;// Print all warnings&lt;br /&gt;for( SQLWarning warn = conn.getWarnings(); warn != null; warn = warn.getNextWarning() )&lt;br /&gt;{&lt;br /&gt;System.out.println( &quot;SQL Warning:&quot; ) ;&lt;br /&gt;System.out.println( &quot;State  : &quot; + warn.getSQLState()  ) ;&lt;br /&gt;System.out.println( &quot;Message: &quot; + warn.getMessage()   ) ;&lt;br /&gt;System.out.println( &quot;Error  : &quot; + warn.getErrorCode() ) ;&lt;br /&gt;}&lt;/span&gt;&lt;/blockquote&gt;</content><link rel='replies' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/2762322715625198388/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8479811475318271344/2762322715625198388' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/2762322715625198388'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/2762322715625198388'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/2009/02/getting-warnings-from-jdbc-connection.html' title='Getting warnings from JDBC Connection'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8479811475318271344.post-2542653985768939918</id><published>2009-02-21T18:22:00.000-08:00</published><updated>2009-02-21T18:25:04.998-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java Freelancing"/><title type='text'>Java Freelancing</title><content type='html'>If you have good programming skills, then you may make good money doing freelancing.&lt;br /&gt;&lt;br /&gt;Browse the follwoing&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Elance&lt;/li&gt;&lt;li&gt;RentACoder&lt;/li&gt;&lt;/ul&gt;I may also have some work for Java gurus. Ping me for that.</content><link rel='replies' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/2542653985768939918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8479811475318271344/2542653985768939918' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/2542653985768939918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/2542653985768939918'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/2009/02/java-freelancing.html' title='Java Freelancing'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8479811475318271344.post-3306564092840735174</id><published>2009-02-19T14:57:00.000-08:00</published><updated>2009-02-19T14:58:42.809-08:00</updated><title type='text'>mvn eclipse:eclipse</title><content type='html'>mvn eclipse:eclipse is used to treat all the projects in an Eclipse workspace as Java projects.</content><link rel='replies' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/3306564092840735174/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8479811475318271344/3306564092840735174' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/3306564092840735174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/3306564092840735174'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/2009/02/mvn-eclipseeclipse.html' title='mvn eclipse:eclipse'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8479811475318271344.post-4026121534736545</id><published>2008-03-03T07:02:00.000-08:00</published><updated>2008-03-03T07:05:23.222-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Jar"/><title type='text'>JAR file</title><content type='html'>The JAR file format is based on the popular ZIP file format, and is used for aggregating many files into one. Unlike ZIP files, JAR files are used not only for archiving and distribution, but also for deployment and encapsulation of libraries, components, and plug-ins, and are consumed directly by tools such as compilers and JVMs. Special files contained in the JAR, such as manifests and deployment descriptors, instruct tools how a particular JAR is to be treated.&lt;br /&gt;&lt;br /&gt;A JAR file might be used:&lt;br /&gt;&lt;br /&gt;    * For distributing and using class libraries&lt;br /&gt;    * As building blocks for applications and extensions&lt;br /&gt;    * As deployment units for components, applets, or plug-ins&lt;br /&gt;    * For packaging auxiliary resources associated with components</content><link rel='replies' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/4026121534736545/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8479811475318271344/4026121534736545' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/4026121534736545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/4026121534736545'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/2008/03/jar-file.html' title='JAR file'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8479811475318271344.post-1840715472268552530</id><published>2008-02-21T01:23:00.000-08:00</published><updated>2008-02-21T09:51:40.911-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java Data Objects"/><category scheme="http://www.blogger.com/atom/ns#" term="JDO"/><category scheme="http://www.blogger.com/atom/ns#" term="JDO implementations"/><category scheme="http://www.blogger.com/atom/ns#" term="Persistance"/><title type='text'>Java Data Objects</title><content type='html'>JDO has nothing to do with where methods are executed. JDO simply specifies how the fields of a petent object should be managed in-memory, being transparently stored to and retrieved from an underlying datastore. With JDO, methods are invoked on persistent object by an application, as per any regular in-memory Java object.&lt;br /&gt;&lt;br /&gt;JDO has many implementations. Visit the following link to know about the available implementations.&lt;br /&gt;&lt;br /&gt;http://db.apache.org/jdo/impls.html</content><link rel='replies' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/1840715472268552530/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8479811475318271344/1840715472268552530' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/1840715472268552530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/1840715472268552530'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/2008/02/java-data-objects.html' title='Java Data Objects'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8479811475318271344.post-7988707397981453228</id><published>2008-02-07T02:11:00.000-08:00</published><updated>2008-02-21T09:52:55.739-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASCII"/><category scheme="http://www.blogger.com/atom/ns#" term="Validation characterset"/><title type='text'>valiateCharacterSetAscii</title><content type='html'>&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;The method below replaces all the non ASCII printable characters in the ArrayList provided as argument with null.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;public static ArrayList&lt;string&gt; valiateCharacterSetAscii(ArrayList&lt;string&gt;fileContents){&lt;br /&gt;   &lt;br /&gt;      ArrayList &lt;string&gt;tmpList = new ArrayList&lt;string&gt;();&lt;br /&gt;      String str = &quot;&quot;;&lt;br /&gt;   &lt;br /&gt;      for(int j=0; j &lt; str =&quot; fileContents.get(j);&quot; resultantstring = &quot;&quot; i=&quot;0;i&lt;str.length();i++){&quot; int=&quot;&quot; charcode=&quot;(int)str.charAt(i);&quot;&gt;=33 &amp;amp;&amp;amp; charCode &lt;=126)))                    resultantString += str.charAt(i);                else                    resultantString += null;        }            tmpList.add(resultantString);          }        return tmpList;    }&lt;/str.length();i++){&quot;&gt;&lt;/string&gt;&lt;/string&gt;&lt;/string&gt;&lt;/string&gt;</content><link rel='replies' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/7988707397981453228/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8479811475318271344/7988707397981453228' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/7988707397981453228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/7988707397981453228'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/2008/02/valiatecharactersetascii.html' title='valiateCharacterSetAscii'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8479811475318271344.post-6321586282510873836</id><published>2008-02-04T02:15:00.000-08:00</published><updated>2008-02-04T02:16:26.647-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="static variables"/><title type='text'>Accessing static variables</title><content type='html'>Although a static method can&#39;t access instance variables, it can access static variables. A common use of static variables is to define &quot;constants&quot;. Examples from the Java library are Math.PI or Color.RED. They are qualified with the class name, so you know they are static. Any method, static or not, can access static variables. Instance variables can be accessed only by instance methods.</content><link rel='replies' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/6321586282510873836/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8479811475318271344/6321586282510873836' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/6321586282510873836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/6321586282510873836'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/2008/02/accessing-static-variables.html' title='Accessing static variables'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8479811475318271344.post-374499554415320683</id><published>2008-02-04T01:58:00.000-08:00</published><updated>2008-02-04T02:21:32.976-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="static methods"/><title type='text'>Why declare a method static</title><content type='html'>Static methods can be called without using the class reference (object). Following are the two reasons, one can use static methods:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Documentation&lt;/b&gt; Anyone seeing that a method is static will know how to call it (see below). Similarly, any programmer looking at the code will know that a static method can&#39;t interact with instance variables, which makes reading and debugging easier.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Efficiency&lt;/b&gt; A compiler will usually produce slightly more efficient code because no implicit object parameter has to be passed to the method.</content><link rel='replies' type='application/atom+xml' href='http://javatrends.blogspot.com/feeds/374499554415320683/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8479811475318271344/374499554415320683' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/374499554415320683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8479811475318271344/posts/default/374499554415320683'/><link rel='alternate' type='text/html' href='http://javatrends.blogspot.com/2008/02/why-declare-method-static-static.html' title='Why declare a method static'/><author><name>latitude</name><uri>http://www.blogger.com/profile/02604283044345608791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu1AkdfONxV_ghmFYCetcqxbamt0pfm1ldVmbbF0qxJ67_juurwdJYKYcRUXT4oAUsGymcXmbUoFOkBiVPwDO8ctkOP1IknWo5pw1x_pMxL6V8h-f-sff1hcjtVmoyeaw/s220/100px-MartialArtsMaleIconFF7BC.jpg'/></author><thr:total>0</thr:total></entry></feed>