<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="http://johnj2v.wetpaint.com/xsl/rss2html.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://johnj2v.wetpaint.com/scripts/wpcss/wiki/johnj2v/skin/minimalist/rss" type="text/css" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>VijayaVenkatesh - Recently Updated Pages</title><link>http://johnj2v.wetpaint.com/pageSearch/updated</link><description>Recently Updated Pages on http://johnj2v.wetpaint.com</description><language>en-us</language><webMaster>info@wetpaint.com</webMaster><pubDate>Sun, 13 May 2007 05:48:52 CDT</pubDate><lastBuildDate>Sun, 13 May 2007 05:48:52 CDT</lastBuildDate><generator>wetpaint.com</generator><ttl>60</ttl><image><title>VijayaVenkatesh</title><url>http://image.wetpaint.com/wiki/johnj2v/image/2dkozVBxHe9MzWi08C8LCJQ==85156</url><link>http://johnj2v.wetpaint.com</link></image><item><title>JAVA - Teacher Page Welcomes You</title><link>http://johnj2v.wetpaint.com/page/JAVA+-+Teacher+Page+Welcomes+You</link><author>vijayavenkatesh.2006</author><guid isPermaLink="false">http://johnj2v.wetpaint.com/page/JAVA+-+Teacher+Page+Welcomes+You</guid><pubDate>Sun, 13 May 2007 05:48:52 CDT</pubDate><description>Java - Introduction:-&lt;br&gt;                   &lt;br&gt;                   Java is an object-oriented applications programming language developed by Sun Microsystems in the early 1990s. Java applications are typically compiled to bytecode, although compilation to native machine code is also possible. At runtime, bytecode is usually either interpreted or compiled to native code for execution, although direct hardware execution of bytecode by a Java processor is also possible.&lt;br&gt;&lt;a&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;                   The language itself derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. JavaScript, a scripting language, shares a similar name and has similar syntax, but is not directly related to Java.&lt;br&gt;&lt;br&gt;                   Sun Microsystems provides a GNU General Public License implementation of a Java compiler and Java virtual machine, in compliance with the specifications of the Java Community Process, although the class library that is required to run Java programs is not free software.&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;ul&gt;  &lt;li&gt;At first Java is Started as a Project called &amp;quot;Oak&amp;quot;.&lt;/li&gt;  &lt;li&gt;The first public implementation was Java 1.0 in 1995.&lt;/li&gt;  &lt;li&gt;Java is Plat Form Independence Language.&lt;/li&gt;  &lt;li&gt;The Java program is converted into byte code at run time and then is called as Java bytecode.&lt;/li&gt;  &lt;li&gt;Then the Java byte code is converted into Machine code by JIT compiler.&lt;/li&gt;  &lt;li&gt;Java programs are runned using the JDK (Java Development Kit).&lt;/li&gt;&lt;/ul&gt;&lt;br&gt;&lt;br&gt;Get Started Java:-&lt;br&gt;&lt;br&gt;                   The given below show the example for a simple java program. The Program is :-&lt;br&gt;&lt;br&gt;                        public class Hello &lt;br&gt;                       {&lt;br&gt;                                    public static void main(String[] args)&lt;br&gt;                                   {&lt;br&gt;                                            System.out.println(&amp;quot;Hello, World!&amp;quot;); &lt;br&gt;                                   }&lt;br&gt;                      }&lt;br&gt;&lt;br&gt;           In the above:-&lt;br&gt;      &lt;br&gt;                        public = visibility modifier&lt;br&gt;                        class = a keyword used to specify the class name.&lt;br&gt;                        Hello = name of the class&lt;br&gt;                        void, string = datatype&lt;br&gt;                        main() = method name of function name&lt;br&gt;                        args = arguments or parameter passed to the main function&lt;br&gt;                        System.out.println = it calls the method &amp;quot;println()&amp;quot; &lt;br&gt;                                                           called from the &amp;quot;out&amp;quot; class which is inside the &lt;br&gt;                                                           &amp;quot;System&amp;quot; class.&lt;br&gt;                      &lt;br&gt;Generals Rules for Java Program:-&lt;br&gt;&lt;ul&gt;  &lt;li&gt;The name of the class and name of the java file must be same.&lt;/li&gt;  &lt;li&gt;The main() function must be present in each and every java program except Applets.&lt;/li&gt;  &lt;li&gt;The function should return a value when using the datatypes except void datatype.&lt;/li&gt;  &lt;li&gt;Each and every function used in the program must be called inside the main() function.&lt;/li&gt;  &lt;li&gt;The name of the function used inside the program must be Unique.&lt;/li&gt;  &lt;li&gt;There is no limits for the function and class to use in the program.&lt;/li&gt;&lt;/ul&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;lt;&amp;lt;continued shortly&amp;gt; &lt;br&gt;   &lt;br&gt;&lt;br&gt;  VIJAYAVENKATESH&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:vijayavenkatesh.2006@yahoo.com&quot; target=&quot;_top&quot;&gt;vijayavenkatesh.2006@yahoo.com&lt;/a&gt;&lt;br&gt;                         &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;hr size=&quot;1&quot;&gt;&lt;br/&gt;</description></item><item><title>Welcome to Home</title><link>http://johnj2v.wetpaint.com/page/Welcome+to+Home</link><author>vijayavenkatesh.2006</author><guid isPermaLink="false">http://johnj2v.wetpaint.com/page/Welcome+to+Home</guid><pubDate>Sun, 13 May 2007 05:05:27 CDT</pubDate><description>&lt;h2 align=&quot;right&quot;&gt;  &lt;div align=&quot;center&quot;&gt;  Coming Soon !!!&lt;br&gt;This site is going to Teach Java For You !!!&lt;br&gt;&lt;br&gt; &lt;br&gt;&lt;br&gt; &lt;/div&gt;&lt;/h2&gt;  &lt;div align=&quot;center&quot;&gt;  &lt;/div&gt;  &lt;div align=&quot;center&quot;&gt;  &lt;div align=&quot;center&quot;&gt;  THE GREAT POWER OF THIS SITE IS YOU!..&lt;/div&gt;&lt;/div&gt;  &lt;div align=&quot;center&quot;&gt;  &lt;/div&gt;  &lt;div align=&quot;center&quot;&gt;  Thank you to visit this site ..&lt;/div&gt;  &lt;div align=&quot;right&quot;&gt;   &lt;/div&gt;  &lt;div align=&quot;right&quot;&gt;  &lt;b&gt;J.VIJAYAVENKATESH D.I.T&lt;/b&gt;&lt;br&gt;&lt;br&gt;&lt;b&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:vijayavenkatesh.2006@yahoo.com&quot; target=&quot;_top&quot;&gt;vijayavenkatesh.2006@yahoo.com&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;  &lt;div align=&quot;center&quot;&gt;  &lt;/div&gt;  &lt;div align=&quot;center&quot;&gt;  &lt;/div&gt;  &lt;div align=&quot;center&quot;&gt;  &lt;b&gt;To advatise in this site freely mail me!!.....&lt;/b&gt;&lt;/div&gt;&lt;hr size=&quot;1&quot;&gt;&lt;br/&gt;</description></item><item><title>Information Technology in salem polytechnic</title><link>http://johnj2v.wetpaint.com/page/Information+Technology+in+salem+polytechnic</link><author>vijayavenkatesh.2006</author><guid isPermaLink="false">http://johnj2v.wetpaint.com/page/Information+Technology+in+salem+polytechnic</guid><pubDate>Sun, 31 Dec 2006 03:45:21 CST</pubDate><description>&lt;h2&gt;  &lt;u&gt;&lt;b&gt;Staff &amp;amp; Students in this department:&lt;/b&gt;&lt;/u&gt;&lt;/h2&gt;  &lt;blockquote&gt;  The Staffs in the department of Information Technology in The Salem Polytechnic College as follows:&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;ul&gt;  &lt;li&gt;  &lt;b&gt;S.Ragavendran B.E,(H.O.D)&lt;/b&gt; &lt;/li&gt;  &lt;li&gt;  &lt;b&gt;T.Satheesh Kumar B.E,(leaves)&lt;/b&gt; &lt;/li&gt;  &lt;li&gt;  &lt;b&gt;R.Suguna &lt;/b&gt;&lt;/li&gt;  &lt;li&gt;  &lt;b&gt;Vijayakumar D.C.T,.(lab assistant)&lt;/b&gt; &lt;/li&gt;  &lt;li&gt;  &lt;b&gt;T.karthi(Data entry operator)&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;&lt;br&gt;&lt;br&gt;This department contains 32 third year students of diploma student and the name of the students are given below:&lt;br&gt;&lt;br&gt;&lt;ol&gt;  &lt;ol&gt;  &lt;li&gt;  N.Ambika &lt;/li&gt;  &lt;li&gt;  R.Bala chander &lt;/li&gt;  &lt;li&gt;  M.Barani &lt;/li&gt;  &lt;li&gt;  S.Dinesh &lt;/li&gt;  &lt;li&gt;  P.Gopi &lt;/li&gt;  &lt;li&gt;  V.Govindaraju &lt;/li&gt;  &lt;li&gt;  F.Ismail &lt;/li&gt;  &lt;li&gt;  K.Janarthanan &lt;/li&gt;  &lt;li&gt;  V.Kamalraj &lt;/li&gt;  &lt;li&gt;  K.Karthick &lt;/li&gt;  &lt;li&gt;  S.Mohammed siraj munir &lt;/li&gt;  &lt;li&gt;  N.Mohanraj &lt;/li&gt;  &lt;li&gt;  M.Nanthakumar &lt;/li&gt;  &lt;li&gt;  G.Padmavathi &lt;/li&gt;  &lt;li&gt;  J.Priyadharshini &lt;/li&gt;  &lt;li&gt;  R.Raja &lt;/li&gt;  &lt;li&gt;  A.R.Saranya &lt;/li&gt;  &lt;li&gt;  R.Saranya &lt;/li&gt;  &lt;li&gt;  K.Senthilnathan &lt;/li&gt;  &lt;li&gt;  A.M.Sudha &lt;/li&gt;  &lt;li&gt;  P.Udhayakumar &lt;/li&gt;  &lt;li&gt;  S.Vediyappan &lt;/li&gt;  &lt;li&gt;  J.Vijayavenkatesh &lt;/li&gt;  &lt;li&gt;  G.Vinoth &lt;/li&gt;  &lt;li&gt;  L.Elaverasi &lt;/li&gt;  &lt;li&gt;  V.Karthi &lt;/li&gt;  &lt;li&gt;  K.Karthick &lt;/li&gt;  &lt;li&gt;  R.Manikandaprabu &lt;/li&gt;  &lt;li&gt;  R.Rajadesingu &lt;/li&gt;  &lt;li&gt;  P.S.S.Rajan &lt;/li&gt;  &lt;li&gt;  J.Saranya &lt;/li&gt;  &lt;li&gt;  C.Selvendran&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;  &lt;div align=&quot;center&quot;&gt;  &lt;/div&gt;  &lt;div align=&quot;center&quot;&gt;  The marks details of this students will be displayed shortly.....&lt;/div&gt;  &lt;div align=&quot;center&quot;&gt;  &lt;/div&gt;  &lt;div align=&quot;center&quot;&gt;   &lt;br&gt;Liv(f)e With Maximum Risk !....&lt;br&gt;&lt;/div&gt;  &lt;div align=&quot;right&quot;&gt;  Thank you to visit this page,&lt;/div&gt;  &lt;div align=&quot;right&quot;&gt;  &lt;/div&gt;  &lt;div align=&quot;right&quot;&gt;  (IT Department Staffs)&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/div&gt;  &lt;div align=&quot;right&quot;&gt;  &lt;/div&gt;  &lt;div align=&quot;right&quot;&gt;  &lt;/div&gt;  &lt;div align=&quot;right&quot;&gt;  &lt;/div&gt;&lt;br&gt;&lt;div align=&quot;right&quot;&gt;  &lt;/div&gt;&lt;hr size=&quot;1&quot;&gt;&lt;br/&gt;</description></item><item><title>Gallary</title><link>http://johnj2v.wetpaint.com/page/Gallary</link><author>vijayavenkatesh.2006</author><guid isPermaLink="false">http://johnj2v.wetpaint.com/page/Gallary</guid><pubDate>Sun, 31 Dec 2006 03:34:59 CST</pubDate><description>&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div align=&quot;right&quot;&gt;  &lt;b&gt;Photo&amp;#39;s By&lt;/b&gt;&lt;/div&gt;  &lt;div align=&quot;right&quot;&gt;  &lt;b&gt;Narenender&lt;/b&gt;&lt;/div&gt;  &lt;div align=&quot;right&quot;&gt;   &lt;/div&gt;&lt;hr size=&quot;1&quot;&gt;&lt;br/&gt;</description></item><item><title>Java 2</title><link>http://johnj2v.wetpaint.com/page/Java+2</link><author>vijayavenkatesh.2006</author><guid isPermaLink="false">http://johnj2v.wetpaint.com/page/Java+2</guid><comments>customise</comments><pubDate>Sat, 30 Dec 2006 01:27:57 CST</pubDate><description>&lt;b&gt;1. Explain for 10 to 15 minutes a technology or product that you are familiar with?  &lt;/b&gt;   This is to test the person&amp;#39;s communication skill and technical skill. If you are really comfortable, start with a public domain technology like Struts or JUnit. If not, sometimes it is better to explain the product that you worked with rather than read about or studied.&lt;br&gt;&lt;br&gt;   &lt;b&gt;2. Tell me about yourself?   &lt;/b&gt;   The first is focusing on the needs of the organization. The second is focusing on the needs of the people within that organization. Don&amp;#39;t talk so much about strong points about yourself because your resume has already brought you at the interview site.&lt;br&gt;    &lt;b&gt;3. How to deal with a question that is inappropriate?    &lt;/b&gt;   Briefly answer the question and move to a new topic. &lt;br&gt; Ignore the question and redirect the discussion toward a different topic. &lt;br&gt; If the question is blatant and offensive, you have every right to terminate the interview and walk out. &lt;br&gt; Don&amp;#39;t answer the question, but answer the intent behind the question. &lt;br&gt; For instance, if the interviewer asks, &amp;quot;Who is going to take care of your children when you have to travel?&amp;quot; You might answer, &amp;quot;I can meet the travel and work schedule that this job requires.&amp;quot; Or if he/she asks, &amp;quot;Are you planning a family in the future?&amp;quot; You might say, &amp;quot;Right now I am focused on my career and as a family is always an option, it is not a priority right now.&amp;quot;&lt;br&gt;    &lt;b&gt;4. What lessons have you learnt from &amp;quot;Apprentice&amp;quot; show?  &lt;/b&gt;   At least 8 lessons:&lt;br&gt;  1. Have a Strategy &lt;br&gt; 2. Find Out What the Boss/Client Wants and Give it to Them &lt;br&gt; 3. Deal With the Person in Charge &lt;br&gt; 4. Be Positive &lt;br&gt; 5. Have the Courage to Speak Your Mind &lt;br&gt; 6. Stand Up For Yourself &lt;br&gt; 7. Be Flexible &lt;br&gt; 8. There&amp;#39;s Life After Being Fired&lt;br&gt;     &lt;b&gt;5. What are your weaknesses?   &lt;/b&gt;  This is the most dreaded question of all. Handle it by minimizing your weakness and emphasizing your strengths. Stay away from personal qualities and concentrate on professional traits: &amp;quot;I am always working on improving my communication skills to be a more effective presenter. I recently joined Toastmasters.com, which I find very helpful.&amp;quot;&lt;br&gt;    &lt;b&gt;6. Why should we hire you?   &lt;/b&gt;   Summarize your experiences: &amp;quot;With five years&amp;#39; experience working in this industry and my proven record of saving the company money, I could make a big difference in your company. I&amp;#39;m confident I would be a great addition to your team.&amp;quot;&lt;br&gt;    &lt;b&gt;7. Why do you want to work here?   &lt;/b&gt;   The interviewer is listening for an answer that indicates you&amp;#39;ve given this some thought and are not sending out resumes just because there is an opening. For example, &amp;quot;I&amp;#39;ve selected key companies whose mission statements are in line with my values, where I know I could be excited about what the company does, and this company is very high on my list of desirable choices.&amp;quot;&lt;br&gt;    &lt;b&gt;8. What are your goals?   &lt;/b&gt;   Sometimes it&amp;#39;s best to talk about short-term and intermediate goals rather than locking yourself into the distant future. For example, &amp;quot;My immediate goal is to get a job in a growth-oriented company. My long-term goal will depend on where the company goes. I hope to eventually grow into a position of responsibility.&amp;quot;&lt;br&gt;    &lt;b&gt;9. Why did you leave (are you leaving) your job?   &lt;/b&gt;   If you&amp;#39;re unemployed, state your reason for leaving in a positive context: &amp;quot;I managed to survive two rounds of corporate downsizing, but the third round was a 20 percent reduction in the workforce, which included me.&amp;quot; &lt;br&gt; If you are employed, focus on what you want in your next job: &amp;quot;After two years, I made the decision to look for a company that is team-focused, where I can add my experience.&amp;quot;&lt;br&gt;    &lt;b&gt;10. When were you most satisfied in your job?   &lt;/b&gt;   The interviewer wants to know what motivates you. If you can relate an example of a job or project when you were excited, the interviewer will get an idea of your preferences. &amp;quot;I was very satisfied in my last job, because I worked directly with the customers and their problems; that is an important part of the job for me.&amp;quot;&lt;br&gt;    &lt;b&gt;11. What can you do for us that other candidates can&amp;#39;t? or  What makes you unique?   &lt;/b&gt;   This will take an assessment of your experiences, skills and traits. Summarize concisely: &amp;quot;I have a unique combination of strong technical skills, and the ability to build strong customer relationships. This allows me to use my knowledge and break down information to be more user-friendly.&amp;quot;&lt;br&gt;    &lt;b&gt;12. What are three positive things your last boss would say about you?     &lt;/b&gt;   It&amp;#39;s time to pull out your old performance appraisals and boss&amp;#39;s quotes. This is a great way to brag about yourself through someone else&amp;#39;s words: &amp;quot;My boss has told me that I am the best designer he has ever had. He knows he can rely on me, and he likes my sense of humor.&amp;quot;&lt;br&gt;    &lt;b&gt;13. What salary are you seeking?   &lt;/b&gt;   It is to your advantage if the employer tells you the range first. Prepare by knowing the going rate in your area, and your bottom line or walk-away point. One possible answer would be: &amp;quot;I am sure when the time comes, we can agree on a reasonable amount. In what range do you typically pay someone with my background?&amp;quot; &lt;hr size=&quot;1&quot;&gt;&lt;br/&gt;</description></item><item><title>Songs</title><link>http://johnj2v.wetpaint.com/page/Songs</link><author>vijayavenkatesh.2006</author><guid isPermaLink="false">http://johnj2v.wetpaint.com/page/Songs</guid><pubDate>Sat, 30 Dec 2006 01:22:40 CST</pubDate><description> &lt;b&gt;402. The superclass constructor runs before the subclass constructor. The subclass&amp;#39;s version of the overridable method will be invoked before the subclass&amp;#39;s constructor has been invoked. If the subclass&amp;#39;s overridable method depends on the proper initialization of the subclass (through the subclass constructor), the method will most likely fail. Is that true? &lt;/b&gt;    Yes. It is true    &lt;br&gt;   &lt;b&gt;403. Why are the interfaces more flexible than abstract classes?&lt;/b&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;b&gt;404. What are new language features in J2SE 5.0?&lt;/b&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;b&gt;405. What is covariant return type?&lt;/b&gt;     A covariant return type lets you override a superclass method with a return type that subtypes the superclass method&amp;#39;s return type. So we can use covariant return types to minimize upcasting and downcasting.  class Parent {&lt;br&gt;   Parent foo () {&lt;br&gt;      System.out.println (&amp;quot;Parent foo() called&amp;quot;);&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 (&amp;quot;Child foo() called&amp;quot;);&lt;br&gt;      return this;&lt;br&gt;   }&lt;br&gt;}&lt;br&gt;&lt;br&gt;class Covariant {&lt;br&gt;&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;b&gt;406. What is the result of the following statement?&lt;/b&gt;     int i = 1, float f = 2.0f;&lt;br&gt; i += f; //ok, the cast done automatically by the compiler&lt;br&gt; i = i + f; //error&lt;br&gt; The compound assignment operators automatically include cast operations in their behaviors.     &lt;br&gt;      &lt;b&gt;406.   What is externalization? Where is it useful??&lt;/b&gt;&lt;br&gt;  &lt;br&gt;Use the Externalizable interface when you need complete control over your Bean&amp;#39;s serialization (for example, when writing and reading a specific file format).&lt;br&gt;       &lt;b&gt;407. Use the Externalizable interface when you need complete control over your Bean&amp;#39;s serialization (for example, when writing and reading a specific file format).&lt;br&gt;&lt;br&gt;&lt;/b&gt; &lt;b&gt;408.   What will be the output on executing the following code.&lt;br&gt; 	public class MyClass {&lt;br&gt;        public static void main (String args[] ) {&lt;br&gt;               int abc[] = new int [5];&lt;br&gt;               System.out.println(abc);&lt;br&gt;        }&lt;br&gt; } &lt;br&gt; &lt;br&gt;  A Error array not initialized &lt;br&gt; B 5 &lt;br&gt; C null &lt;br&gt; D Print some junk characters &lt;/b&gt;    D  &lt;br&gt;&lt;br&gt; It will print some junk characters to the output. Here it will not give any compile time or runtime error because we have declared and initialized the array properly. Event if we are not assigning a value to the array, it will always initialized to its defaults.   &lt;br&gt;    &lt;b&gt;409.   What will be the output on executing the following code. &lt;br&gt;   public class MyClass {&lt;br&gt;        public static void main (String args[] ) {&lt;br&gt;               int abc[] = new int [5];&lt;br&gt;               System.out.println(abc[0]);&lt;br&gt;        }&lt;br&gt; }&lt;br&gt; &lt;br&gt; A Error array not initialized &lt;br&gt; B 5 &lt;br&gt; C 0 &lt;br&gt; D Print some junk characters &lt;/b&gt;    C.  &lt;br&gt;&lt;br&gt; Here it will not give any compile time or runtime error because we have declared and initialized the array properly. Event if we are not assigning a value to the array, it will always initialized to its defaults. So the array will be initialized with values zero.   &lt;br&gt;   &lt;b&gt;410.   What is a marker interface ? &lt;br&gt; &lt;/b&gt;An interface that contains no methods. Eg: Serializable, Cloneable, SingleThreadModel etc. It is used to just mark java classes that support certain capability.   &lt;br&gt;   &lt;b&gt;411.   What are tag interfaces?  &lt;br&gt; &lt;/b&gt; Tag interface is an alternate name for marker interface.    &lt;br&gt;   &lt;b&gt;412.   What are the restrictions placed on static method ?   &lt;br&gt; &lt;/b&gt; We cannot override static methods. We cannot access any object variables inside static method. Also the this reference also not available in static methods.   &lt;br&gt;   &lt;b&gt;413.   What is JVM?    &lt;br&gt; &lt;/b&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&amp;#39;s byte codes, the virtual machine handles related tasks such as managing the system&amp;#39;s memory, providing security against malicious code, and managing multiple threads of program execution.   &lt;br&gt;   &lt;b&gt;414.   What is JIT?    &lt;br&gt; &lt;/b&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;b&gt;  415. What are ClassLoaders?  &lt;br&gt; &lt;/b&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 &amp;quot;class file&amp;quot; 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;b&gt;  416.What is Service Locator pattern?  &lt;br&gt; &lt;/b&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) Home and JMS (Java Message Service) component factories. The Service Locator hides the lookup process&amp;#39;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;b&gt;  417. What is Session Facade pattern?   &lt;br&gt; &lt;/b&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;b&gt;  418. What is Data Access Object pattern?     &lt;/b&gt; The Data Access Object (or DAO) pattern: &lt;br&gt; separates a data resource&amp;#39;s client interface from its data access mechanisms &lt;br&gt; adapts a specific data resource&amp;#39;s access API to a generic client interface  &lt;br&gt; The DAO pattern allows data access mechanisms to change independently of the code that uses the data. &lt;br&gt;The DAO implements the access mechanism required to work with the data source. The data source could be a persistent store like an RDBMS, an external service like a B2B exchange, a repository like an LDAP database, or a business service accessed via CORBA Internet Inter-ORB Protocol (IIOP) or low-level sockets. The business component that relies on the DAO uses the simpler interface exposed by the DAO for its clients. The DAO completely hides the data source implementation details from its clients. Because the interface exposed by the DAO to clients does not change when the underlying data source implementation changes, this pattern allows the DAO to adapt to different storage schemes without affecting its clients or business components. Essentially, the DAO acts as an adapter between the component and the data source. &lt;br&gt;&lt;br&gt;&lt;br&gt; &lt;b&gt; 419.  How can we make a class Singleton  &lt;br&gt; &lt;/b&gt;   &lt;br&gt;A) If the class is Serializable&lt;br&gt;&lt;br&gt;  &lt;br&gt;  class Singleton implements Serializable&lt;br&gt;  {  &lt;br&gt;	private static Singleton instance; &lt;br&gt;	&lt;br&gt;	private Singleton()  {  }   &lt;br&gt;		&lt;br&gt;	public static synchronized  Singleton getInstance()&lt;br&gt;	  	{&lt;br&gt;		if (instance == null)&lt;br&gt;			instance = new Singleton(); &lt;br&gt;		return instance;&lt;br&gt;	}&lt;br&gt;	&lt;br&gt;	/**&lt;br&gt; If the singleton implements Serializable, then this&lt;br&gt;	* method must be supplied.&lt;br&gt;	*/ &lt;br&gt;	protected Object readResolve() {&lt;br&gt;		return instance;&lt;br&gt;	}&lt;br&gt;	&lt;br&gt;	/**&lt;br&gt;	This method avoids the object fro being cloned&lt;br&gt;	*/&lt;br&gt;	public Object clone() {&lt;br&gt;		throws CloneNotSupportedException ;&lt;br&gt;		//return instance;&lt;br&gt;	}&lt;br&gt; } &lt;br&gt;	&lt;br&gt;B) If the class is NOT Serializable&lt;br&gt;&lt;br&gt;&lt;br&gt;class Singleton&lt;br&gt;	{&lt;br&gt;	private static Singleton instance;&lt;br&gt;	private Singleton()  {  }   &lt;br&gt;&lt;br&gt;	public static synchronized  Singleton getInstance()&lt;br&gt;	  	{&lt;br&gt;		if (instance == null) &lt;br&gt;			instance = new Singleton();&lt;br&gt;		return instance;&lt;br&gt;	}&lt;br&gt;&lt;br&gt;	/**&lt;br&gt;This method avoids the object from being cloned&lt;br&gt;	**/&lt;br&gt;	public Object clone() {&lt;br&gt;		throws CloneNotSupportedException ;&lt;br&gt;		//return instance;&lt;br&gt;	}&lt;br&gt;&lt;br&gt;} &lt;br&gt;  &lt;br&gt;   &lt;b&gt;  420. Can we make an EJB singleton?   &lt;br&gt; &lt;/b&gt; This is a debatable question, and for every answer we propose there can be contradictions. I propose 2 solutions fo the same. Remember that EJB&amp;#39;s are distributed componenets and can be deployed on different JVM&amp;#39;s in a Distributed environment &lt;br&gt; i) Follow the steps as given below  &lt;br&gt; Make sure that your serviceLocator is deployed on only one JVM. &lt;br&gt; In the serviceLocator create a HashTable/HashMap(You are the right judge to choose between these two) &lt;br&gt;When ever a request comes for an EJB to a serviceLocator, it first checks in the HashTable if an entry already exists in the table with key being the JNDI name of EJB. If key is present and value is not null, return the existing reference, else lookup the EJB in JNDI as we do normally and add an entry into the Hashtable before returning it to the client. This makes sure that you maintain a singleton of EJB. &lt;br&gt;ii) In distributed environment our components/Java Objects would be running on different JVM&amp;#39;s. So the normal singleton code we write for maintaining single instance works fine for single JVM, but when the class could be loaded in multiple JVM&amp;#39;s and Instantiated in multiple JVM&amp;#39;s normal singleton code does not work. This is because the ClassLoaders being used in the different JVM&amp;#39;s are different from each other and there is no defined mechanism to check and compare what is loaded in another JVM. A solution could be(Not tested yet. Need your feedback on this) to write our own ClassLoader and pass this classLoader as argument, whenever we are creating a new Instance and make sure that only one instance is created for the proposed class.This can be done easily.&lt;br&gt;&lt;br&gt; &lt;b&gt; 422.  How is static Synchronization different form non-static synchronization?   &lt;br&gt; &lt;/b&gt; When Synchronization is applied on a static Member or a static block, the lock is performed on the Class and not on the Object, while in the case of a Non-static block/member, lock is applied on the Object and not on class. [Trail 2: There is a class called Class in Java whose object is associated with the object(s) of your class. All the static members declared in your class will have reference in this class(Class). As long as your class exists in memory this object of Class is also present. Thats how even if you create multiple objects of your class only one Class object is present and all your objects are linked to this Class object. Even though one of your object is GCed after some time, this object of Class is not GCed untill all the objects associated with it are GCed. &lt;br&gt;This means that when ever you call a &amp;quot;static synchronized&amp;quot; block, JVM locks access to this Class object and not any of your objects. Your client can till access the non-static members of your objects.   &lt;br&gt;   &lt;b&gt; 423.  What are class members and Instance members?    &lt;br&gt; &lt;/b&gt;Any global members(Variables, methods etc.) which are static are called as Class level members and those which are non-static are called as Instance level members.   &lt;br&gt;   &lt;b&gt; 424.  Name few Garbage collection algorithms?    &lt;br&gt; &lt;/b&gt; Here they go: &lt;br&gt; &lt;br&gt; Mark and Sweep &lt;br&gt; Reference counting &lt;br&gt; Tracing collectors &lt;br&gt; Copying collectors &lt;br&gt; Heap compaction &lt;br&gt; Mark-compact collectors   &lt;br&gt;   &lt;b&gt; 425.  Does Java pass by Value or reference?    &lt;br&gt; &lt;/b&gt;Its uses Reference while manipulating objects but pass by value when sending method arguments. Those who feel why I added this simple question in this section while claiming to be maintaining only strong and interesting questions, go ahead and answer following questions.  a)What is the out put of:&lt;br&gt;&lt;br&gt;import java.util.*;&lt;br&gt;&lt;br&gt;class TestCallByRefWithObject &lt;br&gt;{&lt;br&gt;	ArrayList list = new ArrayList(5);&lt;br&gt;	&lt;br&gt;&lt;br&gt;	public void remove(int index){&lt;br&gt;		list.remove(index);&lt;br&gt;	}&lt;br&gt;&lt;br&gt;	public void add(Object obj){&lt;br&gt;		list.add(obj);&lt;br&gt;	}&lt;br&gt;&lt;br&gt;	public void display(){&lt;br&gt;		System.out.println(list);&lt;br&gt;	}&lt;br&gt;	&lt;br&gt;	public static void main(String[] args) &lt;br&gt;	{&lt;br&gt;TestCallByRefWithObject test = new TestCallByRefWithObject();&lt;br&gt;	&lt;br&gt;		test.add(&amp;quot;1&amp;quot;);&lt;br&gt;		test.add(&amp;quot;2&amp;quot;);&lt;br&gt;		test.add(&amp;quot;3&amp;quot;);&lt;br&gt;		test.add(&amp;quot;4&amp;quot;);&lt;br&gt;		test.add(&amp;quot;5&amp;quot;);&lt;br&gt;&lt;br&gt;		test.remove(4);&lt;br&gt;		test.display();&lt;br&gt;	}&lt;br&gt;}&lt;br&gt;		&lt;br&gt;b) And now what is the output of:&lt;br&gt;&lt;br&gt;&lt;br&gt;import java.util.*;&lt;br&gt;&lt;br&gt;class TestCallByRefWithInt&lt;br&gt;{&lt;br&gt;	int i = 5;&lt;br&gt;	&lt;br&gt;&lt;br&gt;	public void decrement(int i){&lt;br&gt;		i--;&lt;br&gt;	}&lt;br&gt;&lt;br&gt;	public void increment(int i){&lt;br&gt;		i++;&lt;br&gt;	}&lt;br&gt;&lt;br&gt;	public void display(){&lt;br&gt;System.out.println(&amp;quot;\nValue of i is : &amp;quot; +i);&lt;br&gt;	}&lt;br&gt;	&lt;br&gt;	public static void main(String[] args) &lt;br&gt;	{&lt;br&gt;TestCallByRefWithInt test = new TestCallByRefWithInt();&lt;br&gt;	&lt;br&gt;		test.increment(test.i);&lt;br&gt;&lt;br&gt;		test.display();&lt;br&gt;	}&lt;br&gt;}&lt;br&gt; &lt;br&gt; &lt;b&gt; 426.  Why Thread is faster compare to process?   &lt;br&gt; &lt;/b&gt; A thread is never faster than a process. If you run a thread(say there&amp;#39;s a process which has spawned only one thread) in one JVM and a process in another and that both of them require same resources then both of them would take same time to execute. But, when a program/Application is thread based(remember here there will be multiple threads running for a single process) then definetly a thread based appliation/program is faster than a process based application. This is because, when ever a process requires or waits for a resource CPU takes it out of the critical section and allocates the mutex to another process. &lt;br&gt; Before deallocating the ealier one, it stores the context(till what state did it execute that process) in registers. Now if this deallocated process has to come back and execute as it has got the resource for which it was waiting, then it can&amp;#39;t go into critical section directly. CPU asks that process to follow scheduling algorithm. So this process has to wait again for its turn. While in the case of thread based application, the application is still with CPU only that thread which requires some resource goes out, but its co threads(of same process/apllication) are still in the critical section. Hence it directly comes back to the CPU and does not wait outside. Hence an application which is thread based is faster than an application which is process based. &lt;br&gt;Be sure that its not the competion between thread and process, its between an application which is thread based or process based.    &lt;br&gt;     &lt;b&gt; 427.  When and How is an object considered as Garbage by a GC?   &lt;br&gt; &lt;/b&gt;An object is considered garbage when it can no longer be reached from any pointer in the running program. The most straightforward garbage collection algorithms simply iterate over every reachable object. Any objects left over are then considered garbage.   &lt;br&gt;   &lt;b&gt; 428. Can we force Garbage collection?  &lt;br&gt; &lt;/b&gt; java follows a philosophy of automatic garbage collection, you can suggest or encourage the JVM to perform garbage collection but you can not force it. Once a variable is no longer referenced by anything it is available for garbage collection. You can suggest garbage collection with System.gc(), but this does not guarantee when it will happen. Local variables in methods go out of scope when the method exits. At this point the methods are eligible for garbage collection. Each time the method comes into scope the local variables are re-created.   &lt;br&gt;   &lt;b&gt; 429. What are generations in Garbage Collection terminolgy? What is its relevance?  &lt;br&gt; &lt;/b&gt; Garbage Collectors make assumptions about how our application runs. Most common assumption is that an object is most likely to die shortly after it was created: called infant mortality. This assumes that an object that has been around for a while, will likely stay around for a while. GC organizes objects into generations (young, tenured, and perm). This tells that if an object lives for more than certain period of time it is moved from one generation to another generations( say from young -&amp;gt; tenured -&amp;gt; permanent). Hence GC will be run more frequently at the young generations and rarely at permanent generations. This reduces the overhead on GC and gives faster response time.   &lt;br&gt;   &lt;b&gt; 430. What is a Throughput Collector?  &lt;br&gt; &lt;/b&gt;The throughput collector is a generational collector similar to the default collector but with multiple threads used to do the minor collection. The major collections are essentially the same as with the default collector. By default on a host with N CPUs, the throughput collector uses N garbage collector threads in the collection. The number of garbage collector threads can be controlled with a command line option.   &lt;br&gt;    &lt;b&gt; 431. When to Use the Throughput Collector?  &lt;br&gt; &lt;/b&gt; Use the throughput collector when you want to improve the performance of your application with larger numbers of processors. In the default collector garbage collection is done by one thread, and therefore garbage collection adds to the serial execution time of the application. The throughput collector uses multiple threads to execute a minor collection and so reduces the serial execution time of the application. A typical situation is one in which the application has a large number of threads allocating objects. In such an application it is often the case that a large young generation is needed.&lt;br&gt;&lt;br&gt; &lt;b&gt; 427.  What is AggressiveHeap?   &lt;br&gt; &lt;/b&gt; The -XX:+AggressiveHeap option inspects the machine resources (size of memory and number of processors) and attempts to set various parameters to be optimal for long-running, memory allocation-intensive jobs. It was originally intended for machines with large amounts of memory and a large number of CPUs, but in the J2SE platform, version 1.4.1 and later it has shown itself to be useful even on four processor machines. With this option the throughput collector (-XX:+UseParallelGC) is used along with adaptive sizing (-XX:+UseAdaptiveSizePolicy). The physical memory on the machines must be at least 256MB before AggressiveHeap can be used.   &lt;br&gt;   &lt;b&gt; 428.  What is a Concurrent Low Pause Collector?   &lt;br&gt; &lt;/b&gt; The concurrent low pause collector is a generational collector similar to the default collector. The tenured generation is collected concurrently with this collector. This collector attempts to reduce the pause times needed to collect the tenured generation. It uses a separate garbage collector thread to do parts of the major collection concurrently with the applications threads. The concurrent collector is enabled with the command line option -XX:+UseConcMarkSweepGC. For each major collection the concurrent collector will pause all the application threads for a brief period at the beginning of the collection and toward the middle of the collection. The second pause tends to be the longer of the two pauses and multiple threads are used to do the collection work during that pause. The remainder of the collection is done with a garbage collector thread that runs concurrently with the application. The minor collections are done in a manner similar to the default collector, and multiple threads can optionally be used to do the minor collection.   &lt;br&gt;   &lt;b&gt; 429.  When to Use the Concurrent Low Pause Collector?   &lt;br&gt; &lt;/b&gt;Use the concurrent low pause collector if your application would benefit from shorter garbage collector pauses and can afford to share processor resources with the garbage collector when the application is running. Typically applications which have a relatively large set of long-lived data (a large tenured generation), and run on machines with two or more processors tend to benefit from the use of this collector. However, this collector should be considered for any application with a low pause time requirement. Optimal results have been observed for interactive applications with tenured generations of a modest size on a single processor.   &lt;br&gt;   &lt;b&gt; 431. What is Incremental Low Pause Collector?   &lt;br&gt; &lt;/b&gt; The incremental low pause collector is a generational collector similar to the default collector. The minor collections are done with the same young generation collector as the default collector. Do not use either -XX:+UseParallelGC or -XX:+UseParNewGC with this collector. The major collections are done incrementally on the tenured generation. This collector (also known as the train collector) collects portions of the tenured generation at each minor collection. The goal of the incremental collector is to avoid very long major collection pauses by doing portions of the major collection work at each minor collection. The incremental collector will sometimes find that a non-incremental major collection (as is done in the default collector) is required in order to avoid running out of memory.   &lt;br&gt;   &lt;b&gt; 432. When to Use the Incremental Low Pause Collector?  &lt;br&gt; &lt;/b&gt;Use the incremental low pause collector when your application can afford to trade longer and more frequent young generation garbage collection pauses for shorter tenured generation pauses. A typical situation is one in which a larger tenured generation is required (lots of long-lived objects), a smaller young generation will suffice (most objects are short-lived and don&amp;#39;t survive the young generation collection), and only a single processor is available.   &lt;br&gt;   &lt;b&gt; 433. How do you enable the concurrent garbage collector on Sun&amp;#39;s JVM? &lt;br&gt; &lt;/b&gt; -Xconcgc options allows us to use concurrent garbage collector (1.2.2_07+)we can also use -XX:+UseConcMarkSweepGC which is available beginning with J2SE 1.4.1. &lt;br&gt;&lt;br&gt;&lt;br&gt; &lt;b&gt;434. What is a platform?&lt;/b&gt;     A platform is the hardware or software environment in which a program runs. Most platforms can be described as a combination of the operating system and hardware, like Windows 2000 and XP, Linux, Solaris, and MacOS.   &lt;br&gt;   &lt;b&gt;435. What is transient variable?&lt;/b&gt;     Transient variable can&amp;#39;t be serialize. For example if a variable is declared as transient in a Serializable class and the class is written to an ObjectStream, the value of the variable can&amp;#39;t be written to the stream instead when the class is retrieved from the ObjectStream the value of the variable becomes null.   &lt;br&gt;   &lt;b&gt;436. How to make a class or a bean serializable? &lt;/b&gt;   By implementing either the java.io.Serializable interface, or the java.io.Externalizable interface. As long as one class in a class&amp;#39;s inheritance hierarchy implements Serializable or Externalizable, that class is serializable.           &lt;br&gt;   &lt;b&gt;437. What restrictions are placed on method overloading? &lt;/b&gt;   Two methods may not have the same name and argument list but different return types.    &lt;br&gt;   &lt;b&gt;438. Name Container classes.&lt;/b&gt;   Window, Frame, Dialog, FileDialog, Panel, Applet, or ScrollPane     &lt;br&gt;   &lt;b&gt;439. What is the List interface? &lt;/b&gt;    The List interface provides support for ordered collections of objects.    &lt;br&gt;   &lt;b&gt;440. What is the difference between a Scrollbar and a ScrollPane? &lt;/b&gt;   A Scrollbar is a Component, but not a Container. A ScrollPane is a Container. A ScrollPane handles its own events and performs its own scrolling.   &lt;br&gt;   &lt;b&gt;441. What is tunnelling? &lt;/b&gt;    Tunnelling is a route to somewhere. For example, RMI tunnelling is a way to make RMI application get through firewall. In CS world, tunnelling means a way to transfer data.    &lt;br&gt;   &lt;b&gt;442.. What is meant by &amp;quot;Abstract Interface&amp;quot;? &lt;/b&gt;   First, an interface is abstract. That means you cannot have any implementation in an interface. All the methods declared in an interface are abstract methods or signatures of the methods. &lt;br&gt;&lt;br&gt;&lt;br&gt; &lt;b&gt;443. Can Java code be compiled to machine dependent executable file? &lt;/b&gt;   Yes. There are many tools out there. If you did so, the generated exe file would be run in the specific platform, not cross-platform.   &lt;br&gt;   &lt;b&gt;444. Do not use the String contatenation operator in lengthy loops or other places where performance could suffer. Is that true?&lt;/b&gt;     Yes.   &lt;br&gt;   &lt;b&gt;445.   What method is used to specify a container&amp;#39;s layout?   &lt;/b&gt;     The setLayout() method is used to specify a container&amp;#39;s layout.    &lt;br&gt;   &lt;b&gt;446.   Which containers use a FlowLayout as their default layout?    &lt;/b&gt;    The Panel and Applet classes use the FlowLayout as their default layout.     &lt;br&gt;   &lt;b&gt;447.  What state does a thread enter when it terminates its processing?      &lt;/b&gt;    When a thread terminates its processing, it enters the dead state.     &lt;br&gt;   &lt;b&gt;448.  What is the Collections API?       &lt;/b&gt;     The Collections API is a set of classes and interfaces that support operations on collections of objects.    &lt;br&gt;   &lt;b&gt;448.  What is the List interface?     &lt;/b&gt;    The List interface provides support for ordered collections of objects.    &lt;br&gt;   &lt;b&gt;449. Is sizeof a keyword?    &lt;/b&gt;    The sizeof operator is not a keyword in Java.    &lt;br&gt;   &lt;b&gt;450. Which class is the superclass for every class.     &lt;/b&gt;    Object.    &lt;br&gt;   &lt;b&gt;451. Which Container method is used to cause a container to be laid out and redisplayed? &lt;/b&gt;   validate()  &lt;br&gt; &lt;b&gt;452. What&amp;#39;s the difference between a queue and a stack?&lt;/b&gt;    Stacks works by last-in-first-out rule (LIFO), while queues use the FIFO rule    &lt;br&gt;   &lt;b&gt;453. You can create an abstract class that contains only abstract methods. On the other hand, you can create an interface that declares the same methods. So can you use abstract classes instead of interfaces?&lt;/b&gt;   Sometimes. But your class may be a descendent of another class and in this case the interface is your only option.     &lt;br&gt;   &lt;b&gt;454.  What comes to mind when you hear about a young generation in Java?&lt;/b&gt;   Garbage collection.      &lt;br&gt;   &lt;b&gt;454.  What comes to mind when someone mentions a shallow copy in Java?&lt;/b&gt;   Object cloning.     &lt;br&gt;   &lt;b&gt;455.  If you&amp;#39;re overriding the method equals() of an object, which other method you might also consider?&lt;/b&gt;    hashCode()     &lt;br&gt;   &lt;b&gt;456.  You are planning to do an indexed search in a list of objects. Which of the two Java collections should you use: ArrayList or LinkedList?&lt;/b&gt;   ArrayList     &lt;br&gt;   &lt;b&gt;457.  How would you make a copy of an entire Java object with its state?&lt;/b&gt;   Have this class implement Cloneable interface and call its method clone().     &lt;br&gt;   &lt;b&gt;458.  How can you minimize the need of garbage collection and make the memory use more effective?&lt;/b&gt;   Use object pooling and weak object references.     &lt;br&gt;   &lt;b&gt;459. There are two classes: A and B. The class B need to inform a class A when some important event has happened. What Java technique would you use to implement it?&lt;/b&gt;   If these classes are threads I&amp;#39;d consider notify() or notifyAll(). For regular classes you can use the Observer interface.    &lt;br&gt;    &lt;b&gt;460. What access level do you need to specify in the class declaration to ensure that only classes from the same directory can access it?&lt;/b&gt;    You do not need to specify any access level, and Java will use a default package access level. &lt;br&gt;&lt;br&gt;&lt;br&gt; &lt;b&gt;461.  What is the difference between an Interface and an Abstract class? &lt;/b&gt;   An abstract class can have instance methods that implement a default behavior. An Interface can only declare constants and instance methods, but cannot implement default behavior and all methods are implicitly abstract. An interface has all public members and no implementation. An abstract class is a class which may have the usual flavors of class members (private, protected, etc.), but has some abstract methods.   &lt;br&gt;    &lt;b&gt;462.  What is the purpose of garbage collection in Java, and when is it used? &lt;/b&gt;  The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources can be reclaimed and reused. A Java object is subject to garbage collection when it becomes unreachable to the program in which it is used.   &lt;br&gt;   &lt;b&gt;463.  Describe synchronization in respect to multithreading. &lt;/b&gt;  With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchonization, it is possible for one thread to modify a shared variable while another thread is in the process of using or updating same shared variable. This usually leads to significant errors.   &lt;br&gt;   &lt;b&gt;464.  Explain different way of using thread? &lt;/b&gt;   The thread could be implemented by using runnable interface or by inheriting from the Thread class. The former is more advantageous, &amp;#39;cause when you are going for multiple inheritance..the only interface can help.   &lt;br&gt;   &lt;b&gt;465.  What are pass by reference and passby value? &lt;/b&gt;  Pass By Reference means the passing the address itself rather than passing the value. Passby Value means passing a copy of the value to be passed.   &lt;br&gt;   &lt;b&gt;466.  What is HashMap and Map? &lt;/b&gt;  	 Map is Interface and Hashmap is class that implements that.   &lt;br&gt;   &lt;b&gt;467.  Difference between HashMap and HashTable? &lt;/b&gt;   The HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized and permits nulls. (HashMap allows null values as key and value whereas Hashtable doesnt allow). HashMap does not guarantee that the order of the map will remain constant over time. HashMap is unsynchronized and Hashtable is synchronized.   &lt;br&gt;   &lt;b&gt;468.  Difference between Vector and ArrayList? &lt;/b&gt;  	 Vector is synchronized whereas arraylist is not.   &lt;br&gt;   &lt;b&gt;469.  Difference between Swing and Awt? &lt;/b&gt;   AWT are heavy-weight componenets. Swings are light-weight components. Hence swing works faster than AWT.   &lt;br&gt; 	  &lt;b&gt;470.  What is the difference between a constructor and a method? &lt;/b&gt;  A constructor is a member function of a class that is used to create objects of that class. It has the same name as the class itself, has no return type, and is invoked using the new operator. 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. &lt;br&gt; &lt;b&gt;471.  What is an Iterator? &lt;/b&gt;   Some of the collection classes provide traversal of their contents via a java.util.Iterator interface. This interface allows you to walk through a collection of objects, operating on each object in turn. Remember when using Iterators that they contain a snapshot of the collection at the time the Iterator was obtained; generally it is not advisable to modify the collection itself while traversing an Iterator.   &lt;br&gt; 	  &lt;b&gt;472. State the significance of public, private, protected, default modifiers both singly and in combination and state the effect of package relationships on declared items qualified by these modifiers. &lt;/b&gt;  public : Public class is visible in other packages, field is visible everywhere (class must be public too) private : Private variables or methods may be used only by an instance of the same class that declares the variable or method, A private feature may only be accessed by the class that owns the feature. protected : Is available to all classes in the same package and also available to all subclasses of the class that owns the protected feature.This access is provided even to subclasses that reside in a different package from the class that owns the protected feature. default :What you get by default ie, without any access modifier (ie, public private or protected).It means that it is visible to all within a particular package.   &lt;br&gt;   &lt;b&gt;473.  What is an abstract class? &lt;/b&gt;   Abstract class must be extended/subclassed (to be useful). It serves as a template. A class that is abstract may not be instantiated (ie, you may not call its constructor), abstract class may contain static data. Any class with an abstract method is automatically abstract itself, and must be declared as such.&lt;br&gt; A class may be declared abstract even if it has no abstract methods. This prevents it from being instantiated.   &lt;br&gt;	   &lt;b&gt;474.  What is static in java? &lt;/b&gt;   Static means one per class, not one for each object no matter how many instance of a class might exist. This means that you can use them without creating an instance of a class.Static methods are implicitly final, because overriding is done based on the type of the object, and static methods are attached to a class, not an object. A static method in a superclass can be shadowed by another static method in a subclass, as long as the original method was not declared final. However, you can&amp;#39;t override a static method with a nonstatic method. In other words, you can&amp;#39;t change a static method into an instance method in a subclass.   &lt;br&gt;   &lt;b&gt;475.  What is final? &lt;/b&gt;   A final class can&amp;#39;t be extended ie., final class may not be subclassed. A final method can&amp;#39;t be overridden when its class is inherited. You can&amp;#39;t change value of a final variable (is a constant).   &lt;br&gt;   &lt;b&gt;476.  What if the main method is declared as private? &lt;/b&gt;  	 The program compiles properly but at runtime it will give &amp;quot;Main method not public.&amp;quot; message.   &lt;br&gt;   &lt;b&gt;477.  What if the static modifier is removed from the signature of the main method? &lt;/b&gt;  	 Program compiles. But at runtime throws an error &amp;quot;NoSuchMethodError&amp;quot;.   &lt;br&gt;   &lt;b&gt;478.  What if I write static public void instead of public static void? &lt;/b&gt;   	Program compiles and runs properly.   &lt;br&gt;   &lt;b&gt;479.  What if I do not provide the String array as the argument to the method? &lt;/b&gt;  	 	Program compiles but throws a runtime error &amp;quot;NoSuchMethodError&amp;quot;.   &lt;br&gt;   &lt;b&gt;480.  What is the first argument of the String array in main method? &lt;/b&gt;   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;b&gt;481.  If I do not provide any arguments on the command line, then the String array of Main method will be empty or null? &lt;/b&gt;   	It is empty. But not null.   &lt;br&gt;   &lt;b&gt;482.  How can one prove that the array is not null but empty using one line of code? &lt;/b&gt;   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;b&gt;483.  What environment variables do I need to set on my machine in order to be able to run Java programs? &lt;/b&gt;  	 	CLASSPATH and PATH are the two variables.   	   &lt;br&gt;   &lt;b&gt;484.  Can an application have multiple classes having main method? &lt;/b&gt;  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;b&gt;485.  Can I have multiple main methods in the same class? &lt;/b&gt;   No the program fails to compile. The compiler says that the main method is already defined in the class.   &lt;br&gt;   &lt;b&gt;486. Do I need to import java.lang package any time? Why ? &lt;/b&gt;   	No. It is by default loaded internally by the JVM.   &lt;br&gt;   &lt;b&gt;487. Can I import same package/class twice? Will the JVM load the package twice at runtime? &lt;/b&gt;   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;b&gt;488. What are Checked and UnChecked Exception? &lt;/b&gt;   A checked exception is some subclass of Exception (or Exception itself), excluding class RuntimeException and its subclasses. 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&amp;#39;s read() method&amp;middot; 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&amp;#39;t force client programmers either to catch the 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&amp;#39;s charAt() method&amp;middot; Checked exceptions must be caught at compile time. Runtime exceptions do not need to be. Errors often cannot be.   &lt;br&gt;   &lt;b&gt;489. What is Overriding? &lt;/b&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; 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;b&gt;490. What are different types of inner classes? &lt;/b&gt;   	Nested top-level classes, Member classes, Local classes, Anonymous classes &lt;br&gt;&lt;br&gt;Nested top-level classes- If you declare a class within a class and specify the static modifier, the compiler treats the class just like any other top-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. Top-level inner classes implicitly have access only to static variables.There can also be inner interfaces. All of these are of the nested top-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 top-level class. The primary difference between member classes and nested top-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 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;hr size=&quot;1&quot;&gt;&lt;br/&gt;</description></item><item><title>Java</title><link>http://johnj2v.wetpaint.com/page/Java</link><author>vijayavenkatesh.2006</author><guid isPermaLink="false">http://johnj2v.wetpaint.com/page/Java</guid><comments>customise</comments><pubDate>Sat, 30 Dec 2006 00:55:15 CST</pubDate><description>&lt;br&gt;&lt;br&gt;&lt;table align=&quot;center&quot; width=&quot;80%&quot;&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+3&quot;&gt;Question:&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+1&quot;&gt;&lt;br&gt;What  does a well-written OO program look like?(donated in July, 2005)&lt;br&gt;  &lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+2&quot;&gt;Answer:&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+1&quot;&gt;&lt;br&gt;A well-written OO  program exhibits recurring structures that promote abstraction, flexibility,  modularity and elegance. &lt;br&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;&lt;table align=&quot;center&quot; width=&quot;80%&quot;&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+3&quot;&gt;Question:&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+1&quot;&gt;&lt;br&gt;Can  you have virtual functions in Java? (donated in July 2005) &lt;br&gt;  &lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+2&quot;&gt;Answer:&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+1&quot;&gt;&lt;br&gt;Yes, all functions  in Java are virtual by default. This is actually a pseudo trick question because  the word &amp;quot;virtual&amp;quot; is not part of the naming convention in Java ( as it is in  C++, C-sharp and VB.NET), so this would be a foreign concept for someone who has  only coded in Java. Virtual functions or virtual methods are functions or  methods that will be redefined in derived classes.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;&lt;table align=&quot;center&quot; width=&quot;80%&quot;&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+3&quot;&gt;Question:&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+1&quot;&gt;&lt;br&gt;What  is more advisable to create a thread, by implementing a Runnable interface or by  extending Thread class?(donated in June 2005)&lt;br&gt; &lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+2&quot;&gt;Answer:&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+1&quot;&gt;&lt;br&gt;Strategically  speaking, threads created by implementing Runnable interface are more advisable.  If you create a thread by extending a thread class, you cannot extend any other  class. If you create a thread by implementing Runnable interface, you save a  space for your class to extend another class now or in future.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;&lt;table align=&quot;center&quot; width=&quot;80%&quot;&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+3&quot;&gt;Question:&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+1&quot;&gt;&lt;br&gt;An  application needs to load a library before it starts to run, how to  code?&lt;br&gt; &lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+2&quot;&gt;Answer:&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+1&quot;&gt;&lt;br&gt;One option is to  use a static block to load a library before anything is called. For  example,&lt;br&gt;&lt;br&gt;class Test { &lt;br&gt; static {&lt;br&gt;  System.loadLibrary(&amp;quot;path-to-library-file&amp;quot;);&lt;br&gt; }&lt;br&gt; ....&lt;br&gt;}&lt;br&gt;&lt;br&gt;When  you call new Test(), the static block will be called first before any  initialization happens. Note that the static block position may matter.  &lt;br&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;&lt;table align=&quot;center&quot; width=&quot;80%&quot;&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+3&quot;&gt;Question:&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+1&quot;&gt;&lt;br&gt; What is a platform? &lt;br&gt;  &lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+2&quot;&gt;Answer:&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+1&quot;&gt;&lt;br&gt; A platform  is the hardware or software environment in which a program runs. Most platforms  can be described as a combination of the operating system and hardware, like  Windows 2000 and XP, Linux, Solaris, and MacOS. &lt;br&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;&lt;table align=&quot;center&quot; width=&quot;80%&quot;&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+3&quot;&gt;Question:&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+1&quot;&gt;&lt;br&gt; What is the main difference between Java platform  and other platforms? &lt;br&gt; &lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+2&quot;&gt;Answer:&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+1&quot;&gt;&lt;br&gt;The Java platform  differs from most other platforms in that it&amp;#39;s a software-only platform that  runs on top of other hardware-based platforms. &lt;br&gt;&lt;br&gt;The Java platform has two  components: &lt;br&gt;&lt;br&gt;1. The Java Virtual Machine (Java VM) &lt;br&gt;2. The Java  Application Programming Interface (Java API)&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;&lt;table align=&quot;center&quot; width=&quot;80%&quot;&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+3&quot;&gt;Question:&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+1&quot;&gt;&lt;br&gt; What is the Java Virtual Machine? &lt;br&gt;  &lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+2&quot;&gt;Answer:&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+1&quot;&gt;&lt;br&gt;The Java Virtual  Machine is a software that can be ported onto various hardware-based platforms.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;&lt;table align=&quot;center&quot; width=&quot;80%&quot;&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+3&quot;&gt;Question:&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+1&quot;&gt;&lt;br&gt; What is the Java API? &lt;br&gt;  &lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+2&quot;&gt;Answer:&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+1&quot;&gt;&lt;br&gt;The Java API is a  large collection of ready-made software components that provide many useful  capabilities, such as graphical user interface (GUI) widgets. &lt;br&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;&lt;table align=&quot;center&quot; width=&quot;80%&quot;&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+3&quot;&gt;Question:&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+1&quot;&gt;&lt;br&gt; What is the package? &lt;br&gt;  &lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+2&quot;&gt;Answer:&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+1&quot;&gt;&lt;br&gt;The package is a  Java namespace or part of Java libraries. The Java API is grouped into libraries  of related classes and interfaces; these libraries are known as packages. &lt;br&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;&lt;table align=&quot;center&quot; width=&quot;80%&quot;&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+3&quot;&gt;Question:&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+1&quot;&gt;&lt;br&gt; What is the package? &lt;br&gt;  &lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+2&quot;&gt;Answer:&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;font size=&quot;+1&quot;&gt;&lt;br&gt;The package is a  Java namespace or part of Java libraries. The Java API is grouped into libraries  of related classes and interfaces; these libraries are known as packages. &lt;br&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;&lt;br&gt;&lt;hr size=&quot;1&quot;&gt;&lt;br/&gt;</description></item><item><title>Java Question and Answer (II)</title><link>http://johnj2v.wetpaint.com/page/Java+Question+and+Answer+%28II%29</link><author>vijayavenkatesh.2006</author><guid isPermaLink="false">http://johnj2v.wetpaint.com/page/Java+Question+and+Answer+%28II%29</guid><comments>customise</comments><pubDate>Tue, 26 Dec 2006 08:37:21 CST</pubDate><description>&lt;div align=&quot;center&quot;&gt;  &lt;/div&gt;&lt;br&gt;&lt;div align=&quot;center&quot;&gt;     &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;What is the difference between an Interface and an Abstract class? &lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;An abstract class can have instance methods that implement a default behavior. An Interface can only declare constants and instance methods, but cannot implement default behavior and all methods are implicitly abstract. An interface has all public members and no implementation. An abstract class is a class which may have the usual flavors of class members (private, protected, etc.), but has some abstract methods.&lt;br&gt;. &lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;font&gt; &lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;What is the purpose of garbage collection in Java, and when is it used?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources can be reclaimed and reused. A Java object is subject to garbage collection when it becomes unreachable to the program in which it is used. &lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;font&gt; &lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;b&gt;Describe synchronization in respect to multithreading.&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;&lt;font size=&quot;2&quot;&gt;With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchonization, it is possible for one thread to modify a shared variable while another thread is in the process of using or updating same shared variable. This usually leads to significant errors.&lt;/font&gt;&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;  &lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;font&gt; &lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Explain different way of using thread? &lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;The thread could be implemented by using runnable interface or by inheriting from the Thread class. The former is more advantageous, &amp;#39;cause when you are going for multiple inheritance..the only interface can help.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;font&gt; &lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;font size=&quot;2&quot;&gt;What are pass by reference and passby value?&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt; &lt;a&gt;&lt;/a&gt;&lt;/font&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font size=&quot;2&quot;&gt;Pass By Reference means the passing the address itself rather than passing the value. Passby Value means passing a copy of the value to be passed. &lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;font&gt; &lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;What is HashMap and Map?&lt;/font&gt;&lt;/b&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a&gt;&lt;/a&gt;&lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Map is Interface and Hashmap is class that implements that.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;font&gt; &lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Difference between HashMap and HashTable?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;The HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized and permits nulls. (HashMap allows null values as key and value whereas Hashtable doesnt allow). HashMap does not guarantee that the order of the map will remain constant over time. HashMap is unsynchronized and Hashtable is &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;synchronized&lt;/font&gt;. &lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;font&gt; &lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Difference between Vector and ArrayList?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Vector is synchronized whereas arraylist is not.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;font&gt; &lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Difference between Swing and Awt?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;AWT are heavy-weight componenets. Swings are light-weight components. Hence swing works faster than AWT.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;font&gt; &lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;What is the difference between a constructor and a method? &lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;A constructor is a member function of a class that is used to create objects of that class. It has the same name as the class itself, has no return type, and is invoked using the new operator.&lt;br&gt;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.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;font&gt; &lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;What is an Iterator?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Some of the collection classes provide traversal of their contents via a java.util.Iterator interface. This interface allows you to walk through a collection of objects, operating on each object in turn. Remember when using Iterators that they contain a snapshot of the collection at the time the Iterator was obtained; generally it is not advisable to modify the collection itself while traversing an Iterator.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;font&gt; &lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;a&gt;&lt;/a&gt;&lt;/font&gt;&lt;/font&gt;&lt;/b&gt;&lt;/font&gt;&lt;font size=&quot;2&quot;&gt;State the significance of public, private, protected, default modifiers both singly and in combination and state the effect of package relationships on declared items qualified by these modifiers.&lt;/font&gt;&lt;/font&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;i&gt;&lt;b&gt;public : &lt;/b&gt;&lt;/i&gt;Public class is visible in other packages, field is visible everywhere (class must be public too)&lt;br&gt;&lt;i&gt;&lt;b&gt;private :&lt;/b&gt;&lt;/i&gt; Private variables or methods may be used only by an instance of the same class that declares the variable or method, A private feature may only be accessed by the class that owns the feature.&lt;br&gt;&lt;i&gt;&lt;b&gt;protected :&lt;/b&gt;&lt;/i&gt; Is available to all classes in the same package and also available to all subclasses of the class that owns the protected feature.This access is provided even to subclasses that reside in a different package from the class that owns the protected feature.&lt;br&gt;&lt;i&gt;&lt;b&gt;default :&lt;/b&gt;&lt;/i&gt;What you get by default ie, without any access modifier (ie, public private or protected).It means that it is visible to all within a particular package&lt;/font&gt;&lt;/font&gt;.&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;font&gt; &lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;b&gt;What is an abstract class?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;&lt;font size=&quot;2&quot;&gt;Abstract class must be extended/subclassed (to be useful). It serves as a template. A class that is abstract may not be instantiated (ie, you may not call its constructor), abstract class may contain static data. Any class with an abstract method is automatically abstract itself, and must be declared as such.&lt;br&gt;A class may be declared abstract even if it has no abstract methods. This prevents it from being instantiated.&lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;font&gt; &lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;&lt;b&gt;What is static in java?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;Static means one per class, not one for each object no matter how many instance of a class might exist. This means that you can use them without creating an instance of a class.Static methods are implicitly final, because overriding is done based on the type of the object, and static methods are attached to a class, not an object. A static method in a superclass can be shadowed by another static method in a subclass, as long as the original method was not declared final. However, you can&amp;#39;t override a static method with a nonstatic method. In other words, you can&amp;#39;t change a static method into an instance method in a subclass.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;font&gt; &lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;&lt;b&gt;What is final?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;A final class can&amp;#39;t be extended ie., final class may not be subclassed. A final method can&amp;#39;t be overridden when its class is inherited. You can&amp;#39;t change value of a final variable (is a constant&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;  &lt;div align=&quot;center&quot;&gt;  &lt;br&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;What if the main method is declared as private?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;The program compiles properly but at runtime it will give &amp;quot;Main method not public.&amp;quot; message.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What if the static modifier is removed from the signature of the main method?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Program compiles. But at runtime throws an error &amp;quot;NoSuchMethodError&amp;quot;. &lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;What if I write static public void instead of public static void?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Program compiles and runs properly. &lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;What if I do not provide the String array as the argument to the method?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Program compiles but throws a runtime error &amp;quot;NoSuchMethodError&amp;quot;. &lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;What is the first argument of the String array in main method?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;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;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;If I do not provide any arguments on the command line, then the String array of Main method will be empty or null?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;It is empty. But not null.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;How can one prove that the array is not null but empty using one line of code?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;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;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What environment variables do I need to set on my machine in order to be able to run Java programs?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;CLASSPATH and PATH are the two variables.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Can an application have multiple classes having main method?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;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;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Can I have multiple main methods in the same class?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;No the program fails to compile. The compiler says that the main method is already defined in the class.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;Do I need to import java.lang package any time? Why ?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;No. It is by default loaded internally by the JVM.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;Can I import same package/class twice? Will the JVM load the package twice at runtime?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;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;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;What are Checked and UnChecked Exception?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;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&amp;#39;s read() method&amp;middot;&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&amp;#39;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&amp;#39;s charAt() method&amp;middot; Checked exceptions must be caught at compile time. Runtime exceptions do not need to be. Errors often cannot be.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;font&gt; &lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;What is Overriding?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&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;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;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_2.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;font&gt; &lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;&gt;&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;What are different types of inner classes?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;i&gt;Nested top-level classes&lt;/i&gt;, &lt;i&gt;Member classes, Local classes, Anonymous classes&lt;/i&gt;&lt;/font&gt;&lt;br&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;i&gt;Nested top-level classes&lt;/i&gt;&lt;/b&gt;- If you declare a class within a class and specify the static modifier, the compiler treats the class just like any other top-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. Top-level inner classes implicitly have access only to static variables.There can also be inner interfaces. All of these are of the nested top-level variety.&lt;br&gt;&lt;br&gt;&lt;i&gt;&lt;b&gt;Member classes&lt;/b&gt;&lt;/i&gt; - 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 top-level class. The primary difference between member classes and nested top-level classes is that member classes have access to the specific instance of the enclosing class.&lt;br&gt;&lt;br&gt;&lt;b&gt;&lt;i&gt;Local classes&lt;/i&gt;&lt;/b&gt; - 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;&lt;i&gt;&lt;b&gt;Anonymous classes&lt;/b&gt;&lt;/i&gt; - Anonymous inner classes extend local inner classes one level further. As anonymous classes have no name, you cannot provide a constructor.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;  &lt;div align=&quot;center&quot;&gt;  &lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Are the imports checked for validity at compile time? e.g. will the code containing an import such as java.lang.ABCD compile?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Yes the imports are checked for the semantic validity at compile time. The code containing above line of import will not compile. It will throw an error saying,can not resolve symbol&lt;br&gt;symbol : class ABCD&lt;br&gt;location: package io&lt;br&gt;import java.io.ABCD; &lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;Does importing a package imports the subpackages as well? e.g. Does importing com.MyTest.* also import com.MyTest.UnitTests.*?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;No you will have to import the subpackages explicitly. Importing com.MyTest.* will import classes in the package MyTest only. It will not import any class in any of it&amp;#39;s subpackage.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What is the difference between declaring a variable and defining a variable?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;In declaration we just mention the type of the variable and it&amp;#39;s name. We do not initialize it. But defining means declaration + initialization.&lt;br&gt;e.g String s; is just a declaration while String s = new String (&amp;quot;abcd&amp;quot;); Or String s = &amp;quot;abcd&amp;quot;; are both definitions.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What is the default value of an object reference declared as an instance variable?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;null unless we define it explicitly.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Can a top level class be private or protected?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;No. A top level class can not be private or protected. It can have either &amp;quot;public&amp;quot; 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 the compiler will complain that the &amp;quot;modifier private is not allowed here&amp;quot;. This means that a top level class can not be private. Same is the case with protected.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What type of parameter passing does Java support?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;In Java the arguments are always passed by value .&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Update from Eki and Jyothish Venu]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Primitive data types are passed by reference or pass by value?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Primitive data types are passed by value.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;Objects are passed by value or by reference?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Java only supports pass by value. With objects, the object reference itself is passed by value and so both the original reference and parameter copy both refer to the same object .&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Update from Eki and Jyothish Venu]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What is serialization?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Serialization is a mechanism by which you can save the state of an object by converting it to a byte stream.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;How do I serialize an object to a file?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;The class whose instances are to be serialized should implement an interface Serializable. Then you pass the instance to the ObjectOutputStream which is connected to a fileoutputstream. This will save the object to a file.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;Which methods of Serializable interface should I implement?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;The serializable interface is an empty interface, it does not contain any methods. So we do not implement any methods.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;How can I customize the seralization process? i.e. how can one have a control over the serialization process?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Yes it is possible to have control over serialization process. The class should implement Externalizable interface. This interface contains two methods namely readExternal and writeExternal. You should implement these methods and write the logic for customizing the serialization process.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What is the common usage of serialization?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Whenever an object is to be sent over the network, objects need to be serialized. Moreover if the state of an object is to be saved, objects need to be serilazed.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What is Externalizable interface?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&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;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;When you serialize an object, what happens to the object references included in the object?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;The serialization mechanism generates an object graph for serialization. Thus it determines whether the included object references are serializable or not. This is a recursive process. Thus when an object is serialized, all the included objects are also serialized alongwith the original obect.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What one should take care of while serializing the object?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;One should make sure that all the included objects are also serializable. If any of the objects is not serializable then it throws a NotSerializableException.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What happens to the static fields of a class during serialization? &lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;There are three exceptions in which serialization doesnot necessarily read and write to the stream. These are&lt;br&gt;1. Serialization &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;ignores static fields, because they are not part of ay particular state state.&lt;br&gt;2. Base class fields are only hendled if the base class itself is serializable.&lt;br&gt;3. Transient fields. &lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale Modified after P.John David comments.]&lt;/font&gt; &lt;/div&gt;  &lt;div align=&quot;left&quot;&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_3.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;  &lt;div align=&quot;center&quot;&gt; &lt;/div&gt;  &lt;div align=&quot;center&quot;&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Does Java provide any construct to find out the size of an object?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;No there is not sizeof operator in Java. So there is not direct way to determine the size of an object directly in Java.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;Give a simplest way to find out the time a method takes for execution without using any profiling tool?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Read the system time just before the method is invoked and immediately after method returns. Take the time difference, which will give you the time taken by a method for execution.&lt;/font&gt;   T&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;o put it in code...&lt;/font&gt;&lt;br&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;long start = System.currentTimeMillis ();&lt;br&gt;method ();&lt;br&gt;long end = System.currentTimeMillis ();&lt;/font&gt;&lt;br&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;System.out.println (&amp;quot;Time taken for execution is &amp;quot; + (end - start));&lt;/font&gt;&lt;br&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Remember that if the time taken for execution is too small, it might show that it is taking zero milliseconds for execution. Try it on a method which is big enough, in the sense the one which is doing considerable amout of processing.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What are wrapper classes?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Java provides specialized classes corresponding to each of the primitive data types. These are called wrapper classes. They are e.g. Integer, Character, Double etc.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;Why do we need wrapper classes?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&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 resons 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;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;What are checked exceptions?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Checked exception are those which the Java compiler forces you to catch. e.g. IOException are checked Exceptions.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What are runtime exceptions?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&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;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;What is the difference between error and an exception?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;An error is an irrecoverable condition occurring at runtime. Such as OutOfMemory error. These JVM errors and you can not repair them at runtime. While exceptions are conditions that occur because of bad input etc. e.g. FileNotFoundException will be thrown if the specified file does not exist. Or a NullPointerException will take place if you try using a null reference. In most of the cases it is possible to recover from an exception (probably by giving user a feedback for entering proper values etc.).&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;How to create custom exceptions?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Your class should extend class Exception, or some more specific type thereof.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;If I want an object of my class to be thrown as an exception object, what should I do?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;The class should extend from Exception class. Or you can extend your class from some more precise exception type also.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;If my class already extends from some other class what should I do if I want an instance of my class to be thrown as an exception object?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;One can not do anytihng in this scenarion. Because Java does not allow multiple inheritance and does not provide any exception interface as well.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;How does an exception permeate through the code?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;An unhandled exception moves up the method stack in search of a matching When an exception is thrown from a code which is wrapped in a try block followed by one or more catch blocks, a search is made for matching catch block. If a matching type is found then that block will be invoked. If a matching type is not found then the exception moves up the method stack and reaches the caller method. Same procedure is repeated if the caller method is included in a try catch block. This process continues until a catch block handling the appropriate type of exception is found. If it does not find such a block then finally the program terminates.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What are the different ways to handle exceptions?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&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 hadle those exceptions.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What is the basic difference between the 2 approaches to exception handling.&lt;br&gt;1&amp;gt; try catch block and &lt;br&gt;2&amp;gt; specifying the candidate exceptions in the throws clause?&lt;br&gt;When should you use which approach?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;In the first approach as a programmer of the method, you urself are dealing with the exception. This is fine if you are in a best position to decide should be done in case of an exception. Whereas if it is not the responsibility of the method to deal with it&amp;#39;s own exceptions, then do not use this approach. In this case use the second approach. In the second approach we are forcing the caller of the method to catch the exceptions, that the method is likely to throw. This is often the approach library creators use. They list the exception in the throws clause and we must catch them. You will find the same approach throughout the java libraries we use.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;Is it necessary that each try block must be followed by a catch block?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;It is not necessary that each try block must be followed by a catch block. It should be followed by either a catch block OR a finally block. And whatever exceptions are likely to be thrown should be declared in the throws clause of the method.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;If I write return at the end of the try block, will the finally block still execute?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Yes even if you write return as the last statement in the try block and no exception occurs, the finally block will execute. The finally block will execute and then the control return.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;If I write System.exit (0); at the end of the try block, will the finally block still execute?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;No in this case the finally block will not execute because when you say System.exit (0); the control immediately goes out of the program, and thus finally never executes.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td width=&quot;43%&quot;&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td width=&quot;54%&quot;&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_4.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;  &lt;div align=&quot;center&quot;&gt; &lt;/div&gt;  &lt;div align=&quot;center&quot;&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;How are Observer and Observable used?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&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;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[Received from &lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Venkateswara Manam&lt;/font&gt;&lt;/a&gt;]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What is synchronization and why is it important?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;With respect to multithreading, synchronization is the capability to control&lt;br&gt;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&amp;#39;s value. This often leads to significant errors.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Venkateswara Manam&lt;/font&gt;&lt;/a&gt;]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;How does Java handle integer overflows and underflows?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;It uses those low order bytes of the result that can fit into the size of the type allowed by the operation.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Venkateswara Manam&lt;/font&gt;&lt;/a&gt;]&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;Does garbage collection guarantee that a program will not run out of memory?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Garbage collection does not guarantee that a program will not run out of memory. It is possible for programs to use up memory resources faster than they are garbage collected. It is also possible for programs to create objects that are not subject to garbage collection&lt;br&gt;.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Venkateswara Manam&lt;/font&gt;&lt;/a&gt;]&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What is the difference between preemptive scheduling and time slicing?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Under preemptive scheduling, the highest priority task executes until it enters the waiting or dead states or a higher priority task comes into existence. Under time slicing, a task executes for a predefined slice of time and then reenters the pool of ready tasks. The scheduler then determines which task should execute next, based on priority and other factors.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Venkateswara Manam&lt;/font&gt;&lt;/a&gt;]&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;When a thread is created and started, what is its initial state?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;A thread is in the ready state after it has been created and started.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Venkateswara Manam&lt;/font&gt;&lt;/a&gt;]&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;What is the purpose of finalization?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;The purpose of finalization is to give an unreachable object the opportunity to perform any cleanup processing before the object is garbage collected.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Venkateswara Manam&lt;/font&gt;&lt;/a&gt;]&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What is the Locale class?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;The Locale class is used to tailor program output to the conventions of a particular geographic, political, or cultural region.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Venkateswara Manam&lt;/font&gt;&lt;/a&gt;]&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What is the difference between a while statement and a do statement?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;A while statement checks at the beginning of a loop to see whether the next loop iteration should occur. A do statement checks at the end of a loop to see whether the next iteration of a loop should occur. The do statement will always execute the body of a loop at least once.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Venkateswara Manam&lt;/font&gt;&lt;/a&gt;]&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What is the difference between static and non-static variables?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;A static variable is associated with the class as a whole rather than with specific instances of a class. Non-static variables take on unique values with each object instance.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Venkateswara Manam&lt;/font&gt;&lt;/a&gt;]&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;How are this() and super() used with constructors?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;This() is used to invoke a constructor of the same class. super() is used to invoke a superclass constructor.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Venkateswara Manam&lt;/font&gt;&lt;/a&gt;]&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What are synchronized methods and synchronized statements?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&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&amp;#39;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;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Venkateswara Manam&lt;/font&gt;&lt;/a&gt;]&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What is daemon thread and which method is used to create the daemon thread?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Daemon thread is a low priority thread which runs intermittently in the back ground doing the garbage collection operation for the java runtime system. setDaemon method is used to create a daemon thread.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Shipra Kamra&lt;/font&gt;&lt;/a&gt;]&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;Can applets communicate with each other?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;At this point in time applets may communicate with other applets running in the same virtual machine. If the applets are of the same class, they can communicate via shared static variables. If the applets are of different classes, then each will need a reference to the same class with static variables. In any case the basic idea is to pass the information back and forth through a static variable.&lt;/font&gt; &lt;br&gt;&lt;br&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;An applet can also get references to all other applets on the same page using the getApplets() method of java.applet.AppletContext. Once you get the reference to an applet, you can communicate with it by using its public members.&lt;/font&gt; &lt;br&gt;&lt;br&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;It is conceivable to have applets in different virtual machines that talk to a server somewhere on the Internet and store any data that needs to be serialized there. Then, when another applet needs this data, it could connect to this same server. Implementing this is non-trivial. &lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Krishna Kumar &lt;/font&gt;&lt;/a&gt;]&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What are the steps in the JDBC connection?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;  &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;While making a JDBC connection we go through the following steps :&lt;/font&gt; &lt;br&gt;&lt;br&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Step 1 : Register the database driver by using :&lt;/font&gt;   &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Class.forName(\&amp;quot; driver classs for that specific database\&amp;quot; );&lt;/font&gt;&lt;br&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Step 2 : Now create a database connection using :&lt;/font&gt;&lt;br&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Connection con = DriverManager.getConnection(url,username,password);&lt;/font&gt;&lt;br&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Step 3: Now Create a query using :&lt;/font&gt;&lt;br&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Statement stmt = Connection.Statement(\&amp;quot;select * from TABLE NAME\&amp;quot;);&lt;/font&gt;&lt;br&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Step 4 : Exceute the query :&lt;/font&gt;&lt;br&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;stmt.exceuteUpdate();&lt;br&gt;&lt;br&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Shri Prakash Kunwar]&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;How does a try statement determine which catch clause should be used to handle an exception?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;When an exception is thrown within the body of a try statement, the catch clauses of the try statement are examined in the order in which they appear. The first catch clause that is capable of handling the exceptionis executed. The remaining catch clauses are ignored.&lt;br&gt;&lt;br&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;P Rajesh]&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_5.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;  &lt;div align=&quot;center&quot;&gt; &lt;/div&gt;  &lt;div align=&quot;center&quot;&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Can an unreachable object become reachable again?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;An unreachable object may become reachable again. This can happen when the object&amp;#39;s finalize() method is invoked and the object performs an operation which causes it to become accessible to reachable objects.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[Received from &lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;P Rajesh&lt;/font&gt;&lt;/a&gt;]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_6.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What method must be implemented by all threads?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;All tasks must implement the run() method, whether they are a subclass of Thread or implement the &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Runnable interface.&lt;br&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_6.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;P Rajesh&lt;/font&gt;&lt;/a&gt;]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_6.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What are synchronized methods and synchronized statements?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&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&amp;#39;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;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_6.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;P Rajesh&lt;/font&gt;&lt;/a&gt;]&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_6.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What is Externalizable? &lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Externalizable is an Interface that extends Serializable Interface. And sends data into Streams in Compressed Format. It has two methods, writeExternal(ObjectOuput out) and readExternal(ObjectInput in) &lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_6.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Venkateswara Manam&lt;/font&gt;&lt;/a&gt;]&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_6.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What modifiers are allowed for methods in an Interface?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Only public and abstract modifiers are allowed for methods in interfaces. &lt;br&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_6.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;P Rajesh&lt;/font&gt;&lt;/a&gt;]&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_6.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What are some alternatives to inheritance?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Delegation is an alternative to inheritance. Delegation means that you include an instance of another class as an instance variable, and forward messages to the instance. It is often safer than inheritance because it forces you to think about each message you forward, because the instance is of a known class, rather than a new class, and because it doesn&amp;#39;t force you to accept all the methods of the super class: you can provide only the methods that really make sense. On the other hand, it makes you write more code, and it is harder to re-use (because it is not a subclass).&lt;br&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_6.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;P Rajesh&lt;/font&gt;&lt;/a&gt;]&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_6.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;What does it mean that a method or field is &amp;quot;static&amp;quot;? &lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Static variables and methods are instantiated only once per class. In other words they are class variables, not instance variables. If you change the value of a static variable in a particular object, the value of that variable changes for all instances of that class. &lt;/font&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Static methods can be referenced with the name of the class rather than the name of a particular object of the class (though that works too). That&amp;#39;s how library methods like System.out.println() work out is a static field in the java.lang.System class. &lt;br&gt;&lt;br&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_6.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;P Rajesh&lt;/font&gt;&lt;/a&gt;]&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_6.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What is the difference between preemptive scheduling and time slicing?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Under preemptive scheduling, the highest priority task executes until it enters the waiting or dead states or a higher priority task comes into existence. Under time slicing, a task executes for a predefined slice of time and then reenters the pool of ready tasks. The scheduler then determines which task should execute next, based on priority and other factors. &lt;br&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_6.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;P Rajesh&lt;/font&gt;&lt;/a&gt;]&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_6.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What is the catch or declare rule for method declarations? &lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;If a checked exception may be thrown within the body of a method, the method must either catch the exception or declare it in its throws clause. &lt;br&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_6.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;P Rajesh&lt;/font&gt;&lt;/a&gt;]&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_6.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;  &lt;div align=&quot;center&quot;&gt; &lt;/div&gt;  &lt;div align=&quot;center&quot;&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Is Empty .java file a valid source file?&lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Yes, an empty .java file is a perfectly valid source file.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[Received from Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;Can a .java file contain more than one java classes?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Yes, a .java file contain more than one java classes, provided at the most one of them is a public class.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from Sandesh Sadhale]&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;Is String a primitive data type in Java?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;No String is not a primitive data type in Java, even though it is one of the most extensively used object. Strings in Java are instances of String class defined in java.lang package.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;Is main a keyword in Java? &lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;No, main is not a keyword in Java. &lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Sandesh Sadhale]&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;Is next a keyword in Java?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;No, next is not a keyword. &lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;Is delete a keyword in Java?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;No, delete is not a keyword in Java. Java does not make use of explicit destructors the way C++ does.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Is exit a keyword in Java? &lt;a&gt;&lt;/a&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;No. To exit a program explicitly you use exit method in System object.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Sandesh Sadhale]&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What happens if you dont initialize an instance variable of any of the primitive types in Java?&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Java by default initializes it to the default value for that primitive type. Thus an int will be initialized to 0, a boolean will be initialized to false. &lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Sandesh Sadhale]&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What will be the initial value of an object reference which is defined as an instance variable? &lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;The object references are all initialized to null in Java. However in order to do anything useful with these references, you must set them to a valid object, else you will get NullPointerExceptions everywhere you try to use such default initialized references.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Sandesh Sadhale]&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What are the different scopes for Java variables? &lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;The scope of a Java variable is determined by the context in which the variable is declared. Thus a java variable can have one of the three scopes at any given point in time.&lt;br&gt;1. Instance : - These are typical object level variables, they are initialized to default values at the time of creation of object, and remain accessible as long as the object accessible.&lt;br&gt;2. Local : - These are the variables that are defined within a method. They remain accessbile only during the course of method excecution. When the method finishes execution, these variables fall out of scope.&lt;br&gt;3. Static: - These are the class level variables. They are initialized when the class is loaded in JVM for the first time and remain there as long as the class remains loaded. They are not tied to any particular object instance.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Sandesh Sadhale]&lt;/font&gt; &lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What is the default value of the local variables? &lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;The local variables are not initialized to any default value, neither primitives nor object references. If you try to use these variables without initializing them explicitly, the java compiler will not compile the code. It will complain abt the local varaible not being initilized..&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Sandesh Sadhale]&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;How many objects are created in the following piece of code?&lt;br&gt;MyClass c1, c2, c3;&lt;br&gt;c1 = new MyClass ();&lt;br&gt;c3 = new MyClass ();&lt;br&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Only 2 objects are created, c1 and c3. The reference c2 is only declared and not initialized.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Sandesh Sadhale]&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;Can a public class MyClass be defined in a source file named YourClass.java? &lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;No the source file name, if it contains a public class, must be the same as the public class name itself with a .java extension.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Sandesh Sadhale]&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;Can main method be declared final? &lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Yes, the main method can be declared final, in addition to being public static.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Sandesh Sadhale]&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What will be the output of the following statement?&lt;br&gt;System.out.println (&amp;quot;1&amp;quot; + 3); &lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;It will print 13.&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Sandesh Sadhale]&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br&gt;  &lt;table class=&quot;bodytext&quot; width=&quot;100%&quot;&gt;  &lt;tbody&gt;  &lt;tr&gt;  &lt;td width=&quot;3%&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td class=&quot;bodytext&quot; width=&quot;97%&quot;&gt;  &lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;What will be the default values of all the elements of an array defined as an instance variable? &lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;b&gt;A:&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;If the array is an array of primitive types, then all the elements of the array will be initialized to the default value corresponding to that primitive type. e.g. All the elements of an array of int will be initialized to 0, while that of boolean type will be initialized to false. Whereas if the array is an array of references (of any type), all the elements will be initialized to null. &lt;/font&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;  &lt;tr&gt;  &lt;td&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;left&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;/font&gt;&lt;/a&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;[ Received from &lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;/font&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;&lt;a href=&quot;http://johnj2v.wetpaint.commailto:mv_babu@yahoo.com&quot; target=&quot;_top&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;2&quot;&gt;Sandesh Sadhale]&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;  &lt;td&gt;  &lt;div align=&quot;right&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.allapplabs.com/interview_questions/java_interview_questions_7.htm#top&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;font face=&quot;Verdana, Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;&gt;&lt;b&gt;TOP &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;  &lt;div align=&quot;center&quot;&gt; &lt;/div&gt;  &lt;div align=&quot;center&quot;&gt; &lt;/div&gt;  &lt;div align=&quot;center&quot;&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://adopt.euroclick.com/lnk/?k=MjkyMTszMzU0OzMzODY7ODUzODtmLmYuOS5ybS5nbS5mQEB5aWx6d3l6bXdAQHhzdm1tenJAQDRfNkBAZXJ3dmhzIGh6bXhzemkgbXJ0em4gb2d3XyB6Zmc7MTE1OTg1Nzk5NDY5NTsxOzs7OzI7MjQ5OTc2Ng==href=http://www.answers.com/main/product_info.jsp&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt; &lt;/a&gt;&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;div align=&quot;right&quot;&gt;see more question in this page....&lt;/div&gt;  &lt;div align=&quot;right&quot;&gt; &lt;/div&gt;&lt;br&gt;&lt;div align=&quot;center&quot;&gt;  &lt;/div&gt;&lt;hr size=&quot;1&quot;&gt;&lt;br/&gt;</description></item><item><title>Java Question and Answer for Interview</title><link>http://johnj2v.wetpaint.com/page/Java+Question+and+Answer+for+Interview</link><author>vijayavenkatesh.2006</author><guid isPermaLink="false">http://johnj2v.wetpaint.com/page/Java+Question+and+Answer+for+Interview</guid><comments>Customise</comments><pubDate>Fri, 08 Dec 2006 08:55:37 CST</pubDate><description>&lt;br&gt;&lt;b&gt;What&amp;#39;s Java?&lt;/b&gt; &lt;br&gt;Java is an object-oriented programming language developed initially by James Gosling and colleagues at Sun Microsystems. The language, initially called Oak (named after the oak trees outside Gosling&amp;#39;s office), was intended to replace C++, although the feature set better resembles that of Objective C. Java should not be confused with JavaScript, which shares only the name and a similar C-like syntax. Sun Microsystems currently maintains and updates Java regularly.    &lt;br&gt;&lt;b&gt;1. What does a well-written OO program look like?&lt;/b&gt; &lt;br&gt;A well-written OO program exhibits recurring structures that promote abstraction, flexibility, modularity and elegance.    &lt;br&gt;&lt;b&gt;2. Can you have virtual functions in Java?&lt;/b&gt; &lt;br&gt;Yes, all functions in Java are virtual by default. This is actually a pseudo trick question because the word &amp;quot;virtual&amp;quot; is not part of the naming convention in Java (as it is in C++, C-sharp and VB.NET), so this would be a foreign concept for someone who has only coded in Java. Virtual functions or virtual methods are functions or methods that will be redefined in derived classes.    &lt;br&gt;&lt;b&gt;3. Jack developed a program by using a Map container to hold key/value pairs. He wanted to make a change to the map. He decided to make a clone of the map in order to save the original data on side. What do you think of it? ?&lt;/b&gt; &lt;br&gt;If Jack made a clone of the map, any changes to the clone or the original map would be seen on both maps, because the clone of Map is a shallow copy. So Jack made a wrong decision.    &lt;br&gt;&lt;b&gt;4. What is more advisable to create a thread, by implementing a Runnable interface or by extending Thread class?&lt;/b&gt; &lt;br&gt;Strategically speaking, threads created by implementing Runnable interface are more advisable. If you create a thread by extending a thread class, you cannot extend any other class. If you create a thread by implementing Runnable interface, you save a space for your class to extend another class now or in future.    &lt;br&gt;&lt;b&gt;5. What is NullPointerException and how to handle it?&lt;/b&gt; &lt;br&gt;When an object is not initialized, the default value is null. When the following things happen, the NullPointerException is thrown: &lt;br&gt;--Calling the instance method of a null object.&lt;br&gt;--Accessing or modifying the field of a null object.&lt;br&gt;--Taking the length of a null as if it were an array.&lt;br&gt;--Accessing or modifying the slots of null as if it were an array.&lt;br&gt;--Throwing null as if it were a Throwable value.&lt;br&gt;The NullPointerException is a runtime exception. The best practice is to catch such exception even if it is not required by language design.    &lt;br&gt;&lt;b&gt;6. An application needs to load a library before it starts to run, how to code??&lt;/b&gt; &lt;br&gt;One option is to use a static block to load a library before anything is called. For example, &lt;br&gt;class Test { &lt;br&gt;static {&lt;br&gt;System.loadLibrary(&amp;quot;path-to-library-file&amp;quot;);&lt;br&gt;}&lt;br&gt;....&lt;br&gt;} &lt;br&gt;When you call new Test(), the static block will be called first before any initialization happens. Note that the static block position may matter.    &lt;br&gt;&lt;b&gt;7. How could Java classes direct program messages to the system console, but error messages, say to a file?&lt;/b&gt; &lt;br&gt;The class System has a variable out that represents the standard output, and the variable err that represents the standard error device. By default, they both point at the system console. This how the standard output could be re-directed: &lt;br&gt;Stream st = new Stream(new FileOutputStream(&amp;quot;output.txt&amp;quot;)); System.setErr(st); System.setOut(st);    &lt;br&gt;&lt;b&gt;8. What&amp;#39;s the difference between an interface and an abstract class?&lt;/b&gt; &lt;br&gt;An abstract class may contain code in method bodies, which is not allowed in an interface. With abstract classes, you have to inherit your class from it and Java does not allow multiple inheritance. On the other hand, you can implement multiple interfaces in your class.    &lt;br&gt;&lt;b&gt;9. Name the containers which uses Border Layout as their default layout?&lt;/b&gt; &lt;br&gt;Containers which uses Border Layout as their default are: window, Frame and Dialog classes.    &lt;br&gt;&lt;b&gt;10. What do you understand by Synchronization?&lt;/b&gt; &lt;br&gt;Synchronization is a process of controlling the access of shared resources by the multiple threads in such a manner that only one thread can access one resource at a time. In non synchronized multithreaded application, it is possible for one thread to modify a shared object while another thread is in the process of using or updating the object&amp;#39;s value.&lt;br&gt;Synchronization prevents such type of data corruption.&lt;br&gt;E.g. Synchronizing a function:&lt;br&gt;public synchronized void Method1 () {&lt;br&gt;// Appropriate method-related code. &lt;br&gt;}&lt;br&gt;E.g. Synchronizing a block of code inside a function:&lt;br&gt;public myFunction (){&lt;br&gt;synchronized (this) { &lt;br&gt;// Synchronized code here.&lt;br&gt;}&lt;br&gt;}   &lt;br&gt;&lt;b&gt;11. What is Collection API?&lt;/b&gt; &lt;br&gt;Answer: The Collection API is a set of classes and interfaces that support operation on collections of objects. These classes and interfaces are more flexible, more powerful, and more regular than the vectors, arrays, and hashtables if effectively replaces. &lt;br&gt;Example of classes: HashSet, HashMap, ArrayList, LinkedList, TreeSet and TreeMap.&lt;br&gt;Example of interfaces: Collection, Set, List and Map.   &lt;br&gt;&lt;b&gt;12. Is Iterator a Class or Interface? What is its use?&lt;/b&gt; &lt;br&gt;Answer: Iterator is an interface which is used to step through the elements of a Collection.    &lt;br&gt;&lt;b&gt;13. What is similarities/difference between an Abstract class and Interface?&lt;/b&gt; &lt;br&gt;Differences are as follows: &lt;br&gt;Interfaces provide a form of multiple inheritance. A class can extend only one other class. Interfaces are limited to public methods and constants with no implementation. Abstract classes can have a partial implementation, protected parts, static methods, etc. &lt;br&gt;A Class may implement several interfaces. But in case of abstract class, a class may extend only one abstract class. Interfaces are slow as it requires extra indirection to to find corresponding method in in the actual class. Abstract classes are fast. &lt;br&gt;Similarities: &lt;br&gt;&lt;br&gt;Neither Abstract classes or Interface can be instantiated.    &lt;br&gt;&lt;b&gt;14. How to define an Abstract class?&lt;/b&gt; &lt;br&gt;A class containing abstract method is called Abstract class. An Abstract class can&amp;#39;t be instantiated.&lt;br&gt;Example of Abstract class:&lt;br&gt;abstract class testAbstractClass {&lt;br&gt;protected String myString; &lt;br&gt;public String getMyString() { &lt;br&gt;return myString; &lt;br&gt;} &lt;br&gt;public abstract string anyAbstractFunction();&lt;br&gt;}    &lt;br&gt;&lt;b&gt;15. How to define an Interface?&lt;/b&gt; &lt;br&gt;In Java Interface defines the methods but does not implement them. Interface can include constants. A class that implements the interfaces is bound to implement all the methods defined in Interface.&lt;br&gt;Emaple of Interface:&lt;br&gt;&lt;br&gt;public interface sampleInterface {&lt;br&gt;public void functionOne();&lt;br&gt;&lt;br&gt;public long CONSTANT_ONE = 1000; &lt;br&gt;}&lt;br&gt;&lt;br&gt;&lt;b&gt;16. If a class is located in a package, what do you need to change in the OS environment to be able to use it? &lt;/b&gt;&lt;br&gt;You need to add a directory or a jar file that contains the package directories to the CLASSPATH environment variable. Let&amp;#39;s say a class Employee belongs to a package com.xyz.hr; and is located in the file c:\dev\com\xyz\hr\Employee.java. In this case, you&amp;#39;d need to add c:\dev to the variable CLASSPATH. If this class contains the method main(), you could test it from a command prompt window as follows:&lt;br&gt;c:\&amp;gt;java com.xyz.hr.Employee    &lt;br&gt;&lt;b&gt;17. How many methods in the Serializable interface? &lt;/b&gt;&lt;br&gt;There is no method in the Serializable interface. The Serializable interface acts as a marker, telling the object serialization tools that your class is serializable.    &lt;br&gt;&lt;b&gt;18. How many methods in the Externalizable interface? &lt;/b&gt;&lt;br&gt;There are two methods in the Externalizable interface. You have to implement these two methods in order to make your class externalizable. These two methods are readExternal() and writeExternal().    &lt;br&gt;&lt;b&gt;19. What is the difference between Serializalble and Externalizable interface? &lt;/b&gt;&lt;br&gt;When you use Serializable interface, your class is serialized automatically by default. But you can override writeObject() and readObject() two methods to control more complex object serailization process. When you use Externalizable interface, you have a complete control over your class&amp;#39;s serialization process.    &lt;br&gt;&lt;b&gt;20. What is a transient variable? &lt;/b&gt;&lt;br&gt;A transient variable is a variable that may not be serialized. If you don&amp;#39;t want some field to be serialized, you can mark that field transient or static.    &lt;br&gt;&lt;b&gt;21. Which containers use a border layout as their default layout?&lt;/b&gt; &lt;br&gt;The Window, Frame and Dialog classes use a border layout as their default layout.    &lt;br&gt;&lt;b&gt;22. How are Observer and Observable used? &lt;/b&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;b&gt;23. What is synchronization and why is it important? &lt;/b&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&amp;#39;s value. This often causes dirty data and leads to significant errors.    &lt;br&gt;&lt;b&gt;24. What are synchronized methods and synchronized statements? &lt;/b&gt;&lt;br&gt;Synchronized methods are methods that are used to control access to a method or an object. A thread only executes a synchronized method after it has acquired the lock for the method&amp;#39;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;b&gt;25. What are three ways in which a thread can enter the waiting state? &lt;/b&gt;&lt;br&gt;A thread can enter the waiting state by invoking its sleep() method, by blocking on IO, by unsuccessfully attempting to acquire an object&amp;#39;s lock, or by invoking an object&amp;#39;s wait() method. It can also enter the waiting state by invoking its (deprecated) suspend() method.    &lt;br&gt;&lt;b&gt;26. Can a lock be acquired on a class? &lt;/b&gt;&lt;br&gt;Yes, a lock can be acquired on a class. This lock is acquired on the class&amp;#39;s Class object.    &lt;br&gt;&lt;b&gt;27. What&amp;#39;s new with the stop(), suspend() and resume() methods in JDK 1.2? &lt;/b&gt;&lt;br&gt;The stop(), suspend() and resume() methods have been deprecated in JDK 1.2.    &lt;br&gt;&lt;b&gt;28. What is the preferred size of a component? &lt;/b&gt;&lt;br&gt;The preferred size of a component is the minimum component size that will allow the component to display normally.    &lt;br&gt;&lt;b&gt;29. What&amp;#39;s the difference between J2SDK 1.5 and J2SDK 5.0? &lt;/b&gt;&lt;br&gt;There&amp;#39;s no difference, Sun Microsystems just re-branded this version.    &lt;br&gt;&lt;b&gt;30. What would you use to compare two String variables - the operator == or the method equals()? &lt;/b&gt;&lt;br&gt;I&amp;#39;d use the method equals() to compare the values of the Strings and the == to check if two variables point at the same instance of a String object. &lt;br&gt;&lt;br&gt;&lt;b&gt;31. What is thread? &lt;/b&gt;&lt;br&gt;A thread is an independent path of execution in a system.    &lt;br&gt;&lt;b&gt;32. What is multi-threading? &lt;/b&gt;&lt;br&gt;Multi-threading means various threads that run in a system.    &lt;br&gt;&lt;b&gt;33. How does multi-threading take place on a computer with a single CPU? &lt;/b&gt;&lt;br&gt;The operating system&amp;#39;s task scheduler allocates execution time to multiple tasks. By quickly switching between executing tasks, it creates the impression that tasks execute sequentially.    &lt;br&gt;&lt;b&gt;34. How to create a thread in a program? &lt;/b&gt;&lt;br&gt;You have two ways to do so. First, making your class &amp;quot;extends&amp;quot; Thread class. Second, making your class &amp;quot;implements&amp;quot; Runnable interface. Put jobs in a run() method and call start() method to start the thread.    &lt;br&gt;&lt;b&gt;35. Can Java object be locked down for exclusive use by a given thread? &lt;/b&gt;&lt;br&gt;Yes. You can lock an object by putting it in a &amp;quot;synchronized&amp;quot; block. The locked object is inaccessible to any thread other than the one that explicitly claimed it.    &lt;br&gt;&lt;b&gt;36. Can each Java object keep track of all the threads that want to exclusively access to it? &lt;/b&gt;&lt;br&gt;Yes. Use Thread.currentThread() method to track the accessing thread.    &lt;br&gt;&lt;b&gt;37. Does it matter in what order catch statements for FileNotFoundException and IOExceptipon are written? &lt;/b&gt;&lt;br&gt;Yes, it does. The FileNoFoundException is inherited from the IOException. Exception&amp;#39;s subclasses have to be caught first.    &lt;br&gt;&lt;b&gt;38. What invokes a thread&amp;#39;s run() method? &lt;/b&gt;&lt;br&gt;After a thread is started, via its start() method of the Thread class, the JVM invokes the thread&amp;#39;s run() method when the thread is initially executed. &lt;br&gt;&lt;b&gt;39. What is the purpose of the wait(), notify(), and notifyAll() methods? &lt;/b&gt;&lt;br&gt;The wait(),notify(), and notifyAll() methods are used to provide an efficient way for threads to communicate each other.    &lt;br&gt;&lt;b&gt;40. What are the high-level thread states? &lt;/b&gt;&lt;br&gt;The high-level thread states are ready, running, waiting, and dead.    &lt;br&gt;&lt;b&gt;41. What is the difference between yielding and sleeping? &lt;/b&gt;&lt;br&gt;When a task invokes its yield() method, it returns to the ready state. When a task invokes its sleep() method, it returns to the waiting state.    &lt;br&gt;&lt;b&gt;42. What happens when a thread cannot acquire a lock on an object? &lt;/b&gt;&lt;br&gt;If a thread attempts to execute a synchronized method or synchronized statement and is unable to acquire an object&amp;#39;s lock, it enters the waiting state until the lock becomes available.    &lt;br&gt;&lt;b&gt;43. What is the difference between Process and Thread? &lt;/b&gt;&lt;br&gt;A process can contain multiple threads. In most multithreading operating systems, a process gets its own memory address space; a thread doesn&amp;#39;t. Threads typically share the heap belonging to their parent process. For instance, a JVM runs in a single process in the host O/S. Threads in the JVM share the heap belonging to that process; that&amp;#39;s why several threads may access the same object. Typically, even though they share a common heap, threads have their own stack space. This is how one thread&amp;#39;s invocation of a method is kept separate from another&amp;#39;s. This is all a gross oversimplification, but it&amp;#39;s accurate enough at a high level. Lots of details differ between operating systems. Process vs. Thread A program vs. similar to a sequential program an run on its own vs. Cannot run on its own Unit of allocation vs. Unit of execution Have its own memory space vs. Share with others Each process has one or more threads vs. Each thread belongs to one process Expensive, need to context switch vs. Cheap, can use process memory and may not need to context switch More secure. One process cannot corrupt another process vs. Less secure. A thread can write the memory used by another thread    &lt;br&gt;&lt;b&gt;44. Can an inner class declared inside of a method access local variables of this method? &lt;/b&gt;&lt;br&gt;It&amp;#39;s possible if these variables are final.    &lt;br&gt;&lt;b&gt;45. What can go wrong if you replace &amp;amp;emp;&amp;amp;emp; with &amp;amp;emp; in the following code: String a=null; if (a!=null &amp;amp;&amp;amp; a.length()&amp;gt;10) {...} &lt;/b&gt;&lt;br&gt;A single ampersand here would lead to a NullPointerException. &lt;br&gt;&lt;b&gt;46. What is the Vector class? &lt;/b&gt;&lt;br&gt;The Vector class provides the capability to implement a growable array of objects    &lt;br&gt;&lt;b&gt;47. What modifiers may be used with an inner class that is a member of an outer class? &lt;/b&gt;&lt;br&gt;A (non-local) inner class may be declared as public, protected, private, static, final, or abstract.    &lt;br&gt;&lt;b&gt;48. If a method is declared as protected, where may the method be accessed? &lt;/b&gt;&lt;br&gt;A protected method may only be accessed by classes or interfaces of the same package or by subclasses of the class in which it is declared.    &lt;br&gt;&lt;b&gt;49. What is an Iterator interface? &lt;/b&gt;&lt;br&gt;The Iterator interface is used to step through the elements of a Collection.    &lt;br&gt;&lt;b&gt;50. How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8 characters? &lt;/b&gt;&lt;br&gt;Unicode requires 16 bits and ASCII require 7 bits. Although the ASCII character set uses only 7 bits, it is usually represented as 8 bits. UTF-8 represents characters using 8, 16, and 18 bit patterns. UTF-16 uses 16-bit and larger bit patterns.    &lt;br&gt;&lt;b&gt;51. What&amp;#39;s the main difference between a Vector and an ArrayList? &lt;/b&gt;&lt;br&gt;Java Vector class is internally synchronized and ArrayList is not.    &lt;br&gt;&lt;b&gt;52. What are wrapped classes? &lt;/b&gt;&lt;br&gt;Wrapped classes are classes that allow primitive types to be accessed as objects.    &lt;br&gt;&lt;b&gt;53. Does garbage collection guarantee that a program will not run out of memory? &lt;/b&gt;&lt;br&gt;No, it doesn&amp;#39;t. It is possible for programs to use up memory resources faster than they are garbage collected. It is also possible for programs to create objects that are not subject to garbage collection.    &lt;br&gt;&lt;b&gt;54. What is the difference between preemptive scheduling and time slicing? &lt;/b&gt;&lt;br&gt;Under preemptive scheduling, the highest priority task executes until it enters the waiting or dead states or a higher priority task comes into existence. Under time slicing, a task executes for a predefined slice of time and then reenters the pool of ready tasks. The scheduler then determines which task should execute next, based on priority and other factors.    &lt;br&gt;&lt;b&gt;55. Name Component subclasses that support painting? &lt;/b&gt;&lt;br&gt;The Canvas, Frame, Panel, and Applet classes support painting.    &lt;br&gt;&lt;b&gt;56. What is a native method? &lt;/b&gt;&lt;br&gt;A native method is a method that is implemented in a language other than Java.    &lt;br&gt;&lt;b&gt;57. How can you write a loop indefinitely? &lt;/b&gt;&lt;br&gt;for(;;)--for loop; while(true)--always true, etc.    &lt;br&gt;&lt;b&gt;58. Can an anonymous class be declared as implementing an interface and extending a class? &lt;/b&gt;&lt;br&gt;An anonymous class may implement an interface or extend a superclass, but may not be declared to do both.    &lt;br&gt;&lt;b&gt;59. What is the purpose of finalization? &lt;/b&gt;&lt;br&gt;The purpose of finalization is to give an unreachable object the opportunity to perform any cleanup processing before the object is garbage collected.    &lt;br&gt;&lt;b&gt;60. When should the method invokeLater()be used? &lt;/b&gt;&lt;br&gt;This method is used to ensure that Swing components are updated through the event-dispatching thread.    &lt;br&gt;&lt;b&gt;61. How many methods in Object class? &lt;/b&gt;&lt;br&gt;This question is not asked to test your memory. It tests you how well you know Java. Ten in total.&lt;br&gt;clone() &lt;br&gt;equals() &amp;amp; hashcode() &lt;br&gt;getClass() &lt;br&gt;finalize() &lt;br&gt;wait() &amp;amp; notify() &lt;br&gt;toString()    &lt;br&gt;&lt;b&gt;62. How does Java handle integer overflows and underflows? &lt;/b&gt;&lt;br&gt;It uses low order bytes of the result that can fit into the size of the type allowed by the operation   &lt;br&gt;&lt;b&gt;63. What is the numeric promotion? &lt;/b&gt;&lt;br&gt;Numeric promotion is used with both unary and binary bitwise operators. This means that byte, char, and short values are converted to int values before a bitwise operator is applied.&lt;br&gt;If a binary bitwise operator has one long operand, the other operand is converted to a long value.&lt;br&gt;The type of the result of a bitwise operation is the type to which the operands have been promoted. For example:&lt;br&gt;short a = 5;&lt;br&gt;byte b = 10;&lt;br&gt;long c = 15;&lt;br&gt;The type of the result of (a+b) is int, not short or byte. The type of the result of (a+c) or (b+c) is long.    &lt;br&gt;&lt;b&gt;64. Is the numeric promotion available in other plantform? &lt;/b&gt;&lt;br&gt;Yes. Because Java is implemented using a platform-independent virtual machine, bitwise operations always yield the same result, even when run on machines that use radically different CPUs.    &lt;br&gt;&lt;b&gt;65. What is the difference between the Boolean &amp;amp; operator and the &amp;amp;&amp;amp; operator? &lt;/b&gt;&lt;br&gt;If an expression involving the Boolean &amp;amp; operator is evaluated, both operands are evaluated. Then the &amp;amp; operator is applied to the operand. When an expression involving the &amp;amp;&amp;amp; operator is evaluated, the first operand is evaluated. If the first operand returns a value of true then the second operand is evaluated. The &amp;amp;&amp;amp; operator is then applied to the first and second operands. If the first operand evaluates to false, the evaluation of the second operand is skipped. &lt;br&gt;Operator &amp;amp; has no chance to skip both sides evaluation and &amp;amp;&amp;amp; operator does. If asked why, give details as above.    &lt;br&gt;&lt;b&gt;65. When is the ArithmeticException throwQuestion: What is the GregorianCalendar class? &lt;/b&gt;&lt;br&gt;The GregorianCalendar provides support for traditional Western calendars.    &lt;br&gt;&lt;b&gt;66. What is the SimpleTimeZone class? &lt;/b&gt;&lt;br&gt;The SimpleTimeZone class provides support for a Gregorian calendar.    &lt;br&gt;&lt;b&gt;67. How can a subclass call a method or a constructor defined in a superclass? &lt;/b&gt;&lt;br&gt;Use the following syntax: super.myMethod(); To call a constructor of the superclass, just write super(); in the first line of the subclass&amp;#39;s constructor.    &lt;br&gt;&lt;b&gt;68. What is the Properties class? &lt;/b&gt;&lt;br&gt;The properties class is a subclass of Hashtable that can be read from or written to a stream. It also provides the capability to specify a set of default values to be used.    &lt;br&gt;&lt;b&gt;69. What is the purpose of the Runtime class? &lt;/b&gt;&lt;br&gt;The purpose of the Runtime class is to provide access to the Java runtime system. &lt;br&gt;&lt;b&gt;70. What is the purpose of the System class? &lt;/b&gt;&lt;br&gt;The purpose of the System class is to provide access to system resources.    &lt;br&gt;&lt;b&gt;71. What is the purpose of the finally clause of a try-catch-finally statement? &lt;/b&gt;&lt;br&gt;The finally clause is used to provide the capability to execute code no matter whether or not an exception is thrown or caught.    &lt;br&gt;&lt;b&gt;72. What is the Locale class? &lt;/b&gt;&lt;br&gt;The Locale class is used to tailor program output to the conventions of a particular geographic, political, or cultural region.    &lt;br&gt;&lt;b&gt;73. What is an abstract method? &lt;/b&gt;&lt;br&gt;An abstract method is a method whose implementation is deferred to a subclass. Or, a method that has no implementation.    &lt;br&gt;&lt;b&gt;74. What is the difference between interface and abstract class? &lt;/b&gt;&lt;br&gt;interface contains methods that must be abstract; abstract class may contain concrete methods. interface contains variables that must be static and final; abstract class may contain non-final and final variables. members in an interface are public by default, abstract class may contain non-public members. interface is used to &amp;quot;implements&amp;quot;; whereas abstract class is used to &amp;quot;extends&amp;quot;. interface can be used to achieve multiple inheritance; abstract class can be used as a single inheritance. interface can &amp;quot;extends&amp;quot; another interface, abstract class can &amp;quot;extends&amp;quot; another class and &amp;quot;implements&amp;quot; multiple interfaces. interface is absolutely abstract; abstract class can be invoked if a main() exists. interface is more flexible than abstract class because one class can only &amp;quot;extends&amp;quot; one super class, but &amp;quot;implements&amp;quot; multiple interfaces. If given a choice, use interface instead of abstract class.    &lt;br&gt;&lt;b&gt;75. What is a static method? &lt;/b&gt;&lt;br&gt;A static method is a method that belongs to the class rather than any object of the class and doesn&amp;#39;t apply to an object or even require that any objects of the class have been instantiated.    &lt;br&gt;&lt;b&gt;76. What is a protected method?&lt;/b&gt; &lt;br&gt;A protected method is a method that can be accessed by any method in its package and inherited by any subclass of its class.    &lt;br&gt;&lt;b&gt;77. What is the difference between a static and a non-static inner class?&lt;/b&gt; &lt;br&gt;A non-static inner class may have object instances that are associated with instances of the class&amp;#39;s outer class. A static inner class does not have any object instances.    &lt;br&gt;&lt;b&gt;78. What is an object&amp;#39;s lock and which object&amp;#39;s have locks?&lt;/b&gt; &lt;br&gt;An object&amp;#39;s lock is a mechanism that is used by multiple threads to obtain synchronized access to the object. A thread may execute a synchronized method of an object only after it has acquired the object&amp;#39;s lock. All objects and classes have locks. A class&amp;#39;s lock is acquired on the class&amp;#39;s Class object. &lt;br&gt;&lt;b&gt;79. When can an object reference be cast to an interface reference?&lt;/b&gt; &lt;br&gt;An object reference can be cast to an interface reference when the object implements the referenced interface.    &lt;br&gt;&lt;b&gt;80. What is the difference between a Window and a Frame?&lt;/b&gt; &lt;br&gt;The Frame class extends Window to define a main application window that can have a menu bar.    &lt;br&gt;&lt;b&gt;81. What is the difference between a Window and a Frame? &lt;/b&gt;&lt;br&gt;Heavy weight components like Abstract Window Toolkit (AWT), depend on the local windowing toolkit. For example, java.awt.Button is a heavy weight component, when it is running on the Java platform for Unix platform, it maps to a real Motif button. In this relationship, the Motif button is called the peer to the java.awt.Button. If you create two Buttons, two peers and hence two Motif Buttons are also created. The Java platform communicates with the Motif Buttons using the Java Native Interface. For each and every component added to the application, there is an additional overhead tied to the local windowing system, which is why these components are called heavy weight.    &lt;br&gt;&lt;b&gt;82. Which package has light weight components? &lt;/b&gt;&lt;br&gt;javax.Swing package. All components in Swing, except JApplet, JDialog, JFrame and JWindow are lightweight components.    &lt;br&gt;&lt;b&gt;83. What are peerless components?&lt;/b&gt; &lt;br&gt;The peerless components are called light weight components.    &lt;br&gt;&lt;b&gt;84. What is the difference between the Font and FontMetrics classes?&lt;/b&gt; &lt;br&gt;The FontMetrics class is used to define implementation-specific properties, such as ascent and descent, of a Font object    &lt;br&gt;&lt;b&gt;85. What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy? &lt;/b&gt;&lt;br&gt;The Reader/Writer class hierarchy is character-oriented, and the InputStream/OutputStream class hierarchy is byte-oriented.    &lt;br&gt;&lt;b&gt;86. What classes of exceptions may be caught by a catch clause? &lt;/b&gt;&lt;br&gt;A catch clause can catch any exception that may be assigned to the Throwable type. This includes the Error and Exception types.    &lt;br&gt;&lt;b&gt;87. What is the difference between throw and throws keywords? &lt;/b&gt;&lt;br&gt;The throw keyword denotes a statement that causes an exception to be initiated. It takes the Exception object to be thrown as argument. The exception will be caught by an immediately encompassing try-catch construction or propagated further up the calling hierarchy. &lt;br&gt;The throws keyword is a modifier of a method that designates that exceptions may come out of the mehtod, either by virtue of the method throwing the exception itself or because it fails to catch such exceptions that a method it calls may throw. &lt;br&gt;&lt;b&gt;88. If a class is declared without any access modifiers, where may the class be accessed? &lt;/b&gt;&lt;br&gt;A class that is declared without any access modifiers is said to have package or friendly access. This means that the class can only be accessed by other classes and interfaces that are defined within the same package.    &lt;br&gt;&lt;b&gt;89. What is the Map interface? &lt;/b&gt;&lt;br&gt;The Map interface replaces the JDK 1.1 Dictionary class and is used associate keys with values.    &lt;br&gt;&lt;b&gt;90. Does a class inherit the constructors of its superclass? &lt;/b&gt;&lt;br&gt;A class does not inherit constructors from any of its superclasses.    &lt;br&gt;&lt;b&gt;91. Name primitive Java types. &lt;/b&gt;&lt;br&gt;The primitive types are byte, char, short, int, long, float, double, and boolean.    &lt;br&gt;&lt;b&gt;92. Which class should you use to obtain design information about an object? &lt;/b&gt;&lt;br&gt;The Class class is used to obtain information about an object&amp;#39;s design.    &lt;br&gt;&lt;b&gt;92. How can a GUI component handle its own events? &lt;/b&gt;&lt;br&gt;A component can handle its own events by implementing the required event-listener interface and adding itself as its own event listener.    &lt;br&gt;&lt;b&gt;93. How are the elements of a GridBagLayout organized? &lt;/b&gt;&lt;br&gt;The elements of a GridBagLayout are organized according to a grid. However, the elements are of different sizes and may occupy more than one row or column of the grid. In addition, the rows and columns may have different sizes.    &lt;br&gt;&lt;b&gt;94. What advantage do Java&amp;#39;s layout managers provide over traditional windowing systems? &lt;/b&gt;&lt;br&gt;Java uses layout managers to lay out components in a consistent manner across all windowing platforms. Since Java&amp;#39;s layout managers aren&amp;#39;t tied to absolute sizing and positioning, they are able to accommodate platform-specific differences among windowing systems.    &lt;br&gt;&lt;b&gt;95. What are the problems faced by Java programmers who don&amp;#39;t use layout managers?&lt;/b&gt; &lt;br&gt;Without layout managers, Java programmers are faced with determining how their GUI will be displayed across multiple windowing systems and finding a common sizing and positioning that will work within the constraints imposed by each windowing system. &lt;br&gt;&lt;b&gt;96. What is the difference between static and non-static variables? &lt;/b&gt;&lt;br&gt;A static variable is associated with the class as a whole rather than with specific instances of a class. Non-static variables take on unique values with each object instance.    &lt;br&gt;&lt;b&gt;97. What is the difference between the paint() and repaint() methods? &lt;/b&gt;&lt;br&gt;The paint() method supports painting via a Graphics object. The repaint() method is used to cause paint() to be invoked by the AWT painting thread.    &lt;br&gt;&lt;b&gt;98. What is the purpose of the File class? &lt;/b&gt;&lt;br&gt;The File class is used to create objects that provide access to the files and directories of a local file system.    &lt;br&gt;&lt;b&gt;99. Why would you use a synchronized block vs. synchronized method? &lt;/b&gt;&lt;br&gt;Synchronized blocks place locks for shorter periods than synchronized methods.    &lt;br&gt;&lt;b&gt;100. What restrictions are placed on method overriding? &lt;/b&gt;&lt;br&gt;Overridden methods must have the same name, argument list, and return type. The overriding method may not limit the access of the method it overrides. The overriding method may not throw any exceptions that may not be thrown by the overridden method.    &lt;br&gt;&lt;b&gt;101. What is casting? &lt;/b&gt;&lt;br&gt;There are two types of casting, casting between primitive numeric types and casting between object references. Casting between numeric types is used to convert larger values, such as double values, to smaller values, such as byte values. Casting between object references is used to refer to an object by a compatible class, interface, or array type reference.    &lt;br&gt;&lt;b&gt;102. Explain the usage of the keyword transient? &lt;/b&gt;&lt;br&gt;This keyword indicates that the value of this member variable does not have to be serialized with the object. When the class will be de-serialized, this variable will be initialized with a default value of its data type (i.e. zero for integers).    &lt;br&gt;&lt;b&gt;103. What class allows you to read objects directly from a stream? &lt;/b&gt;&lt;br&gt;The ObjectInputStream class supports the reading of objects from input streams.    &lt;br&gt;&lt;b&gt;104. How are this() and super() used with constructors? &lt;/b&gt;&lt;br&gt;this() is used to invoke a constructor of the same class. super() is used to invoke a superclass constructor.    &lt;br&gt;&lt;b&gt;105. How is it possible for two String objects with identical values not to be equal under the == operator? How are this() and super() used with constructors? &lt;/b&gt;&lt;br&gt;The == operator compares two objects to determine if they are the same objects in memory. It is possible for two String objects to have the same value, but located in different areas of memory&lt;br&gt;&lt;b&gt;106. What is an IO filter? &lt;/b&gt;&lt;br&gt;An IO filter is an object that reads from one stream and writes to another, usually altering the data in some way as it is passed from one stream to another.    &lt;br&gt;&lt;b&gt;107. What is the Set interface? &lt;/b&gt;&lt;br&gt;The Set interface provides methods for accessing the elements of a finite mathematical set. Sets do not allow duplicate elements.    &lt;br&gt;&lt;b&gt;108. How can you force garbage collection? &lt;/b&gt;&lt;br&gt;You can&amp;#39;t force GC, but could request it by calling System.gc(). JVM does not guarantee that GC will be started immediately.    &lt;br&gt;&lt;b&gt;109. What is the purpose of the enableEvents() method? &lt;/b&gt;&lt;br&gt;The enableEvents() method is used to enable an event for a particular object. Normally, an event is enabled when a listener is added to an object for a particular event. The enableEvents() method is used by objects that handle events by overriding their event-dispatch methods.    &lt;br&gt;&lt;b&gt;110. What is the difference between the File and RandomAccessFile classes? &lt;/b&gt;&lt;br&gt;The File class encapsulates the files and directories of the local file system. The RandomAccessFile class provides the methods needed to directly access data contained in any part of a file.    &lt;br&gt;&lt;b&gt;111. What interface must an object implement before it can be written to a stream as an object?&lt;/b&gt; &lt;br&gt;An object must implement the Serializable or Externalizable interface before it can be written to a stream as an object.    &lt;br&gt;&lt;b&gt;112. What is the ResourceBundle class? &lt;/b&gt;&lt;br&gt;The ResourceBundle class is used to store locale-specific resources that can be loaded by a program to tailor the program&amp;#39;s appearance to the particular locale in which it is being run.    &lt;br&gt;&lt;b&gt;113. How do you know if an explicit object casting is needed? &lt;/b&gt;&lt;br&gt;If you assign a superclass object to a variable of a subclass&amp;#39;s data type, you need to do explicit casting. For example: &lt;br&gt;Object a; Customer b; b = (Customer) a; &lt;br&gt;When you assign a subclass to a variable having a supeclass type, the casting is performed automatically.    &lt;br&gt;&lt;b&gt;114. What is a Java package and how is it used? &lt;/b&gt;&lt;br&gt;A Java package is a naming context for classes and interfaces. A package is used to create a separate name space for groups of classes and interfaces. Packages are also used to organize related classes and interfaces into a single API unit and to control accessibility to these classes and interfaces. &lt;br&gt;&lt;br&gt;&lt;b&gt;96. What is the difference between static and non-static variables? &lt;/b&gt;&lt;br&gt;A static variable is associated with the class as a whole rather than with specific instances of a class. Non-static variables take on unique values with each object instance.    &lt;br&gt;&lt;b&gt;97. What is the difference between the paint() and repaint() methods? &lt;/b&gt;&lt;br&gt;The paint() method supports painting via a Graphics object. The repaint() method is used to cause paint() to be invoked by the AWT painting thread.    &lt;br&gt;&lt;b&gt;98. What is the purpose of the File class? &lt;/b&gt;&lt;br&gt;The File class is used to create objects that provide access to the files and directories of a local file system.    &lt;br&gt;&lt;b&gt;99. Why would you use a synchronized block vs. synchronized method? &lt;/b&gt;&lt;br&gt;Synchronized blocks place locks for shorter periods than synchronized methods.    &lt;br&gt;&lt;b&gt;100. What restrictions are placed on method overriding? &lt;/b&gt;&lt;br&gt;Overridden methods must have the same name, argument list, and return type. The overriding method may not limit the access of the method it overrides. The overriding method may not throw any exceptions that may not be thrown by the overridden method.    &lt;br&gt;&lt;b&gt;101. What is casting? &lt;/b&gt;&lt;br&gt;There are two types of casting, casting between primitive numeric types and casting between object references. Casting between numeric types is used to convert larger values, such as double values, to smaller values, such as byte values. Casting between object references is used to refer to an object by a compatible class, interface, or array type reference.    &lt;br&gt;&lt;b&gt;102. Explain the usage of the keyword transient? &lt;/b&gt;&lt;br&gt;This keyword indicates that the value of this member variable does not have to be serialized with the object. When the class will be de-serialized, this variable will be initialized with a default value of its data type (i.e. zero for integers).    &lt;br&gt;&lt;b&gt;103. What class allows you to read objects directly from a stream? &lt;/b&gt;&lt;br&gt;The ObjectInputStream class supports the reading of objects from input streams.    &lt;br&gt;&lt;b&gt;104. How are this() and super() used with constructors? &lt;/b&gt;&lt;br&gt;this() is used to invoke a constructor of the same class. super() is used to invoke a superclass constructor.    &lt;br&gt;&lt;b&gt;105. How is it possible for two String objects with identical values not to be equal under the == operator? How are this() and super() used with constructors? &lt;/b&gt;&lt;br&gt;The == operator compares two objects to determine if they are the same objects in memory. It is possible for two String objects to have the same value, but located in different areas of memory   &lt;br&gt;&lt;b&gt;115. What are the Object and Class classes used for? &lt;/b&gt;&lt;br&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 Java program.    &lt;br&gt;&lt;b&gt;116. What is Serialization and deserialization? &lt;/b&gt;&lt;br&gt;Serialization is the process of writing the state of an object to a byte stream. Deserialization is the process of restoring these objects.    &lt;br&gt;&lt;b&gt;117. Explain the usage of Java packages. &lt;/b&gt;&lt;br&gt;This is a way to organize files when a project consists of multiple modules. It also helps resolve naming conflicts when different packages have classes with the same names. Packages access level also allows you to protect data from being used by the non-authorized classes.    &lt;br&gt;&lt;b&gt;118. Does the code in finally block get executed if there is an exception and a return statement in a catch block? &lt;/b&gt;&lt;br&gt;If an exception occurs and there is a return statement in catch block, the finally block is still executed. The finally block will not be executed when the System.exit(1) statement is executed earlier or the system shut down earlier or the memory is used up earlier before the thread goes to finally block.    &lt;br&gt;&lt;b&gt;119. How do you restrict a user to cut and paste from the html page? &lt;/b&gt;&lt;br&gt;Using Servlet or client side scripts to lock keyboard keys. It is one of solutions.    &lt;br&gt;&lt;b&gt;120. Is Java a super set of JavaScript? &lt;/b&gt;&lt;br&gt;No. They are completely different. Some syntax may be similar.    &lt;br&gt;&lt;b&gt;121. What is a Container in a GUI?&lt;/b&gt; &lt;br&gt;A Container contains and arranges other components (including other containers) through the use of layout managers, which use specific layout policies to determine where components should go as a function of the size of the container.    &lt;br&gt;&lt;b&gt;122. How the object oriented approach helps us keep complexity of software development under control? &lt;/b&gt;&lt;br&gt;We can discuss such issue from the following aspects:   1.        Objects allow procedures to be encapsulated with their data to reduce potential interference.   2.        Inheritance allows well-tested procedures to be reused and enables changes to make once and have effect in all relevant places.   3.        The well-defined separations of interface and implementation allow constraints to be imposed on inheriting classes while still allowing the flexibility of overriding and overloading.    &lt;br&gt;&lt;b&gt;123. What is polymorphism? &lt;/b&gt;&lt;br&gt;Polymorphism means &amp;quot;having many forms&amp;quot;. It allows methods (may be variables) to be written that needn&amp;#39;t be concerned about the specifics of the objects they will be applied to. That is, the method can be specified at a higher level of abstraction and can be counted on to work even on objects of un-conceived classes. &lt;br&gt;&lt;b&gt;124. What is design by contract? &lt;/b&gt;&lt;br&gt;The design by contract specifies the obligations of a method to any other methods that may use its services and also theirs to it. For example, the preconditions specify what the method required to be true when the method is called. Hence making sure that preconditions are. Similarly, postconditions specify what must be true when the method is finished, thus the called method has the responsibility of satisfying the post conditions. &lt;br&gt;In Java, the exception handling facilities support the use of design by contract, especially in the case of checked exceptions. The assert keyword can be used to make such contracts.    &lt;br&gt;&lt;b&gt;125. What are use cases? &lt;/b&gt;&lt;br&gt;A use case describes a situation that a program might encounter and what behavior the program should exhibit in that circumstance. It is part of the analysis of a program. The collection of use cases should, ideally, anticipate all the standard circumstances and many of the extraordinary circumstances possible so that the program will be robust.    &lt;br&gt;&lt;b&gt;126. What is scalability and performance? &lt;/b&gt;&lt;br&gt;Performance is a measure of &amp;quot;how fast can you perform this task.&amp;quot; and scalability describes how an application behaves as its workload and available computing resources increase.    &lt;br&gt;&lt;b&gt;127. What is the benefit of subclass? &lt;/b&gt;&lt;br&gt;Generally: The sub class inherits all the public methods and the implementation. &lt;br&gt;The sub class inherits all the protected methods and their implementation. &lt;br&gt;The sub class inherits all the default(non-access modifier) methods and their implementation. &lt;br&gt;The sub class also inherits all the public, protected and default member variables from the super class. &lt;br&gt;The constructors are not part of this inheritance model.    &lt;br&gt;&lt;b&gt;128. How to add menushortcut to menu item? &lt;/b&gt;&lt;br&gt;If you have a button instance called aboutButton, you may add menu short cut by calling aboutButton.setMnemonic(&amp;#39;A&amp;#39;), so the user may be able to use Alt+A to click the button.    &lt;br&gt;&lt;b&gt;129. Where and how can you use a private constuctor. &lt;/b&gt;&lt;br&gt;Private constructor can be used if you do not want any other class to instanstiate it by using new. The instantiation is done from a static public method, which is used when dealing with the factory method pattern.    &lt;br&gt;&lt;b&gt;130. In System.out.println(),what is System,out and println,pls explain? &lt;/b&gt;&lt;br&gt;System is a predefined final class,out is a PrintStream object acting as a field member and println is a built-in overloaded method in the out object.    &lt;br&gt;&lt;b&gt;131. Can you write a Java class that could be used both as an applet as well as an application? &lt;/b&gt;&lt;br&gt;A. Yes. Add a main() method to the applet. &lt;br&gt;&lt;b&gt;132. Can you make an instance of an abstract class? For example - java.util.Calender is an abstract class with a method getInstance() which returns an instance of the Calender class.&lt;/b&gt; &lt;br&gt;No! You cannot make an instance of an abstract class. An abstract class has to be sub-classed. If you have an abstract class and you want to use a method which has been implemented, you may need to subclass that abstract class, instantiate your subclass and then call that method.    &lt;br&gt;&lt;b&gt;133. What is the output of x &amp;gt; y? a:b = p*q when x=1,y=2,p=3,q=4?&lt;/b&gt; &lt;br&gt;When this kind of question has been asked, find the problems you think is necessary to ask back before you give an answer. Ask if variables a and b have been declared or initialized. If the answer is yes. You can say that the syntax is wrong. If the statement is rewritten as: x&amp;lt; returned. is a variable and true return statement y=&amp;quot;2;&amp;quot; x the than less 1 because be would value a:(b=&amp;quot;p*q);&amp;quot;&amp;gt; &lt;br&gt;&lt;b&gt;134. What is the difference between Swing and AWT components? &lt;/b&gt;&lt;br&gt;AWT components are heavy-weight, whereas Swing components are lightweight. Heavy weight components depend on the local windowing toolkit. For example, java.awt.Button is a heavy weight component, when it is running on the Java platform for Unix platform, it maps to a real Motif button.    &lt;br&gt;&lt;b&gt;135. Why Java does not support pointers? &lt;/b&gt;&lt;br&gt;Because pointers are unsafe. Java uses reference types to hide pointers and programmers feel easier to deal with reference types without pointers. This is why Java and C-sharp shine.    &lt;br&gt;&lt;b&gt;136. Parsers? DOM vs SAX parser &lt;/b&gt;&lt;br&gt;Parsers are fundamental xml components, a bridge between XML documents and applications that process that XML. The parser is responsible for handling xml syntax, checking the contents of the document against constraints established in a DTD or Schema.&lt;br&gt;DOM&lt;br&gt;1. Tree of nodes&lt;br&gt;2. Memory: Occupies more memory, preffered for small XML documents&lt;br&gt;3. Slower at runtime &lt;br&gt;4. Stored as objects &lt;br&gt;5. Programmatically easy &lt;br&gt;6. Ease of navigation &lt;br&gt;SAX &lt;br&gt;1. Sequence of events &lt;br&gt;2. Doesn&amp;#39;t use any memory preferred for large documents&lt;br&gt;3. Faster at runtime&lt;br&gt;4. Objects are to be created&lt;br&gt;5. Need to write code for creating objects&lt;br&gt;6. Backward navigation is not possible as it sequentially processes the document   &lt;br&gt;&lt;b&gt;137. Can you declare a class as private? &lt;/b&gt;Yes, we can declare a private class as an inner class. For example, class MyPrivate {    private static class MyKey {        String key = &amp;quot;12345&amp;quot;;    }    public static void main(String[] args) {        System.out.println(new MyKey().key);//prints 12345    }}   &lt;br&gt;&lt;b&gt;138. What is the difference between shallow copy and deep copy? &lt;/b&gt;&lt;br&gt;Shallow copy shares the same reference with the original object like cloning, whereas the deep copy get a duplicate instance of the original object. If the shallow copy has been changed, the original object will be reflected and vice versa.    &lt;br&gt;&lt;b&gt;139. Can one create a method which gets a String and modifies it?&lt;/b&gt; &lt;br&gt;No. In Java, Strings are constant or immutable; their values cannot be changed after they are created, but they can be shared. Once you change a string, you actually create a new object. For example: &lt;br&gt;String s = &amp;quot;abc&amp;quot;; //create a new String object representing &amp;quot;abc&amp;quot; &lt;br&gt;s = s.toUpperCase(); //create another object representing &amp;quot;ABC&amp;quot;    &lt;br&gt;&lt;b&gt;140. Why is multiple inheritance not possible in Java?&lt;/b&gt; &lt;br&gt;It depends on how you understand &amp;quot;inheritance&amp;quot;. Java can only &amp;quot;extends&amp;quot; one super class, but can &amp;quot;implements&amp;quot; many interfaces; that doesn&amp;#39;t mean the multiple inheritance is not possible. You may use interfaces to make inheritance work for you. Or you may need to work around. For example, if you cannot get a feature from a class because your class has a super class already, you may get that class&amp;#39;s feature by declaring it as a member field or getting an instance of that class. So the answer is that multiple inheritance in Java is possible.    &lt;br&gt;&lt;b&gt;141. What&amp;#39;s the difference between constructors and other methods?&lt;/b&gt; &lt;br&gt;Constructors must have the same name as the class and can not return a value. They are only called once while regular methods could be called many times.    &lt;br&gt;&lt;b&gt;142. What is the relationship between synchronized and volatile keyword?&lt;/b&gt; &lt;br&gt;The JVM is guaranteed to treat reads and writes of data of 32 bits or less as atomic.(Some JVM might treat reads and writes of data of 64 bits or less as atomic in future) For long or double variable, programmers should take care in multi-threading environment. Either put these variables in a synchronized method or block, or declare them volatile.    &lt;br&gt;&lt;b&gt;143. This class (IncrementImpl) will be used by various threads concurrently; can you see the inherent flaw(s)? How would you improve it?&lt;/b&gt; public class IncrementImpl {     private static int counter = 0;     public synchronized void increment() {         counter++;     }     public int getCounter() {         return counter;     } }   The counter is static variable which is shared by multiple instances of this class. The increment() method is synchronized, but the getCounter() should be synchronized too. Otherwise the Java run-time system will not guarantee the data integrity and the race conditions will occur. The famous producer/consumer example listed at Sun&amp;#39;s thread tutorial site will tell more. &lt;br&gt;one of solutions public class IncrementImpl {     private static int counter = 0;     public synchronized void increment() {         counter++;     }     public synchronized int getCounter() {         return counter;     } }    &lt;br&gt;&lt;b&gt;144. What are the drawbacks of inheritance?&lt;/b&gt; &lt;br&gt;Since inheritance inherits everything from the super class and interface, it may make the subclass too clustering and sometimes error-prone when dynamic overriding or dynamic overloading in some situation. In addition, the inheritance may make peers hardly understand your code if they don&amp;#39;t know how your super-class acts and add learning curve to the process of development. &lt;br&gt;Usually, when you want to use a functionality of a class, you may use subclass to inherit such function or use an instance of this class in your class. Which is better, depends on your specification   &lt;br&gt;&lt;b&gt;145. Is there any other way that you can achieve inheritance in Java?&lt;/b&gt; &lt;br&gt;There are a couple of ways. As you know, the straight way is to &amp;quot;extends&amp;quot; and/or &amp;quot;implements&amp;quot;. The other way is to get an instance of the class to achieve the inheritance. That means to make the supposed-super-class be a field member. When you use an instance of the class, actually you get every function available from this class, but you may lose the dynamic features of OOP    &lt;br&gt;&lt;b&gt;146. Two methods have key words static synchronized and synchronized separately. What is the difference between them? &lt;/b&gt;&lt;br&gt;Both are synchronized methods. One is instance method, the other is class method. Method with static modifier is a class method. That means the method belongs to class itself and can be accessed directly with class name and is also called Singleton design. The method without static modifier is an instance method. That means the instance method belongs to its object. Every instance of the class gets its own copy of its instance method. &lt;br&gt;When synchronized is used with a static method, a lock for the entire class is obtained. When synchronized is used with a non-static method, a lock for the particular object (that means instance) of the class is obtained. &lt;br&gt;Since both methods are synchronized methods, you are not asked to explain what is a synchronized method. You are asked to tell the difference between instance and class method. Of course, your explanation to how synchronized keyword works doesn&amp;#39;t hurt. And you may use this opportunity to show your knowledge scope.    &lt;br&gt;&lt;b&gt;147. How do you create a read-only collection?&lt;/b&gt; &lt;br&gt;The Collections class has six methods to help out here: &lt;br&gt;1. unmodifiableCollection(Collection c) &lt;br&gt;2. unmodifiableList(List list) &lt;br&gt;3. unmodifiableMap(Map m) &lt;br&gt;4. unmodifiableSet(Set s) &lt;br&gt;5. unmodifiableSortedMap(SortedMap m) &lt;br&gt;6. unmodifiableSortedSet(SortedSet s)&lt;br&gt;If you get an Iterator from one of these unmodifiable collections, when you call remove(), it will throw an UnsupportedOperationException.    &lt;br&gt;&lt;b&gt;148. Can a private method of a superclass be declared within a subclass? &lt;/b&gt;&lt;br&gt;Sure. A private field or method or inner class belongs to its declared class and hides from its subclasses. There is no way for private stuff to have a runtime overloading or overriding (polymorphism) features.    &lt;br&gt;&lt;b&gt;149. Why Java does not support multiple inheritance ? &lt;/b&gt;&lt;br&gt;This is a classic question. Yes or No depends on how you look at Java. If you focus on the syntax of &amp;quot;extends&amp;quot; and compare with C++, you may answer &amp;#39;No&amp;#39; and give explanation to support you. Or you may answer &amp;#39;Yes&amp;#39;. Recommend you to say &amp;#39;Yes&amp;#39;.&lt;br&gt;Java DOES support multiple inheritance via interface implementation. Some people may not think in this way. Give explanation to support your point.    &lt;br&gt;&lt;b&gt;150. What is the difference between final, finally and finalize? &lt;/b&gt;&lt;br&gt;Short answer:&lt;br&gt;final - declares constant&lt;br&gt;finally - relates with exception handling &lt;br&gt;finalize - helps in garbage collection &lt;br&gt;If asked to give details, explain:&lt;br&gt;final field, final method, final class &lt;br&gt;try/finally, try/catch/finally &lt;br&gt;protected void finalize() in Object class &lt;br&gt;&lt;hr size=&quot;1&quot;&gt;&lt;br/&gt;</description></item><item><title>Wallpaper</title><link>http://johnj2v.wetpaint.com/page/Wallpaper</link><author>vijayavenkatesh.2006</author><guid isPermaLink="false">http://johnj2v.wetpaint.com/page/Wallpaper</guid><pubDate>Mon, 30 Oct 2006 00:20:40 CST</pubDate><description>&lt;h2&gt;   &lt;br&gt;&lt;div align=&quot;center&quot;&gt; &lt;/div&gt;  &lt;div align=&quot;center&quot;&gt;  &lt;/div&gt;  &lt;div align=&quot;center&quot;&gt;   &lt;/div&gt;&lt;/h2&gt;&lt;hr size=&quot;1&quot;&gt;&lt;br/&gt;</description></item><item><title>Interview</title><link>http://johnj2v.wetpaint.com/page/Interview</link><author>vijayavenkatesh.2006</author><guid isPermaLink="false">http://johnj2v.wetpaint.com/page/Interview</guid><comments>customize</comments><pubDate>Thu, 26 Oct 2006 02:53:23 CDT</pubDate><description>&lt;u&gt;&lt;b&gt;T&lt;/b&gt;&lt;b&gt;ell Me About Yourself&lt;/b&gt;&lt;/u&gt;&lt;br&gt;&lt;div&gt;&lt;i&gt; by Carole Martin&lt;br&gt;&lt;/i&gt;Monster Contributing Writer&lt;/div&gt;   &lt;br&gt;   It&amp;#39;s one of the most frequently asked questions in an interview: Tell me about yourself. Your response to this request will set the tone for the rest of the interview. For some, this is the most challenging question to answer, as they wonder what the interviewer really wants to know and what information they should include. Eleanor dreaded this question. When it was the first one asked at her interview, she fumbled her way through a vague answer, not focusing on what she could bring to the job.&lt;br&gt;    &amp;quot;I&amp;#39;m happily married and originally from Denver,&amp;quot; she began. &amp;quot;My husband was transferred here three months ago, and I&amp;#39;ve been getting us settled in our new home. I&amp;#39;m now ready to go back to work. I&amp;#39;ve worked in a variety of jobs, usually customer service-related. I&amp;#39;m looking for a company that offers growth opportunities.&amp;quot; The interview went downhill after that. She had started with personal information and gave the interviewer reason to doubt whether she was an employee who would stay for very long. &lt;ul&gt;&lt;li&gt;She&amp;#39;s married, and when her husband gets transferred that means she has to leave; she did it once and can do it again.  &lt;/li&gt;&lt;li&gt;She has some work experience with customers but didn&amp;#39;t emphasize what she did. &lt;/li&gt;&lt;li&gt;She is looking to grow. What about the job she is applying for? Will she stay content for long? &lt;/li&gt;&lt;/ul&gt;  &lt;br&gt;  The secret to successfully responding to this free-form request is to focus, script and practice. You cannot afford to wing this answer, as it will affect the rest of the interview. Begin to think about what you want the interviewer to know about you. &lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;b&gt;Focus&lt;/b&gt;  &lt;br&gt;  List five strengths you have that are pertinent to this job (experiences, traits, skills, etc.). What do you want the interviewer to know about you when you leave? Eleanor is strong in communications and connecting with people. She has a strong background and proven success with customer relationships. Her real strength is her follow-through. She prides herself on her reputation for meeting deadlines. &lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;b&gt;Scripting&lt;/b&gt;    Prepare a script that includes the information you want to convey. Begin by talking about past experiences and proven success:  &lt;blockquote&gt;&amp;quot;I have been in the customer service industry for the past five years. My most recent experience has been handling incoming calls in the high tech industry. One reason I particularly enjoy this business, and the challenges that go along with it, is the opportunity to connect with people. In my last job, I formed some significant customer relationships resulting in a 30 percent increase in sales in a matter of months.&amp;quot;&lt;/blockquote&gt;   Next, mention your strengths and abilities:  &lt;blockquote&gt;&amp;quot;My real strength is my attention to detail. I pride myself on my reputation for following through and meeting deadlines. When I commit to doing something, I make sure it gets done, and on time.&amp;quot;&lt;br&gt;&lt;br&gt;Conclude with a statement about your current situation:  &lt;blockquote&gt;&amp;quot;What I am looking for now is a company that values customer relations, where I can join a strong team and have a positive impact on customer retention and sales.&amp;quot;&lt;/blockquote&gt;  &lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;b&gt;Practice&lt;/b&gt;&lt;b&gt;&lt;br&gt;&lt;/b&gt;  Practice with your script until you feel confident about what you want to emphasize in your statement. Your script should help you stay on track, but you shouldn&amp;#39;t memorize it -- you don&amp;#39;t want to sound stiff and rehearsed. It should sound natural and conversational. Even if you are not asked this type of question to begin the interview, this preparation will help you focus on what you have to offer. You will also find that you can use the information in this exercise to assist you in answering other questions. The more you can talk about your product -- you -- the better chance you will have at selling it. &lt;br&gt;                                                 &lt;br&gt;&lt;div align=&quot;center&quot;&gt;All the best for your interview!&lt;/div&gt;&lt;div align=&quot;left&quot;&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;hr size=&quot;1&quot;&gt;&lt;br/&gt;</description></item><item><title>Personality Development</title><link>http://johnj2v.wetpaint.com/page/Personality+Development</link><author>vijayavenkatesh.2006</author><guid isPermaLink="false">http://johnj2v.wetpaint.com/page/Personality+Development</guid><pubDate>Sun, 24 Sep 2006 03:29:53 CDT</pubDate><description> 				&lt;div align=&quot;center&quot;&gt;&lt;/div&gt;&lt;div&gt;  &lt;div&gt;&lt;h2&gt;&lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.findarticles.com/p/articles/mi_g2699&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Encyclopedia of Psychology&lt;/a&gt; by &lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://www.findarticles.com/p/search?tb=art&amp;qt=%22Jerome+Kagan+Ph.D.%22&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;Jerome Kagan Ph.D.&lt;/a&gt;&lt;/h2&gt;&lt;/div&gt;&lt;/div&gt;               The concept of personality refers to the profile of stable beliefs, moods, and behaviors that differentiate among children (and adults) who live in a particular society. The profiles that differentiate children across cultures of different historical times will not be the same because the most adaptive profiles vary with the values of the society and the historical era. An essay on personality development written 300 years ago by a New England Puritan would have listed piety as a major psychological trait but that would not be regarded as an important personality trait in contemporary America.&lt;div align=&quot;left&quot;&gt; &lt;/div&gt;      Contemporary theorists emphasize personality traits having to do with individualism, internalized conscience, sociability with strangers, the ability to control strong emotion and impulse, and personal achievement.&lt;br&gt;&lt;br&gt;&lt;div align=&quot;left&quot;&gt; &lt;/div&gt;      An important reason for the immaturity of our understanding of personality development is the heavy reliance on questionnaires that are filled out by parents of children or the responses of older children to questionnaires. Because there is less use of behavioral observations of children, our theories of personality development are not strong.&lt;br&gt;&lt;br&gt;&lt;div align=&quot;left&quot;&gt; &lt;/div&gt;      There are five different hypotheses regarding the early origins of personality (see accompanying table). One assumes that the child&amp;#39;s inherited biology, usually called a temperamental bias, is an important basis for the child&amp;#39;s later personality. Alexander Thomas and StellaChess suggested there were nine temperamental dimensions along with three synthetic types they called the difficult child, the easy child, and the child who is slow to warm up to unfamiliarity. Longitudinal studies of children suggest that a shy and fearful style of reacting to challenge and novelty predicts, to a modest degree, an adult personality that is passive to challenge and introverted in mood.&lt;br&gt;&lt;div align=&quot;left&quot;&gt; &lt;/div&gt;      A second hypothesis regarding personality development comes from Sigmund Freud&amp;#39;s suggestion that variation in the sexual and aggressive aims of the id, which is biological in nature, combined with family experience, leads to the development of the ego and superego. Freud suggested that differences in parental socialization produced variation in anxiety which, in turn, leads to different personalities.&lt;br&gt;&lt;div align=&quot;left&quot;&gt; &lt;/div&gt;      A third set of hypotheses emphasizes direct social experiences with parents. After World War II, Americans and Europeans held the more benevolent idealistic conception of the child that described growth as motivated by affectionate ties to others rather than by the narcissism and hostility implied by Freud&amp;#39;s writings. John Bowlby contributed to this new emphasis on the infant&amp;#39;s relationships with parents in his books on attachment. Bowlby argued that the nature of the infant&amp;#39;s relationship to the caretakers and especially the mother created a profile of emotional reactions toward adults that might last indefinitely.&lt;br&gt;&lt;br&gt;&lt;div align=&quot;left&quot;&gt; &lt;/div&gt;      A fourth source of ideas for personality centers on whether or not it is necessary to posit a self that monitors, integrates, and initiates reaction. This idea traces itself to the Judeo-Christian assumption that it is necessary to award children a will so that they could be held responsible for their actions. A second basis is the discovery that children who had the same objective experiences develop different personality profiles because they construct different conceptions about themselves and others from the same experiences. The notion that each child imposes a personal interpretation to their experiences makes the concept of self critical to the child&amp;#39;s personality.&lt;br&gt;&lt;br&gt;&lt;div align=&quot;left&quot;&gt;   &lt;/div&gt;      An advantage of awarding importance to a concept of self and personality development is that the process of identification with parents and others gains in significance. All children wish to possess the qualities that their culture regards as good. Some of these qualities are the product of identification with each parent.&lt;br&gt;&lt;div align=&quot;left&quot;&gt; &lt;/div&gt;      A final source of hypotheses regarding the origins of personality comes from inferences based on direct observations of a child&amp;#39;s behavior. This strategy, which relies on induction, focuses on different characteristics at different ages. Infants differ in irritability, three-year-olds differ in shyness, and six-year-olds differ in seriousness of mood. A major problem with this approach is that each class of behavior can have different historical antecedents. Children who prefer to play alone rather than with others do so for a variety of reasons. Some might be temperamentally shy and are uneasy with other children while others might prefer solitary activity.&lt;br&gt;&lt;br&gt;&lt;div align=&quot;left&quot;&gt; &lt;/div&gt;The current categories of child psychopathology influenced the behaviors that are chosen by scientists for study. Fearfulness and conduct disorder predominate in clinical referrals to psychiatrists and psychologists. A cluster of behaviors that includes avoidance of unfamiliar events and places, fear of dangerous animals, shyness with strangers, sensitivity to punishment, and extreme guilt is called the internalizing profile. The cluster that includes disobedience toward parent and teachers, aggression to peers, excessive dominance of other children, and impulsive decisions is called the externalizing profile. These children are most likely to be at risk for later juvenile delinquency. The association between inability of a three-year-old to inhibit socially inappropriate behavior and later antisocial behavior is the most reliable predictive relation between a characteristic scene in the young child and later personality trait.&lt;br&gt;&lt;div align=&quot;left&quot;&gt; &lt;/div&gt;&lt;h2 align=&quot;left&quot;&gt;Influences on personality development&lt;/h2&gt;&lt;div align=&quot;left&quot;&gt; &lt;/div&gt;      &lt;br&gt;       The influence comes from a variety of temperament but especially ease of arousal, irritability, fearfulness, sociability, and activity level. The experiential contributions to personality include early attachment relations, parental socialization, identification with parents, class, and ethnic groups, experiences with other children, ordinal position in the family, physical attractiveness, and school success or failure, along with a number of unpredictable experiences like divorce, early parental death, mental illness in the family, and supporting relationships with relatives or teachers.&lt;br&gt;&lt;br&gt;&lt;div align=&quot;left&quot;&gt; &lt;/div&gt;The most important personality profiles in a particular culture stem from the challenges to which the children of that culture must accommodate. Most children must deal with three classes of external challenges: (1) unfamiliarity, especially unfamiliar people, tasks, and situations; (2) request by legitimate authority or conformity to and acceptance of their standards, and (3) domination by or attack by other children. In addition, all children must learn to control two important families of emotions: anxiety, fear, and guilt, on the one hand, and on the other, anger, jealousy, and resentment.&lt;br&gt;&lt;br&gt;Of the four important influences on personality-identification, ordinal position, social class, and parental socialization-identification is the most important. By six years of age, children assume that some of the characteristics of their parents belong to them and they experience vicariously the emotion that is appropriate to the parent&amp;#39;s experience. A six-year-old girl identified with her mother will experience pride should mother win a prize or be praised by a friend. However, she will experience shame or anxiety if her mother is criticized or is rejected by friends. The process of identification has great relevance to personalty development.       &lt;br&gt;&lt;br&gt;      The child&amp;#39;s ordinal position in the family has its most important influence on receptivity to accepting or rejecting the requests and ideas of legitimate authority. First-born children in most families are most willing than later-borns to conform to the requests of authority. They are more strongly motivated to achieve in school, more conscientious, and less aggressive.       &lt;br&gt;&lt;br&gt;      The child&amp;#39;s social class affects the preparation and motivation for academic achievement. Children from middle-class families typically obtain higher grades in school than children of working or lower-class families because different value systems and practices are promoted by families from varied social class backgrounds. &lt;br&gt;&lt;br&gt;       The patterns of socialization used by parents also influence the child&amp;#39;s personality. Baumrind suggests that parents could be classified as authoritative, authoritarian, or permissive. More competent and mature preschool children usually have authoritative parents who were nurturant but made maturity demands. Moderately self-reliant children who were a bit withdrawn have authoritarian parents who more often relied on coercive discipline. The least mature children have overly permissive parents who are nurturant but lack discipline. &lt;h3&gt;Further Reading&lt;/h3&gt; &lt;h3&gt;For Your Information&lt;/h3&gt; &lt;ul&gt;&lt;li&gt;Ainsworth, M. B. S., M. C. Blehar, E. Waters, and S. Wall. Patterns of Attachment. Hillsdale, NJ: L. Erlbaum, 1978. &lt;/li&gt;&lt;li&gt;Bowlby, J. Attachment. New York: Basic Books, 1969. &lt;/li&gt;&lt;li&gt;------. Loss: Sadness and Depression. New York: Basic Books, 1980. &lt;/li&gt;&lt;li&gt;------. Separation: Anxiety and Anger. New York: Basic Books, 1973. &lt;/li&gt;&lt;li&gt;Erikson, E. H. Childhood and Society. New York: W. W. Norton, 1963. &lt;/li&gt;&lt;li&gt;Kagan, J. Birth to Maturity. New York: Wiley, 1962. &lt;/li&gt;&lt;li&gt;------. Galen&amp;#39;s Prophecy. New York: Basic Books, 1994. &lt;/li&gt;&lt;li&gt;------. The Nature of the Child. rev. ed. New York: Basic Books, 1994. &lt;/li&gt;&lt;li&gt;Rothbart, M. K. &amp;quot;Temperament in Childhood.&amp;quot; n G. A. Kohnstamm, J. E. Bates, and M. K. Rothbart, eds. Temperament in Childhood. New York: Wiley, 1989, pp. 59-73. &lt;/li&gt;&lt;li&gt;Thomas, A. and S. Chess. Temperament and Development. New York: Brunner Mazel, 1977.&lt;/li&gt;&lt;/ul&gt;&lt;br&gt;&lt;br&gt;                                     &lt;br&gt;                     &lt;a class=&quot;external&quot; href=&quot;http://johnj2v.wetpaint.comhttp://web.tickle.com/tests/uiq/index-pop.jsp?sid=&amp;supp=&amp;z=&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt; &lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;i&gt;Gale Encyclopedia of Psychology&lt;/i&gt;, 2nd ed. Gale Group, 2001.&lt;br&gt;&lt;hr size=&quot;1&quot;&gt;&lt;br/&gt;</description></item></channel></rss>