<?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-4222470038436652131</id><updated>2011-11-27T16:07:27.135-08:00</updated><title type='text'>Program..Ram..0..1..Computer..Java..</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://infotechram.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222470038436652131/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://infotechram.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Sriram</name><uri>http://www.blogger.com/profile/08608378191882381729</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2507/2040/200/sree1.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4222470038436652131.post-8675580669317273959</id><published>2009-08-28T00:19:00.000-07:00</published><updated>2009-08-28T01:18:59.166-07:00</updated><title type='text'>Java is portable not its JVM</title><content type='html'>"Java is portable" has become the ubiquitous quote in the technological world and this is one of the reasons for the popularity of Java. &lt;br /&gt;&lt;br /&gt;But what is the logic behind its portability. It is simple. There is a JVM - Java virtual machine ,  which will convert the java byte code into native code. &lt;br /&gt;&lt;br /&gt;So Code is compiled into a byte code which is architecturally neutral and this code is then converted to machine((OS) dependent code by the JVM specific to the OS.&lt;br /&gt;&lt;br /&gt;Thats smart is not it. Write once Run Everywhere .....&lt;br /&gt;&lt;br /&gt;JVM is basically an interpreter that interprets the class files and is different for different OS.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4222470038436652131-8675580669317273959?l=infotechram.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://infotechram.blogspot.com/feeds/8675580669317273959/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4222470038436652131&amp;postID=8675580669317273959' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222470038436652131/posts/default/8675580669317273959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222470038436652131/posts/default/8675580669317273959'/><link rel='alternate' type='text/html' href='http://infotechram.blogspot.com/2009/08/java-is-portable-not-its-jvm.html' title='Java is portable not its JVM'/><author><name>Sriram</name><uri>http://www.blogger.com/profile/08608378191882381729</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2507/2040/200/sree1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4222470038436652131.post-449635930680326084</id><published>2008-01-22T01:53:00.001-08:00</published><updated>2008-01-22T01:53:22.387-08:00</updated><title type='text'>Servlet Constructors</title><content type='html'>Very often Java programmers are thrashed with this rather awkward question "Can you have Constructors inside Servlets"..in the interviews and when the prospective bride in this case the person facing interview blushes the prospective bride groom in this case the interviewer is overcome with a sense of sadistic smile displaying itself uglyly on his face..... Comeon do you really use Servlets in first place after the very cuter younger brother of servlets "The JSPs" have come or if at all you are among those nerds who still prefer to use Serlvets would you at the least be bothered if Servlets have constructors or not.&lt;br /&gt;&lt;br /&gt;      Anyways lets get into the center of the topic the much out of use Servlet constructor . The answer for this is &lt;span style="font-weight: bold;"&gt;"Yes we can have constructors inside Servlets"&lt;/span&gt; bingo you that .Thats such a simple issue and as usual thats not as simple as it looks like... You can have a constructor as long as the constructor has the access type &lt;span style="font-weight: bold;"&gt;public&lt;/span&gt; and there are no arguments for it. Any other access type would &lt;span style="font-weight: bold;"&gt;simply throw an exception&lt;/span&gt; when the server runs and you call the servlet. And saddest of the sad part is that one of my interviewers actually argued with me that there is no such thing as Servlet constructor. This is by default usually inserted into the Servlet and the default servlet Constructor has an assess type of &lt;span style="font-weight: bold;"&gt;public&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Ex For how a &lt;span style="font-weight: bold;"&gt;Servlet constructor&lt;/span&gt; would look like&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;  &lt;br /&gt;         public HelloWorld(){&lt;br /&gt;                super(); &lt;br /&gt;  }&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;      Now in the first place why in the hell do we need that public Constructor when as any novice to the Servlets would put to you that &lt;span style="font-style: italic;"&gt; "The container calls the init() method. This method initializes the servlet and must be called before the servlet can service any requests. In the entire life of a servlet, the init() method is called only once."&lt;/span&gt; and that means all initialization happens in this method." The blame squarely is on the container for not allowing us to play with the Constructors of the  servlets we would be writing. &lt;br /&gt;&lt;br /&gt;      This, in my perspective is to stop the user from fussing with the initialization and instantiuation of the servlets. The init() method has access to the &lt;span style="font-weight: bold;"&gt;"ServletConfig"&lt;/span&gt; object in the servlet and as i have already mentioned there are &lt;span style="font-weight: bold;"&gt;no arguments&lt;/span&gt; for a servlet constructor. Hence init() methods score over the constructors here. The servlet container however allows a public no argument constructor as it is mandatory for any object created in java to have a constructor if it is not an interface and thereby limits the coder/programmer from scrubbing the code to what ever he has in the mind. Well that might be a vaguer explanation. Moreover from this constructor the super constructor - that is the &lt;span style="font-weight: bold;"&gt;HttpServlet&lt;/span&gt; constructor is also called at.&lt;br /&gt;&lt;br /&gt;      Hope this one has been a small eye opener on Servlet constructors. Will add more articles on Java related topics in days to come. Till then scrub your hair, laugh a lot or do what ever you wanna do but keep coming back to my blog whenever you think of JAVA as more Java gyaan will be explored.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold; color: rgb(204, 102, 204);"&gt;&lt;span style="font-style: italic;"&gt;&lt;align="center"&gt;"JAVA Beans" and "COFFEE Beans" have one thing in common apart from beans in their spelling :: "Both are bitter but are addictive"&lt;/align="center"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4222470038436652131-449635930680326084?l=infotechram.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://infotechram.blogspot.com/feeds/449635930680326084/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4222470038436652131&amp;postID=449635930680326084' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4222470038436652131/posts/default/449635930680326084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4222470038436652131/posts/default/449635930680326084'/><link rel='alternate' type='text/html' href='http://infotechram.blogspot.com/2008/01/servlet-constructors.html' title='Servlet Constructors'/><author><name>Sriram</name><uri>http://www.blogger.com/profile/08608378191882381729</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://photos1.blogger.com/blogger2/2507/2040/200/sree1.jpg'/></author><thr:total>0</thr:total></entry></feed>
