<?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: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-7996320144962031282</id><updated>2012-01-19T20:21:51.112-08:00</updated><category term='hidden feature'/><category term='JBoss'/><category term='WTP'/><category term='Flex builder'/><category term='java'/><category term='Eclipse'/><title type='text'>Geek2Nerd</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://geek2nerd.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996320144962031282/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://geek2nerd.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ankur Shah</name><uri>https://profiles.google.com/118404641221367641909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-W722G54otm8/AAAAAAAAAAI/AAAAAAAAAAA/XuPz8Jn4n1A/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7996320144962031282.post-7332602794078314649</id><published>2010-06-16T10:42:00.000-07:00</published><updated>2010-06-16T10:42:59.410-07:00</updated><title type='text'>Java Gotchas: Instance Variables Hiding | JAVA Developer's Journal</title><content type='html'>&lt;a href="http://java.sys-con.com/node/46344"&gt;Java Gotchas: Instance Variables Hiding | JAVA Developer's Journal&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996320144962031282-7332602794078314649?l=geek2nerd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://java.sys-con.com/node/46344' title='Java Gotchas: Instance Variables Hiding | JAVA Developer&apos;s Journal'/><link rel='replies' type='application/atom+xml' href='http://geek2nerd.blogspot.com/feeds/7332602794078314649/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996320144962031282&amp;postID=7332602794078314649' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996320144962031282/posts/default/7332602794078314649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996320144962031282/posts/default/7332602794078314649'/><link rel='alternate' type='text/html' href='http://geek2nerd.blogspot.com/2010/06/java-gotchas-instance-variables-hiding.html' title='Java Gotchas: Instance Variables Hiding | JAVA Developer&apos;s Journal'/><author><name>Ankur Shah</name><uri>https://profiles.google.com/118404641221367641909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-W722G54otm8/AAAAAAAAAAI/AAAAAAAAAAA/XuPz8Jn4n1A/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996320144962031282.post-1030622989727643396</id><published>2009-12-22T07:32:00.000-08:00</published><updated>2009-12-22T07:33:12.478-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Flex builder'/><title type='text'>How to remove flex builder licence from windows xp machine ?</title><content type='html'>&lt;span style="font: normal normal normal medium/normal 'Times New Roman'; line-height: 18px; font-family: 'Trebuchet MS', Verdana, Arial, sans-serif; font-size: 13px; " class="Apple-style-span"&gt;I recently ran into a license key issue with Flex Builder  and wanted to share my resolution to the problem.&lt;br /&gt;&lt;br /&gt;In a nutshell, I  accidentally got the Standard version instead of Pro.  I had already entered the  license key for Standard and when I went to enter the key for Pro, it balked  since it was expecting a Flex 3 Standard to Flex 3 Pro license key, but the one  I purchased was for Flex 3 Pro.&lt;br /&gt;&lt;br /&gt;I simply wanted to get back to the dialog  where I could enter the new Flex 3 Pro key.&lt;br /&gt;&lt;br /&gt;I figured out that I could  resolve my problem by first clearing the license # from my license.properties  file at:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;Windows: %ALLUSERSPROFILE%\Application  Data\Adobe\Flex\license.properties&lt;br /&gt;Mac: /Library/Application  Support/Adobe/Flex/license.properties &lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I then restarted Flex Builder and  was able to enter my new license information successfully.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996320144962031282-1030622989727643396?l=geek2nerd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geek2nerd.blogspot.com/feeds/1030622989727643396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996320144962031282&amp;postID=1030622989727643396' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996320144962031282/posts/default/1030622989727643396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996320144962031282/posts/default/1030622989727643396'/><link rel='alternate' type='text/html' href='http://geek2nerd.blogspot.com/2009/12/how-to-remove-flex-builder-licence-from.html' title='How to remove flex builder licence from windows xp machine ?'/><author><name>Ankur Shah</name><uri>https://profiles.google.com/118404641221367641909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-W722G54otm8/AAAAAAAAAAI/AAAAAAAAAAA/XuPz8Jn4n1A/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996320144962031282.post-6868291926950523412</id><published>2009-12-22T07:27:00.000-08:00</published><updated>2009-12-22T07:28:47.527-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><category scheme='http://www.blogger.com/atom/ns#' term='WTP'/><title type='text'>Bug in Eclipse 3.3 with WTP 2.0.x</title><content type='html'>&lt;div&gt;I had just got the flex builder 3.0 licence. So I am trying to install Flex  builder as Eclipse plugin (because if I install Flex builder as eclipse plugin  then I can work on java project as well as flex project). Since Flex Builder 3.0  works on Eclipse 3.2 or 3.3 only, I had choosen Eclipse 3.3 (more is better :)).  My Eclipse 3.3 contains WTP plugin also (WTP 2.0.2). Once I completed Flex  Builder installation I had created Dynamic web project which can deploy as war  (without EAR support). I had created a server with JBoss 4.2.x mappings.  Previously in Eclipse 3.5 my war was successfully deployed on JBoss 4.2.x  server. But in Eclipse 3.3 when I am trying to deploy same war file then it is  giving deployement error like &lt;strong&gt;&lt;em&gt;"NullPointerException "Could not  publish to Server" from Eclipse".&lt;/em&gt;&lt;/strong&gt; After googleing for few hours I  had found there is bug in Eclipse 3.3(Europa) with WTP 2.0.x.&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=219627"&gt;https://bugs.eclipse.org/bugs/show_bug.cgi?id=219627&lt;/a&gt;&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;So simple solution to this problem is try to deploy your application as ear  instead of war. It will work. Other solution is upgrade your WTP with 2.1.x  version.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996320144962031282-6868291926950523412?l=geek2nerd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geek2nerd.blogspot.com/feeds/6868291926950523412/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996320144962031282&amp;postID=6868291926950523412' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996320144962031282/posts/default/6868291926950523412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996320144962031282/posts/default/6868291926950523412'/><link rel='alternate' type='text/html' href='http://geek2nerd.blogspot.com/2009/12/bug-in-eclipse-33-with-wtp-20x.html' title='Bug in Eclipse 3.3 with WTP 2.0.x'/><author><name>Ankur Shah</name><uri>https://profiles.google.com/118404641221367641909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-W722G54otm8/AAAAAAAAAAI/AAAAAAAAAAA/XuPz8Jn4n1A/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996320144962031282.post-7729262623541900844</id><published>2009-06-07T23:21:00.000-07:00</published><updated>2009-06-07T23:28:50.794-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='hidden feature'/><title type='text'>Hidden (Less used) features of java</title><content type='html'>&lt;div&gt;&lt;b&gt;1) &lt;/b&gt;&lt;/div&gt;&lt;div&gt;Source code URLs. E.g. here is some legal java source code:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;http://google.com&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;(Yes, it was in Java Puzzlers. I laughed...)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;2)&lt;/b&gt;&lt;/div&gt;&lt;div&gt;"&lt;b&gt;const&lt;/b&gt;" is a keyword, but you can't use it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;int const = 1;   // "not a statement"&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;const int i = 1; // "illegal start of expression"&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;I guess the compiler writers thought it might be used in the future and they'd better keep it reserved.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;3)&lt;/b&gt;&lt;/div&gt;&lt;div&gt;The value of:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;new URL("http://www.yahoo.com").equals(new URL("http://209.191.93.52"))&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;is true.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;4)&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Instances of the same class can access private members of other instances:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;class Thing {&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;  private int x;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;  public int addThings(Thing t2) {&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;    return this.x + t2.x;  // Can access t2's private value!&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;  }&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;}&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;5)&lt;/b&gt;&lt;/div&gt;&lt;div&gt;I was surprised by instance initializers the other day:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;public class Foo {&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;    public Foo() { System.out.println("constructor called"); }&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;    static { System.out.println("static initializer called"); }&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;    { System.out.println("instance initializer called"); }&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;}&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Executing the following code&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;new Foo();&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;new Foo();&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;will display:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;static initializer called&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;instance initializer called&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;constructor called&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;instance initializer called&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;constructor called&lt;/b&gt;&lt;/div&gt;&lt;div&gt;I guess these would be useful if you had multiple constructors and needed common code?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;6)&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Transfer of control in a finally block throws away any exception. The following code does not throw RuntimeException -- it is lost.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;public static void doSomething() {     &lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;    try {       //Normally you would have code that doesn't explicitly appear        //to throw exceptions so it would be harder to see the problem.      &lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;        throw new RuntimeException();    &lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;    } finally {       &lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;        return;     &lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;    }   &lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;} &lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;From http://jamesjava.blogspot.com/2006/03/dont-return-in-finally-clause.html&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;7)&lt;/b&gt;&lt;/div&gt;&lt;div&gt;A couple of people have posted about instance initializers, here's a good use for it:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;Map map = new HashMap() {{&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;    put("a key", "a value");&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;    put("another key", "another value");&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;}};&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Is a quick way to initialize maps if you're just doing something quick and simple.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Or using it to create a quick swing frame prototype:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;JFrame frame = new JFrame();&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;JPanel panel = new JPanel();&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;panel.add( new JLabel("Hey there"){{&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;    setBackground(Color.black);&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;    setForeground( COlor.white);&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;}});&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;panel.add( new JButton("Ok"){{&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;    addActionListener( new ActionListener(){&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;        public void actionPerformed( ActionEvent ae ){&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;            System.out.println("Button pushed");&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;        }&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;     });&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt; }});&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt; frame.add( panel );&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;Of course it can be abused:&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;    JFrame frame = new JFrame(){{&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;         add( new JPanel(){{&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;               add( new JLabel("Hey there"){{&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;                    setBackground(Color.black);&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;                    setForeground( Color.white);&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;                }});&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;                add( new JButton("Ok"){{&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;                    addActionListener( new ActionListener(){&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;                        public void actionPerformed( ActionEvent ae ){&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;                            System.out.println("Button pushed");&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;                        }&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;                     });&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;                 }});&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;        }});&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;    }};&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;8)&lt;/b&gt;&lt;/div&gt;&lt;div&gt;This is not exactly "hidden features" and not very useful, but can be extremely interesting in some cases:&lt;/div&gt;&lt;div&gt;Class sun.misc.Unsafe - will allow you to implement direct memory management in Java (you can even write self-modifying Java code with this if you try a lot):&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;public class UnsafeUtil {&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;    public static Unsafe unsafe;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;    private static long fieldOffset;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;    private static UnsafeUtil instance = new UnsafeUtil();&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;    private Object obj;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;    static {&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;        try {&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;                Field f = Unsafe.class.getDeclaredField("theUnsafe");&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;                f.setAccessible(true);&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;                unsafe = (Unsafe)f.get(null);&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;                fieldOffset = unsafe.objectFieldOffset(UnsafeUtil.class.getDeclaredField("obj"));&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;        } catch (Exception e) {&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;                throw new RuntimeException(e);&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;        }&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;    };&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;}&lt;/i&gt;&lt;/b&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;b&gt;&lt;i&gt;  &lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;9)&lt;/b&gt;&lt;/div&gt;&lt;div&gt;You can declare a class in a method:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;public Foo foo(String in) {&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;    class FooFormat extends Format {&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;        public Object parse(String s, ParsePosition pp) { // parse stuff }&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;    }&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;    return (Foo) new FooFormat().parse(in);&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;}&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996320144962031282-7729262623541900844?l=geek2nerd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geek2nerd.blogspot.com/feeds/7729262623541900844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996320144962031282&amp;postID=7729262623541900844' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996320144962031282/posts/default/7729262623541900844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996320144962031282/posts/default/7729262623541900844'/><link rel='alternate' type='text/html' href='http://geek2nerd.blogspot.com/2009/06/1-source-code-urls.html' title='Hidden (Less used) features of java'/><author><name>Ankur Shah</name><uri>https://profiles.google.com/118404641221367641909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-W722G54otm8/AAAAAAAAAAI/AAAAAAAAAAA/XuPz8Jn4n1A/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996320144962031282.post-3626290125423783763</id><published>2008-12-24T00:57:00.000-08:00</published><updated>2008-12-24T01:03:50.576-08:00</updated><title type='text'></title><content type='html'>I became google addict now. Using iGoogle, Google Calendar, Google Docs and newly entrant Google SMS Channel. We are becoming technology slave.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996320144962031282-3626290125423783763?l=geek2nerd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geek2nerd.blogspot.com/feeds/3626290125423783763/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996320144962031282&amp;postID=3626290125423783763' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996320144962031282/posts/default/3626290125423783763'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996320144962031282/posts/default/3626290125423783763'/><link rel='alternate' type='text/html' href='http://geek2nerd.blogspot.com/2008/12/i-became-google-addict-now.html' title=''/><author><name>Ankur Shah</name><uri>https://profiles.google.com/118404641221367641909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-W722G54otm8/AAAAAAAAAAI/AAAAAAAAAAA/XuPz8Jn4n1A/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996320144962031282.post-5308998123628266197</id><published>2008-11-21T04:43:00.000-08:00</published><updated>2008-11-21T04:44:40.169-08:00</updated><title type='text'>Some more books</title><content type='html'>&lt;a href="http://ankurpshah.googlepages.com/google-guice-agile-lightweight-depen.pdf"&gt;Google Guice Book&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://ankurpshah.googlepages.com/wicket-in-action.9781932394986.32046.pdf"&gt;Wicket in Action&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996320144962031282-5308998123628266197?l=geek2nerd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geek2nerd.blogspot.com/feeds/5308998123628266197/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996320144962031282&amp;postID=5308998123628266197' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996320144962031282/posts/default/5308998123628266197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996320144962031282/posts/default/5308998123628266197'/><link rel='alternate' type='text/html' href='http://geek2nerd.blogspot.com/2008/11/some-more-books.html' title='Some more books'/><author><name>Ankur Shah</name><uri>https://profiles.google.com/118404641221367641909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-W722G54otm8/AAAAAAAAAAI/AAAAAAAAAAA/XuPz8Jn4n1A/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996320144962031282.post-705645208220151959</id><published>2008-11-04T05:52:00.000-08:00</published><updated>2008-11-04T06:05:17.958-08:00</updated><title type='text'>Good Books</title><content type='html'>&lt;div&gt;Java :&lt;/div&gt;&lt;a href="http://ankurpshah.googlepages.com/java-secrets.9780764580079.26193.pdf"&gt;Java Secrets&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Excellent Sql Book:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://ankurpshah.googlepages.com/joe-celkos-sql-puzzles-and-answers-s.pdf"&gt;Sql Puzzles&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996320144962031282-705645208220151959?l=geek2nerd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geek2nerd.blogspot.com/feeds/705645208220151959/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996320144962031282&amp;postID=705645208220151959' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996320144962031282/posts/default/705645208220151959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996320144962031282/posts/default/705645208220151959'/><link rel='alternate' type='text/html' href='http://geek2nerd.blogspot.com/2008/11/good-java-books.html' title='Good Books'/><author><name>Ankur Shah</name><uri>https://profiles.google.com/118404641221367641909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-W722G54otm8/AAAAAAAAAAI/AAAAAAAAAAA/XuPz8Jn4n1A/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7996320144962031282.post-6033952707738295447</id><published>2008-07-30T06:51:00.000-07:00</published><updated>2008-07-30T06:53:08.905-07:00</updated><title type='text'>Web Based GroovyShell</title><content type='html'>My affection to groovy leads to my first contribution towards groovy.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://docs.codehaus.org/display/GROOVY/Web+based+GroovyShell"&gt;Web Based Groovy Shell&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7996320144962031282-6033952707738295447?l=geek2nerd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geek2nerd.blogspot.com/feeds/6033952707738295447/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7996320144962031282&amp;postID=6033952707738295447' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7996320144962031282/posts/default/6033952707738295447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7996320144962031282/posts/default/6033952707738295447'/><link rel='alternate' type='text/html' href='http://geek2nerd.blogspot.com/2008/07/web-based-groovyshell.html' title='Web Based GroovyShell'/><author><name>Ankur Shah</name><uri>https://profiles.google.com/118404641221367641909</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-W722G54otm8/AAAAAAAAAAI/AAAAAAAAAAA/XuPz8Jn4n1A/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry></feed>
