<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2417146275985630760</id><updated>2011-07-30T17:22:26.317-07:00</updated><title type='text'>Java Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://h2kinfosysjava.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2417146275985630760/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://h2kinfosysjava.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>H2K Infosys</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='9' src='http://3.bp.blogspot.com/_MOwoK0SSY5Q/S61REN0TbiI/AAAAAAAAAAU/a6qPyyGT6NQ/S220/H2KLogoFinal.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2417146275985630760.post-5833580388832118099</id><published>2010-06-05T11:56:00.000-07:00</published><updated>2010-06-05T12:07:11.392-07:00</updated><title type='text'>Java Interview Questions</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: arial; font-size: 13px; line-height: 20px; "&gt;&lt;p&gt;&lt;strong&gt;What is the Java API?&lt;/strong&gt;&lt;/p&gt;&lt;p&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;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;What is the Java Virtual Machine (JVM)?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;The Java Virtual Machine is software that can be ported onto various hardware-based platforms&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; line-height: normal; font-size: small; "&gt;&lt;strong&gt;What is the difference between an Interface and an Abstract class?&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; line-height: normal; font-size: small; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&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;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; line-height: normal; font-size: small; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; line-height: normal; font-size: small; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0" class="bodytext" style="font-family: 'Times New Roman'; font-size: medium; "&gt;&lt;tbody&gt;&lt;tr valign="top"&gt;&lt;td width="97%" class="bodytext"&gt;&lt;p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;What is the purpose of garbage collection in Java, and when is it used?&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&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;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;b&gt;Explain different way of using thread?&lt;/b&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;The thread could be implemented by using runnable interface or by inheriting from the Thread class. The former is more advantageous, 'cause when you are going for multiple inheritance..the only interface can help.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0" class="bodytext" style="font-family: 'Times New Roman'; font-size: medium; "&gt;&lt;tbody&gt;&lt;tr valign="top"&gt;&lt;td width="97%" class="bodytext"&gt;&lt;p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Describe synchronization in respect to multithreading.&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; font-size: medium; "&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size:85%;"&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;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; font-size: medium; "&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;What are pass by reference and passby value?&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; "&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;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; "&gt;&lt;strong&gt;Difference between HashMap and HashTable?&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; font-size: medium; "&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&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;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; font-size: medium; "&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;synchronized&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; font-size: medium; "&gt;.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; font-size: medium; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; "&gt;&lt;b&gt;Difference between Vector and ArrayList?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; font-size: medium; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; "&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;Vector is synchronized whereas arraylist is not.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; font-size: medium; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; "&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;What is the difference between a constructor and a method?&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; font-size: medium; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; "&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&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;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; font-size: medium; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; "&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;What is an abstract class?&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; font-size: medium; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; "&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&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;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; font-size: medium; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; "&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;What is final?&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; font-size: medium; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; "&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;A final class can't be extended ie., final class may not be subclassed. A final method can't be overridden when its class is inherited. You can't change value of a final variable (is a constant).&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; font-size: medium; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; "&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;What is static in java?&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; font-size: medium; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; "&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&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't override a static method with a nonstatic method. In other words, you can't change a static method into an instance method in a subclass.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; font-size: medium; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; "&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;What are Checked and UnChecked Exception?&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; font-size: medium; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; "&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&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's read() method·&lt;br /&gt;Unchecked exceptions are RuntimeException and any of its subclasses. Class Error and its subclasses also are unchecked. With an unchecked exception, however, the compiler doesn't force client programmers either to catch the&lt;br /&gt;exception or declare it in a throws clause. In fact, client programmers may not even know that the exception could be thrown. eg, StringIndexOutOfBoundsException thrown by String's charAt() method· Checked exceptions must be caught at compile time. Runtime exceptions do not need to be. Errors often cannot be.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; font-size: medium; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; "&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;What is Overriding?&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; font-size: medium; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; "&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&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;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span"  style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; font-size: medium; "&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: small; "&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-weight: normal; font-size: medium; "&gt;&lt;span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:85%;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2417146275985630760-5833580388832118099?l=h2kinfosysjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://h2kinfosysjava.blogspot.com/feeds/5833580388832118099/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://h2kinfosysjava.blogspot.com/2010/06/java-interview-questions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2417146275985630760/posts/default/5833580388832118099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2417146275985630760/posts/default/5833580388832118099'/><link rel='alternate' type='text/html' href='http://h2kinfosysjava.blogspot.com/2010/06/java-interview-questions.html' title='Java Interview Questions'/><author><name>H2K Infosys</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='9' src='http://3.bp.blogspot.com/_MOwoK0SSY5Q/S61REN0TbiI/AAAAAAAAAAU/a6qPyyGT6NQ/S220/H2KLogoFinal.JPG'/></author><thr:total>0</thr:total></entry></feed>
