<?xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"><channel><title>JAVA Interview Questions</title><description>advanced JAVA interview questions, j2ee interview questions, java tutorial, Core Java Job Interview Questions, JAVA, JSP, SERVLETS, EJB, STRUTS, XML, ANT, LOG4J, WEBLOGIC, Interview questions for different java technologies like Core Java, JSP, servlets, EJB, JMS&lt; JNDI, JMS</description><managingEditor>noreply@blogger.com (jon)</managingEditor><pubDate>Fri, 30 Aug 2024 12:00:04 -0700</pubDate><generator>Blogger http://www.blogger.com</generator><openSearch:totalResults xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">253</openSearch:totalResults><openSearch:startIndex xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">1</openSearch:startIndex><openSearch:itemsPerPage xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">25</openSearch:itemsPerPage><link>http://java-papers.blogspot.com/</link><language>en-us</language><itunes:explicit>no</itunes:explicit><itunes:subtitle>advanced JAVA interview questions, j2ee interview questions, java tutorial, Core Java Job Interview Questions, JAVA, JSP, SERVLETS, EJB, STRUTS, XML, ANT, LOG4J, WEBLOGIC, Interview questions for different java technologies like Core Java, JSP, servlets, </itunes:subtitle><itunes:category text="Technology"><itunes:category text="Gadgets"/></itunes:category><itunes:owner><itunes:email>noreply@blogger.com</itunes:email></itunes:owner><item><title>What is Overriding?</title><link>http://java-papers.blogspot.com/2008/03/what-is-overriding.html</link><category>Java Questions</category><author>noreply@blogger.com (jon)</author><pubDate>Thu, 6 Mar 2008 09:33:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4685305606629949031.post-6432902623053004094</guid><description>&lt;span class="fullpost"&gt;&lt;br /&gt;When a class defines a method using the same name, return type, and arguments as a method in its superclass, the method in the class overrides the method in the superclass.&lt;br /&gt;&lt;br /&gt;When the method is invoked for an object of the class, it is the new definition of the method that is called, and not the method definition from superclass. Methods may be overridden to be more public, not more private. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>Top Java Questions</title><link>http://java-papers.blogspot.com/2008/03/top-java-questions.html</link><category>Java Questions</category><author>noreply@blogger.com (jon)</author><pubDate>Thu, 6 Mar 2008 09:31:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4685305606629949031.post-3116856551769111020</guid><description>&lt;span class="fullpost"&gt;&lt;br /&gt;&lt;p lohuf="1" eaggd="0"&gt;&lt;strong lohuf="0" eaggd="0"&gt;What restrictions are placed  on method overloading?&lt;/strong&gt;Two methods may not have the same name and  argument list but different return types.&lt;/p&gt; &lt;p&gt;&lt;strong lohuf="0" eaggd="0"&gt;What is the difference between String and  StringBuffer?&lt;/strong&gt;&lt;/p&gt; &lt;p lohuf="0" eaggd="0"&gt;String objects are immutable whereas StringBuffer objects  are not. StringBuffer unlike Strings support growable and modifiable  strings.&lt;/p&gt; &lt;p&gt;&lt;strong lohuf="0" eaggd="0"&gt;Can a private method of a superclass be declared  within a subclass?&lt;/strong&gt;&lt;/p&gt; &lt;p lohuf="2" eaggd="0"&gt;Sure. A private field or method or inner class belongs to  its declared class and hides from its subclasses.&lt;br /&gt;There is no way for private  stuff to have a runtime overloading or overriding (polymorphism) features.&lt;/p&gt; &lt;p&gt;&lt;strong lohuf="0" eaggd="0"&gt;What is the default value of an object reference  declared as an instance variable?&lt;/strong&gt;&lt;/p&gt; &lt;p lohuf="0" eaggd="0"&gt;null unless we define it explicitly.&lt;/p&gt; &lt;p&gt;&lt;strong lohuf="0" eaggd="0"&gt;What is the difference between a constructor and  a method?&lt;/strong&gt;&lt;/p&gt; &lt;p lohuf="0" eaggd="0"&gt;A constructor is a member function of a class that is  used to create objects of that class, invoked using the new operator. It has the  same name as the class and has no return type. They are only called once,  whereas member functions can be called many times. A method is an ordinary  member function of a class. It has its own name, a return type (which may be  void), and is invoked using the dot operator. Constructor will be automatically  invoked when an object is created whereas method has to be called  explicitly.&lt;/p&gt; &lt;p lohuf="0" eaggd="0"&gt;super.method(); is used to call a super class method from  a sub class. To call a constructor of the super class, we use the super();  statement as the first line of the subclass’s constructor.&lt;/p&gt; &lt;p&gt;&lt;strong lohuf="0" eaggd="0"&gt;Can a top-level class be private or  protected?&lt;/strong&gt;&lt;/p&gt; &lt;p lohuf="0" eaggd="0"&gt;No. A top-level class cannot be private or protected. It  can have either “public” or no modifier. If it does not have a modifier it is  supposed to have a default access. If a top level class is declared as  private/protected the compiler will complain that the “modifier private is not  allowed here”.&lt;/p&gt; &lt;p&gt;&lt;strong lohuf="0" eaggd="0"&gt;Why &lt;span class="kLink" style="position: static; text-decoration: underline ! important;"&gt;&lt;span style="font-weight: 700; color: red ! important; font-family: Georgia,serif; position: static;color:red;" &gt;&lt;span class="kLink" style="font-weight: 700; color: red ! important; font-family: Georgia,serif; position: relative;"&gt;Java&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;  does not support multiple inheritance? &lt;/strong&gt;&lt;/p&gt; &lt;p lohuf="0" eaggd="0"&gt;Java does support multiple inheritance via interface  implementation.&lt;/p&gt; &lt;p&gt;&lt;strong lohuf="0" eaggd="0"&gt;Where and how can you use a private  constructor?&lt;/strong&gt;&lt;/p&gt; &lt;p lohuf="0" eaggd="0"&gt;Private constructor can be used if you do not want any  other class to instantiate the class. This concept is generally used in  Singleton &lt;span class="kLink" style="position: static; text-decoration: underline ! important;"&gt;&lt;span style="font-weight: 400; color: red ! important; font-family: Georgia,serif; position: static;color:red;" &gt;&lt;span class="kLink" style="font-weight: 400; color: red ! important; font-family: Georgia,serif; position: relative;"&gt;Design  &lt;/span&gt;&lt;span class="kLink" style="font-weight: 400; color: red ! important; font-family: Georgia,serif; position: relative;"&gt;Pattern&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;.  The instantiation of such classes is done from a static public method.&lt;/p&gt; &lt;p&gt;&lt;strong lohuf="0" eaggd="0"&gt;How are this() and super() used with  constructors?&lt;/strong&gt;&lt;/p&gt; &lt;p lohuf="0" eaggd="0"&gt;this() is used to invoke a constructor of the same class.  super() is used to invoke a superclass constructor.&lt;/p&gt; &lt;p&gt;&lt;strong lohuf="0" eaggd="0"&gt;What is Method Overriding? What restrictions are  placed on method overriding?&lt;/strong&gt;&lt;/p&gt; &lt;p lohuf="10" eaggd="0"&gt;When a class defines a method using the same name,  return type, and argument list as that of a method in its superclass, the method  in the subclass is said to override the method present in the Superclass. When  the method is invoked for an object of the&lt;br /&gt;class, it is the new definition of  the method that is called, and not the method definition from  superclass.&lt;br /&gt;&lt;span class="style7" lohuf="0" eaggd="0"&gt;Restrictions placed on  method overriding&lt;/span&gt;&lt;br /&gt;• Overridden methods must have the same name,  argument list, and return type.&lt;br /&gt;• The overriding method may not limit the  access of the method it overrides. Methods may be overridden to be more public,  not more private.&lt;br /&gt;• The overriding method may not throw any exceptions that  may not be thrown by the overridden method.&lt;/p&gt; &lt;p&gt;&lt;strong lohuf="0" eaggd="0"&gt;What are the Object and Class classes used for?  Which class should you use to obtain &lt;span class="kLink" style="position: static; text-decoration: underline ! important;"&gt;&lt;span style="font-weight: 700; color: red ! important; font-family: Georgia,serif; position: static;color:red;" &gt;&lt;span class="kLink" style="font-weight: 700; color: red ! important; font-family: Georgia,serif; position: relative;"&gt;design  &lt;/span&gt;&lt;span class="kLink" style="font-weight: 700; color: red ! important; font-family: Georgia,serif; position: relative;"&gt;information&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;  about an object?&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong lohuf="0" eaggd="0"&gt;Differentiate between a Class and an  Object?&lt;/strong&gt;&lt;/p&gt; &lt;p lohuf="0" eaggd="0"&gt;The Object class is the highest-level class in the Java  class hierarchy. The Class class is used to represent the classes and interfaces  that are loaded by a &lt;span class="kLink" style="position: static; text-decoration: underline ! important;"&gt;&lt;span style="font-weight: 400; color: red ! important; font-family: Georgia,serif; position: static;color:red;" &gt;&lt;span class="kLink" style="font-weight: 400; color: red ! important; font-family: Georgia,serif; position: relative;"&gt;Java  &lt;/span&gt;&lt;span class="kLink" style="font-weight: 400; color: red ! important; font-family: Georgia,serif; position: relative;"&gt;program&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;.  The Class class is used to obtain information about an object’s design. A Class  is only a definition or prototype of real life object. Whereas an object is an  instance or living representation of real life object. Every object belongs to a  class and every class contains one or more related objects.&lt;/p&gt; &lt;p&gt;&lt;strong lohuf="0" eaggd="0"&gt;What is a singleton class?&lt;/strong&gt;&lt;/p&gt; &lt;p lohuf="0" eaggd="0"&gt;This design pattern is used by an application to ensure  that at any time there is only one instance of a class created. You can achieve  this by having the private constructor in the class and having a getter method  which returns an object of the class and creates one for the first time if its  null.&lt;strong lohuf="0" eaggd="0"&gt;What is method overloading and method  overriding?&lt;/strong&gt;&lt;/p&gt; &lt;p lohuf="1" eaggd="0"&gt;&lt;span class="style7" lohuf="0" eaggd="0"&gt;Method  overloading:&lt;/span&gt; When 2 or more methods in a class have the same method names  with different arguments, it is said to be method overloading. Overloading does  not block inheritance from the superclass. Overloaded methods must have  different method signatures&lt;/p&gt; &lt;p lohuf="3" eaggd="0"&gt;&lt;span class="style7" lohuf="0" eaggd="0"&gt;Method overriding  :&lt;/span&gt; When a method in a class has the same method name with same arguments  as that of the superclass,&lt;br /&gt;it is said to be method overriding. Overriding  blocks inheritance from the superclass. Overridden methods must have same  signature.&lt;/p&gt; &lt;p lohuf="0" eaggd="0"&gt;Basically overloading and overriding are different  aspects of polymorphism.&lt;/p&gt; &lt;p lohuf="3" eaggd="0"&gt;static/early binding polymorphism: &lt;strong lohuf="0" eaggd="0"&gt;overloading&lt;/strong&gt;&lt;br /&gt;dynamic/late binding polymorphism: &lt;strong lohuf="0" eaggd="0"&gt;overriding&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong lohuf="0" eaggd="0"&gt;If a class is declared without any access  modifiers, where may the class be accessed?&lt;/strong&gt;&lt;/p&gt; &lt;p lohuf="0" eaggd="0"&gt;A class that is declared without any access modifiers is  said to have package or default access. This means that the class can only be  accessed by other classes and interfaces that are defined within the same  package.&lt;/p&gt; &lt;p&gt;&lt;strong lohuf="0" eaggd="0"&gt;Does a class inherit the constructors of its  superclass?&lt;/strong&gt;&lt;/p&gt; &lt;p lohuf="0" eaggd="0"&gt;A class does not inherit constructors from any of its  super classes.&lt;/p&gt; &lt;p&gt;&lt;strong lohuf="0" eaggd="0"&gt;Which java.util classes and interfaces support &lt;span class="kLink" style="position: static; text-decoration: underline ! important;"&gt;&lt;span style="font-weight: 700; color: red ! important; font-family: Georgia,serif; position: static;color:red;" &gt;&lt;span class="kLink" style="font-weight: 700; color: red ! important; font-family: Georgia,serif; position: relative;"&gt;event  &lt;/span&gt;&lt;span class="kLink" style="font-weight: 700; color: red ! important; font-family: Georgia,serif; position: relative;"&gt;handling&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;?&lt;/strong&gt;&lt;/p&gt; &lt;p lohuf="0" eaggd="0"&gt;The EventObject class and the EventListener interface  support event processing&lt;/p&gt; &lt;p&gt;&lt;strong lohuf="0" eaggd="0"&gt;Can an object’s finalize() method be invoked  while it is reachable?&lt;/strong&gt;&lt;/p&gt; &lt;p lohuf="0" eaggd="0"&gt;An object’s finalize() method cannot be invoked by the  garbage collector while the object is still reachable. However, an object’s  finalize() method may be invoked by other objects.&lt;/p&gt; &lt;p&gt;&lt;strong lohuf="0" eaggd="0"&gt;What is the purpose of the Runtime  class?&lt;/strong&gt;&lt;/p&gt; &lt;p lohuf="0" eaggd="0"&gt;The purpose of the Runtime class is to provide access to  the Java runtime system.&lt;/p&gt; &lt;p lohuf="0" eaggd="0"&gt;It returns the runtime information like memory  availability.&lt;/p&gt; &lt;p lohuf="4" eaggd="0"&gt;* Runtime.freeMemory() –&gt; Returns &lt;span class="kLink" style="position: static; text-decoration: underline ! important;"&gt;&lt;span style="font-weight: 400; color: red ! important; font-family: Georgia,serif; position: static;color:red;" &gt;&lt;span class="kLink" style="font-weight: 400; color: red ! important; font-family: Georgia,serif; position: relative;"&gt;JVM&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;  Free Memory&lt;br /&gt;* Runtime.maxMemory() –&gt; Returns the maximum amount of memory  that the JVM will attempt to use. It also helps to run the garbage  collector&lt;br /&gt;* Runtime.gc()&lt;/p&gt; &lt;p&gt;&lt;strong lohuf="0" eaggd="0"&gt;What is the purpose of the System  class?&lt;/strong&gt;&lt;/p&gt; &lt;p lohuf="0" eaggd="0"&gt;The purpose of the System class is to provide access to  system resources.&lt;/p&gt; &lt;p&gt;&lt;strong lohuf="0" eaggd="0"&gt;Can an unreachable object become reachable  again?&lt;/strong&gt;&lt;/p&gt; &lt;p lohuf="0" eaggd="0"&gt;An unreachable object may become reachable again. This  can happen when the object’s finalize() method is invoked and the object  performs an operation which causes it to become accessible to reachable  object.&lt;/p&gt; &lt;p&gt;&lt;strong lohuf="0" eaggd="0"&gt;What is a bean? Where can it be  used?&lt;/strong&gt;&lt;/p&gt; &lt;p lohuf="0" eaggd="0"&gt;A Bean is a reusable and self-contained &lt;span class="kLink" style="position: static; text-decoration: underline ! important;"&gt;&lt;span style="font-weight: 400; color: red ! important; font-family: Georgia,serif; position: static;color:red;" &gt;&lt;span class="kLink" style="font-weight: 400; color: red ! important; font-family: Georgia,serif; position: relative;"&gt;software&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;  component. Beans created using java take advantage of all the security and  platform independent features of java. Bean can be plugged into any software  application. Bean is a simple class which has set and get methods. It could be  used within a &lt;span class="kLink" style="position: static; text-decoration: underline ! important;"&gt;&lt;span style="font-weight: 400; color: red ! important; font-family: Georgia,serif; position: static;color:red;" &gt;&lt;span class="kLink" style="font-weight: 400; color: red ! important; font-family: Georgia,serif; position: relative;"&gt;JSP&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;  using JSP tags to use them.&lt;/p&gt; &lt;p lohuf="2" eaggd="0"&gt;&lt;strong lohuf="0" eaggd="0"&gt;What is the functionality of  instanceOf() ?&lt;/strong&gt;&lt;br /&gt;instanceOf opertaor is used to check whether an  object can be cast to a specific type without throwing ClassCastException.&lt;/p&gt; &lt;p&gt;&lt;strong lohuf="0" eaggd="0"&gt;What would happen if you say this =  null?&lt;/strong&gt;&lt;/p&gt; &lt;p lohuf="0" eaggd="0"&gt;It will come up with Error Message&lt;/p&gt; &lt;p lohuf="0" eaggd="0"&gt;“The left-hand side of an assignment must be a variable”.  &lt;/p&gt;&lt;br /&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total></item><item><title>Java EE,Open Source,Advanced Technologies Interview Questions</title><link>http://java-papers.blogspot.com/2008/03/java-eeopen-sourceadvanced-technologies.html</link><category>Java Questions</category><author>noreply@blogger.com (jon)</author><pubDate>Thu, 6 Mar 2008 09:29:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4685305606629949031.post-564599179479291042</guid><description>&lt;span class="fullpost"&gt;&lt;br /&gt;Java EE technologies(erstwhile J2EE).Apart from Java EE, I will also be covering interview questions on most widely used open source technologies like Struts,Hibernate,Spring and Velocity and more.&lt;br /&gt;&lt;br /&gt;I have constantly been asked by my readers to put something on personal interview questions, consequently, you may like to read my post on personal interview questions prior talking about Java Enterprise Edition.&lt;br /&gt;&lt;br /&gt;Sun Microsystems introduced Java EE 5 specification under JSR 244 and the final release was made public on May ,2006.Java EE has become a cornerstone technology for enterprise level web based solution development.It has more than three million downloads and more than twenty six vendors' application servers support this specification.I believe,it is significant to go through an introduction of Java EE 5 before jumping to questions list straightaway.You can capture essence of Java EE 5 here.&lt;br /&gt;&lt;br /&gt;If you directly want to access Master List of Java EE Interview Questions(Release II) then click here.&lt;br /&gt;&lt;br /&gt;The list of questions on various topics covered under Java EE hood is as follows(on the basis of different technologies covered under Java EE umbrella) :&lt;br /&gt;&lt;br /&gt;Java EE 5(Click To Access Questions' List)&lt;br /&gt;Java Servlets&lt;br /&gt;Java Server Pages and JSP Standard Tag Libraries&lt;br /&gt;Enterprise Java Beans&lt;br /&gt;Java Message Services&lt;br /&gt;Java APIs for XML Parsing&lt;br /&gt;Java Connector Architecture&lt;br /&gt;Java Mail&lt;br /&gt;Java Transaction APIs&lt;br /&gt;&lt;br /&gt;Open Source Technologies:&lt;br /&gt;Struts&lt;br /&gt;Hibernate&lt;br /&gt;Spring&lt;br /&gt;Velocity&lt;br /&gt;Apache AXIS&lt;br /&gt;Architectures:&lt;br /&gt;Service Oriented Architecture&lt;br /&gt;Others&lt;br /&gt;Java Design Patterns&lt;br /&gt;&lt;br /&gt;I am keen on listening from you all for any kind of feedback,positive or negative.Apart from technical questions,I have prepared a list of personal questions too.I have written in detail about how to approach such questions.The answers to these questions are very critical on your chances to come out with flying colors.&lt;br /&gt;&lt;br /&gt;If anyone of you has come across a very unique experience in terms of technical and personal questions asked, feel free to share your experience.&lt;br /&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Java Interview Questions</title><link>http://java-papers.blogspot.com/2008/03/java-interview-questions.html</link><category>Java Questions</category><author>noreply@blogger.com (jon)</author><pubDate>Thu, 6 Mar 2008 09:28:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4685305606629949031.post-6533623686677958086</guid><description>&lt;span class="fullpost"&gt;&lt;br /&gt;Question: What if the main method is declared as private? &lt;br /&gt;&lt;br /&gt;Question: What if the static modifier is removed from the signature of the main method? &lt;br /&gt;&lt;br /&gt;Question: What if I write static public void instead of public static void?&lt;br /&gt;&lt;br /&gt;Q:Question: What if I do not provide the String array as the argument to the method? &lt;br /&gt;&lt;br /&gt;Question: What is the first argument of the String array in main method? &lt;br /&gt;&lt;br /&gt;Question: If I do not provide any arguments on the command line, then the String array of Main method will be empty of null?&lt;br /&gt;&lt;br /&gt;Question: How can one prove that the array is not null but empty?&lt;br /&gt;&lt;br /&gt;Question: What environment variables do I need to set on my machine in order to be able to run Java programs?&lt;br /&gt;&lt;br /&gt;Question: Can an application have multiple classes having main method?&lt;br /&gt;&lt;br /&gt;Question: Can I have multiple main methods in the same class? &lt;br /&gt;&lt;br /&gt;Question: Do I need to import java.lang package any time? Why ?&lt;br /&gt;&lt;br /&gt;Question: Can I import same package/class twice? Will the JVM load the package twice at runtime?&lt;br /&gt;&lt;br /&gt;Question: What are Checked and UnChecked Exception?&lt;br /&gt;&lt;br /&gt;Question: What is Overriding? &lt;br /&gt;&lt;br /&gt;Question: What are different types of inner classes? &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What if the main method is declared as private?&lt;br /&gt;A: The program compiles properly but at runtime it will give "Main method not public." message.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What if the static modifier is removed from the signature of the main method?&lt;br /&gt;A: Program compiles. But at runtime throws an error "NoSuchMethodError". &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What if I write static public void instead of public static void?&lt;br /&gt;A: Program compiles and runs properly. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What if I do not provide the String array as the argument to the method?&lt;br /&gt;A: Program compiles but throws a runtime error "NoSuchMethodError". &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is the first argument of the String array in main method?&lt;br /&gt;A: The String array is empty. It does not have any element. This is unlike C/C++ where the first element by default is the program name.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: If I do not provide any arguments on the command line, then the String array of Main method will be empty of null?&lt;br /&gt;A: It is empty. But not null.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: How can one prove that the array is not null but empty?&lt;br /&gt;A: Print args.length. It will print 0. That means it is empty. But if it would have been null then it would have thrown a NullPointerException on attempting to print args.length.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What environment variables do I need to set on my machine in order to be able to run Java programs?&lt;br /&gt;A: CLASSPATH and PATH are the two variables.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Can an application have multiple classes having main method?&lt;br /&gt;A: Yes it is possible. While starting the application we mention the class name to be run. The JVM will look for the Main method only in the class whose name you have mentioned. Hence there is not conflict amongst the multiple classes having main method.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Can I have multiple main methods in the same class?&lt;br /&gt;A: No the program fails to compile. The compiler says that the main method is already defined in the class.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Do I need to import java.lang package any time? Why ?&lt;br /&gt;A: No. It is by default loaded internally by the JVM.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: Can I import same package/class twice? Will the JVM load the package twice at runtime?&lt;br /&gt;A: One can import the same package or same class multiple times. Neither compiler nor JVM complains abt it. And the JVM will internally load the class only once no matter how many times you import the same class.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What are Checked and UnChecked Exception?&lt;br /&gt;A: A checked exception is some subclass of Exception (or Exception itself), excluding class RuntimeException and its subclasses.&lt;br /&gt;Making an exception checked forces client programmers to deal with the possibility that the exception will be thrown. eg, IOException thrown by java.io.FileInputStream's read() method•&lt;br /&gt;Unchecked exceptions are RuntimeException and any of its subclasses. Class Error and its subclasses also are unchecked. With an unchecked exception, however, the compiler doesn't force client programmers either to catch the&lt;br /&gt;exception or declare it in a throws clause. In fact, client programmers may not even know that the exception could be thrown. eg, StringIndexOutOfBoundsException thrown by String's charAt() method• Checked exceptions must be caught at compile time. Runtime exceptions do not need to be. Errors often cannot be.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What is Overriding?&lt;br /&gt;A: When a class defines a method using the same name, return type, and arguments as a method in its superclass, the method in the class overrides the method in the superclass.&lt;br /&gt;When the method is invoked for an object of the class, it is the new definition of the method that is called, and not the method definition from superclass. Methods may be overridden to be more public, not more private. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: What are different types of inner classes?&lt;br /&gt;A: Nested -level classes, Member classes, Local classes, Anonymous classes&lt;br /&gt;Nested -level classes- If you declare a class within a class and specify the static modifier, the compiler treats the class just like any other -level class.&lt;br /&gt;Any class outside the declaring class accesses the nested class with the declaring class name acting similarly to a package. eg, outer.inner. -level inner classes implicitly have access only to static variables.There can also be inner interfaces. All of these are of the nested -level variety.&lt;br /&gt;&lt;br /&gt;Member classes - Member inner classes are just like other member methods and member variables and access to the member class is restricted, just like methods and variables. This means a public member class acts similarly to a nested -level class. The primary difference between member classes and nested -level classes is that member classes have access to the specific instance of the enclosing class.&lt;br /&gt;&lt;br /&gt;Local classes - Local classes are like local variables, specific to a block of code. Their visibility is only within the block of their declaration. In order for the class to be useful beyond the declaration block, it would need to implement a&lt;br /&gt;more publicly available interface.Because local classes are not members, the modifiers public, protected, private, and static are not usable.&lt;br /&gt;&lt;br /&gt;Anonymous classes - Anonymous inner classes extend local inner classes one level further. As anonymous classes have no name, you cannot provide a constructor&lt;br /&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Core Java Interview Questions</title><link>http://java-papers.blogspot.com/2008/03/core-java-interview-questions.html</link><category>Core Java Questions</category><author>noreply@blogger.com (jon)</author><pubDate>Thu, 6 Mar 2008 09:23:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4685305606629949031.post-1595649074341457639</guid><description>&lt;span class="fullpost"&gt;&lt;br /&gt;Every year many thousand technocrats choose Java careers across the globe,after formally taking Java training classes,courses and/or Java certifications like SCJP etc.While appearing for technical interviews,these budding Java programmers face variety of technical questions, are asked to write code snippets to prove their mettle in relevant topics of Java.They are not only assessed on language basics but also on their familiarity with Java development tools, optimization of Java code,load tests,securing code through Java obfuscation and more. It is their performance in these interviews which decides their career fate and is highly dependent on to-the-point and not too verbose answers.&lt;br /&gt;&lt;br /&gt;What prompted me to create a blog on frequently asked and and not so frequently asked tricky Java interview questions? The answer is,as I have been through various technical interviews on Java and related technologies for all my career spent with this fascinating technology so I thought of sharing these questions,code snippets etc. with all.&lt;br /&gt;&lt;br /&gt;If you want to test your hands on skills on Java programming, which I am sure most of you have additionally faced during an interview process , then betterprogrammer can help you a great extent.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Apart from technical questions, an interviewee faces a spate of personal questions as well.In my post, I tried to share my views and experience on the Personal Interview Questions.&lt;br /&gt;&lt;br /&gt;In wired world, it is very important to know where your resources are lying and how credible are they.Check out this cool widget which provides a quick access to several free online resources which you may find quite useful and handy.Anyone from my audiences is free to use widgets being posted here in one's website/blog :&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>What are synchronized methods and synchronized statements?</title><link>http://java-papers.blogspot.com/2008/02/what-are-synchronized-methods-and_26.html</link><category>Java Questions</category><author>noreply@blogger.com (jon)</author><pubDate>Tue, 26 Feb 2008 08:38:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4685305606629949031.post-7259228230250134535</guid><description>&lt;span class="fullpost"&gt;&lt;br /&gt;Synchronized methods are methods that are used to control access to an object. A thread only executes a synchronized method after it has acquired the lock for the method's object or class. Synchronized statements are similar to synchronized methods. A synchronized statement can only be executed after a thread has acquired the lock for the object or class referenced in the synchronized statement. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>What is synchronization and why is it important?</title><link>http://java-papers.blogspot.com/2008/02/what-is-synchronization-and-why-is-it_26.html</link><category>Java Questions</category><author>noreply@blogger.com (jon)</author><pubDate>Tue, 26 Feb 2008 08:38:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4685305606629949031.post-8756435607809361285</guid><description>&lt;span class="fullpost"&gt;&lt;br /&gt;With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchronization, it is possible for one thread to modify a shared object while another thread is in the process of using or updating that object's value. This often leads to significant errors.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>How are Observer and Observable used?</title><link>http://java-papers.blogspot.com/2008/02/how-are-observer-and-observable-used_26.html</link><category>Java Questions</category><author>noreply@blogger.com (jon)</author><pubDate>Tue, 26 Feb 2008 08:37:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4685305606629949031.post-5358778890976530834</guid><description>&lt;span class="fullpost"&gt;&lt;br /&gt;Objects that subclass the Observable class maintain a list of observers. When an Observable object is updated it invokes the update() method of each of its observers to notify the observers that it has changed state. The Observer interface is implemented by objects that observe Observable objects.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>What are the different ways to handle exceptions?</title><link>http://java-papers.blogspot.com/2008/02/what-are-different-ways-to-handle.html</link><category>Java Questions</category><author>noreply@blogger.com (jon)</author><pubDate>Tue, 26 Feb 2008 08:37:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4685305606629949031.post-3645394616850309167</guid><description>&lt;span class="fullpost"&gt;&lt;br /&gt;There are two ways to handle exceptions, &lt;br /&gt;1. By wrapping the desired code in a try block followed by a catch block to catch the exceptions. and &lt;br /&gt;2. List the desired exceptions in the throws clause of the method and let the caller of the method handle those exceptions. &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>What are runtime exceptions?</title><link>http://java-papers.blogspot.com/2008/02/what-are-runtime-exceptions.html</link><category>Java Questions</category><author>noreply@blogger.com (jon)</author><pubDate>Tue, 26 Feb 2008 08:37:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4685305606629949031.post-2545391552305797903</guid><description>&lt;span class="fullpost"&gt;&lt;br /&gt;Runtime exceptions are those exceptions that are thrown at runtime because of either wrong input data or because of wrong business logic etc. These are not checked by the compiler at compile time. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Why do we need wrapper classes?</title><link>http://java-papers.blogspot.com/2008/02/why-do-we-need-wrapper-classes.html</link><category>Java Questions</category><author>noreply@blogger.com (jon)</author><pubDate>Tue, 26 Feb 2008 08:36:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4685305606629949031.post-5736916986764203171</guid><description>&lt;span class="fullpost"&gt;&lt;br /&gt;It is sometimes easier to deal with primitives as objects. Moreover most of the collection classes store objects and not primitive data types. And also the wrapper classes provide many utility methods also. Because of these reasons we need wrapper classes. And since we create instances of these classes we can store them in any of the collection classes and pass them around as a collection. Also we can pass them around as method parameters where a method expects an object. &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>What is Externalizable interface?</title><link>http://java-papers.blogspot.com/2008/02/what-is-externalizable-interface.html</link><category>Java Questions</category><author>noreply@blogger.com (jon)</author><pubDate>Tue, 26 Feb 2008 08:36:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4685305606629949031.post-1358637220901906670</guid><description>&lt;span class="fullpost"&gt;&lt;br /&gt;Externalizable is an interface which contains two methods readExternal and writeExternal. These methods give you a control over the serialization mechanism. Thus if your class implements this interface, you can customize the serialization process by implementing these methods. &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>What is Session Facade pattern?</title><link>http://java-papers.blogspot.com/2008/02/what-is-session-facade-pattern.html</link><category>Java Questions</category><author>noreply@blogger.com (jon)</author><pubDate>Tue, 26 Feb 2008 08:36:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4685305606629949031.post-1271003388934745235</guid><description>&lt;span class="fullpost"&gt;&lt;br /&gt;Session facade is one design pattern that is often used while developing enterprise applications. It is implemented as a higher level component (i.e.: Session EJB), and it contains all the iteractions between low level components (i.e.: Entity EJB). It then provides a single interface for the functionality of an application or part of it, and it decouples lower level components simplifying the design. Think of a bank situation, where you have someone that would like to transfer money from one account to another. In this type of scenario, the client has to check that the user is authorized, get the status of the two accounts, check that there are enough money on the first one, and then call the transfer. The entire transfer has to be done in a single transaction otherwise is something goes south, the situation has to be restored. &lt;br /&gt;As you can see, multiple server-side objects need to be accessed and possibly modified. Multiple fine-grained invocations of Entity (or even Session) Beans add the overhead of network calls, even multiple transaction. In other words, the risk is to have a solution that has a high network overhead, high coupling, poor reusability and mantainability. &lt;br /&gt;The best solution is then to wrap all the calls inside a Session Bean, so the clients will have a single point to access (that is the session bean) that will take care of handling all the rest. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>What is Service Locator pattern?</title><link>http://java-papers.blogspot.com/2008/02/what-is-service-locator-pattern.html</link><category>Java Questions</category><author>noreply@blogger.com (jon)</author><pubDate>Tue, 26 Feb 2008 08:35:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4685305606629949031.post-151809219506834466</guid><description>&lt;span class="fullpost"&gt;&lt;br /&gt;The Service Locator pattern locates J2EE (Java 2 Platform, Enterprise Edition) services for clients and thus abstracts the complexity of network operation and J2EE service lookup as EJB (Enterprise JavaBean) Interview Questions - Home and JMS (Java Message Service) component factories. The Service Locator hides the lookup process's implementation details and complexity from clients. To improve application performance, Service Locator caches service objects to eliminate unnecessary JNDI (Java Naming and Directory Interface) activity that occurs in a lookup operation.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>What are ClassLoaders?</title><link>http://java-papers.blogspot.com/2008/02/what-are-classloaders.html</link><category>Java Questions</category><author>noreply@blogger.com (jon)</author><pubDate>Tue, 26 Feb 2008 08:35:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4685305606629949031.post-3910923642773287986</guid><description>&lt;span class="fullpost"&gt;&lt;br /&gt;A class loader is an object that is responsible for loading classes. The class ClassLoader is an abstract class. Given the name of a class, a class loader should attempt to locate or generate data that constitutes a definition for the class. A typical strategy is to transform the name into a file name and then read a "class file" of that name from a file system. &lt;br /&gt;Every Class object contains a reference to the ClassLoader that defined it. &lt;br /&gt;Class objects for array classes are not created by class loaders, but are created automatically as required by the Java runtime. The class loader for an array class, as returned by Class.getClassLoader() is the same as the class loader for its element type; if the element type is a primitive type, then the array class has no class loader. &lt;br /&gt;Applications implement subclasses of ClassLoader in order to extend the manner in which the Java virtual machine dynamically loads classes. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>What is JIT?</title><link>http://java-papers.blogspot.com/2008/02/what-is-jit.html</link><category>Java Questions</category><author>noreply@blogger.com (jon)</author><pubDate>Tue, 26 Feb 2008 08:35:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4685305606629949031.post-2201007106747995042</guid><description>&lt;span class="fullpost"&gt;&lt;br /&gt;JIT stands for Just In Time compiler. It compiles java byte code to native code.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>What is JVM?</title><link>http://java-papers.blogspot.com/2008/02/what-is-jvm.html</link><category>Java Questions</category><author>noreply@blogger.com (jon)</author><pubDate>Tue, 26 Feb 2008 08:34:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4685305606629949031.post-8496178912601433940</guid><description>&lt;span class="fullpost"&gt;&lt;br /&gt;JVM stands for Java Virtual Machine. It is the run time for java programs. All are java programs are running inside this JVM only. It converts java byte code to OS specific commands. In addition to governing the execution of an application's byte codes, the virtual machine handles related tasks such as managing the system's memory, providing security against malicious code, and managing multiple threads of program execution.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>What is covariant return type?</title><link>http://java-papers.blogspot.com/2008/02/what-is-covariant-return-type.html</link><category>Java Questions</category><author>noreply@blogger.com (jon)</author><pubDate>Tue, 26 Feb 2008 08:34:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4685305606629949031.post-141622173611902428</guid><description>&lt;span class="fullpost"&gt;&lt;br /&gt;A covariant return type lets you override a superclass method with a return type that subtypes the superclass method's return type. So we can use covariant return types to minimize upcasting and downcasting. &lt;br /&gt;class Parent { &lt;br /&gt;Parent foo () { &lt;br /&gt;System.out.println ("Parent foo() called"); &lt;br /&gt;return this; &lt;br /&gt;} &lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;class Child extends Parent { &lt;br /&gt;Child foo () { &lt;br /&gt;System.out.println ("Child foo() called"); &lt;br /&gt;return this; &lt;br /&gt;} &lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;class Covariant { &lt;br /&gt;public static void main(String[] args) { &lt;br /&gt;Child c = new Child(); &lt;br /&gt;Child c2 = c.foo(); // c2 is Child &lt;br /&gt;Parent c3 = c.foo(); // c3 points to Child &lt;br /&gt;} &lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>What are new language features in J2SE 5.0?</title><link>http://java-papers.blogspot.com/2008/02/what-are-new-language-features-in-j2se.html</link><category>Java Questions</category><author>noreply@blogger.com (jon)</author><pubDate>Tue, 26 Feb 2008 08:34:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4685305606629949031.post-2537918693542555995</guid><description>&lt;span class="fullpost"&gt;&lt;br /&gt;Generally: &lt;br /&gt;1. generics &lt;br /&gt;2. static imports &lt;br /&gt;3. annotations &lt;br /&gt;4. typesafe enums &lt;br /&gt;5. enhanced for loop &lt;br /&gt;6. autoboxing/unboxing &lt;br /&gt;7. varargs &lt;br /&gt;8. covariant return types &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Why are the interfaces more flexible than abstract classes?</title><link>http://java-papers.blogspot.com/2008/02/why-are-interfaces-more-flexible-than.html</link><category>Java Questions</category><author>noreply@blogger.com (jon)</author><pubDate>Tue, 26 Feb 2008 08:33:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4685305606629949031.post-5654251096125481126</guid><description>&lt;span class="fullpost"&gt;&lt;br /&gt;An interface-defined type can be implemented by any class in a class hierarchy and can be extended by another interface. In contrast, an abstract-class-defined type can be implemented only by classes that subclass the abstract class. &lt;br /&gt;--An interface-defined type can be used well in polymorphism. The so-called interface type vs. implementation types. &lt;br /&gt;--Abstract classes evolve more easily than interfaces. If you add a new concrete method to an abstract class, the hierarchy system is still working. If you add a method to an interface, the classes that rely on the interface will break when recompiled. &lt;br /&gt;--Generally, use interfaces for flexibility; use abstract classes for ease of evolution (like expanding class functionality). &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Describe the wrapper classes in Java.</title><link>http://java-papers.blogspot.com/2008/02/describe-wrapper-classes-in-java.html</link><category>Java Questions</category><author>noreply@blogger.com (jon)</author><pubDate>Tue, 26 Feb 2008 08:33:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4685305606629949031.post-3662255114915017027</guid><description>&lt;span class="fullpost"&gt;&lt;br /&gt;Wrapper class is wrapper around a primitive data type. An instance of a wrapper class contains, or wraps, a primitive value of the corresponding type. &lt;br /&gt;&lt;br /&gt;Following table lists the primitive types and the corresponding wrapper classes: &lt;br /&gt;&lt;br /&gt;Primitive Wrapper &lt;br /&gt;boolean java.lang.Boolean &lt;br /&gt;byte java.lang.Byte &lt;br /&gt;char java.lang.Character &lt;br /&gt;double java.lang.Double &lt;br /&gt;float java.lang.Float &lt;br /&gt;int java.lang.Integer &lt;br /&gt;long java.lang.Long &lt;br /&gt;short java.lang.Short &lt;br /&gt;void java.lang.Void &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>What are Access Specifiers available in Java?</title><link>http://java-papers.blogspot.com/2008/02/what-are-access-specifiers-available-in.html</link><category>Java Questions</category><author>noreply@blogger.com (jon)</author><pubDate>Tue, 26 Feb 2008 08:33:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4685305606629949031.post-673937643636262016</guid><description>&lt;span class="fullpost"&gt;&lt;br /&gt;ccess specifiers are keywords that determines the type of access to the member of a class. These are: &lt;br /&gt;Public &lt;br /&gt;Protected &lt;br /&gt;Private &lt;br /&gt;Defaults &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Explain garbage collection?</title><link>http://java-papers.blogspot.com/2008/02/explain-garbage-collection_26.html</link><category>Java Questions</category><author>noreply@blogger.com (jon)</author><pubDate>Tue, 26 Feb 2008 08:32:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4685305606629949031.post-6484733310812719902</guid><description>&lt;span class="fullpost"&gt;&lt;br /&gt;Garbage collection is one of the most important feature of Java. Garbage collection is also called automatic memory management as JVM automatically removes the unused variables/objects (value is null) from the memory. User program cann't directly free the object from memory, instead it is the job of the garbage collector to automatically free the objects that are no longer referenced by a program. Every class inherits finalize() method from java.lang.Object, the finalize() method is called by garbage collector when it determines no more references to the object exists. In Java, it is good idea to explicitly assign null into a variable when no more in use. I Java on calling System.gc() and Runtime.gc(), JVM tries to recycle the unused objects, but there is no guarantee when all the objects will garbage collected.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Explain the new Features of JDBC 2.0 Core API?</title><link>http://java-papers.blogspot.com/2008/02/explain-new-features-of-jdbc-20-core.html</link><category>Java Questions</category><author>noreply@blogger.com (jon)</author><pubDate>Tue, 26 Feb 2008 08:32:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4685305606629949031.post-3189313160734217656</guid><description>&lt;span class="fullpost"&gt;&lt;br /&gt;The JDBC 2.0 API includes the complete JDBC API, which includes both core and Optional Package API, and provides inductrial-strength database computing capabilities. &lt;br /&gt;New Features in JDBC 2.0 Core API: &lt;br /&gt;&lt;br /&gt;Scrollable result sets- using new methods in the ResultSet interface allows programmatically move the to particular row or to a position relative to its current position &lt;br /&gt;JDBC 2.0 Core API provides the Batch Updates functionality to the java applications. &lt;br /&gt;Java applications can now use the ResultSet.updateXXX methods. &lt;br /&gt;New data types - interfaces mapping the SQL3 data types &lt;br /&gt;Custom mapping of user-defined types (UTDs) &lt;br /&gt;Miscellaneous features, including performance hints, the use of character streams, full precision for java.math.BigDecimal values, additional security, and support for time zones in date, time, and timestamp values. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>What does it mean that a method or class is abstract?</title><link>http://java-papers.blogspot.com/2008/02/what-does-it-mean-that-method-or-class_3580.html</link><category>Java Questions</category><author>noreply@blogger.com (jon)</author><pubDate>Tue, 26 Feb 2008 08:31:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4685305606629949031.post-7777291556826345659</guid><description>&lt;span class="fullpost"&gt;&lt;br /&gt;An abstract class cannot be instantiated. Only its subclasses can be instantiated. You indicate that a class is abstract with the abstract keyword like this: &lt;br /&gt;public abstract class Container extends Component { &lt;br /&gt;Abstract classes may contain abstract methods. A method declared abstract is not actually implemented in the current class. It exists only to be overridden in subclasses. It has no body. For example, &lt;br /&gt;public abstract float price(); &lt;br /&gt;Abstract methods may only be included in abstract classes. However, an abstract class is not required to have any abstract methods, though most of them do. &lt;br /&gt;Each subclass of an abstract class must override the abstract methods of its superclasses or itself be declared abstract. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item></channel></rss>