<?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-15047166</id><updated>2011-12-13T19:57:20.492-08:00</updated><title type='text'>Java, SCJP, Core Java Programming</title><subtitle type='html'>Java, SCJP: Sun Certified Java Programmer, Core Java Programming</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://java-coders.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15047166/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://java-coders.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>shabda</name><uri>http://www.blogger.com/profile/07961528262493927188</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>24</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-15047166.post-7953203930873780620</id><published>2011-10-13T04:45:00.001-07:00</published><updated>2011-10-13T04:45:47.294-07:00</updated><title type='text'>Django web development</title><content type='html'>You can find me now blogging at &lt;a href="http://agiliq.com/"&gt;Agiliq.com&lt;/a&gt; where I  blog about &lt;a href="http://agiliq.com/blog/"&gt;Django Web Development&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15047166-7953203930873780620?l=java-coders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-coders.blogspot.com/feeds/7953203930873780620/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15047166&amp;postID=7953203930873780620' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15047166/posts/default/7953203930873780620'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15047166/posts/default/7953203930873780620'/><link rel='alternate' type='text/html' href='http://java-coders.blogspot.com/2011/10/django-web-development.html' title='Django web development'/><author><name>shabda</name><uri>http://www.blogger.com/profile/07961528262493927188</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15047166.post-114391925391908739</id><published>2006-04-01T11:19:00.000-08:00</published><updated>2006-04-01T11:21:03.060-08:00</updated><title type='text'>Declarations and Access Control</title><content type='html'>&lt;a href="file:///C:/temp/java/d0e34.htm"&gt;&lt;/a&gt;&lt;a href="file:///C:/temp/java/d0e409.htm"&gt;&lt;/a&gt;&lt;p&gt;&lt;a name="d0e115"&gt;&lt;hr /&gt;             &lt;/a&gt;
&lt;table bg border="0" cellpadding="5" cellspacing="0" width="100%" style="color:black;"&gt;             &lt;tbody&gt;&lt;tr&gt;                &lt;td class="objh"&gt;&lt;span style="color:white;"&gt;&lt;a name="d0e118"&gt;&lt;/a&gt;Write code that declares, constructs and initializes arrays of any base type using any of the permitted forms both for declaration and for initialization. &lt;/span&gt;&lt;/td&gt;             &lt;/tr&gt;          &lt;/tbody&gt;&lt;/table&gt;          &lt;/p&gt;&lt;h3&gt;&lt;a name="d0e120"&gt;&lt;/a&gt;Declaring arrays:          &lt;/h3&gt;          &lt;p&gt;For example,use either &lt;/p&gt;&lt;pre&gt; int[] x;&lt;/pre&gt;&lt;p&gt;or&lt;/p&gt;&lt;pre&gt; int x[];&lt;/pre&gt;&lt;p&gt;Both are legal positions for the brackets. To declare a multidimensional array, use multiple sets of brackets,             e.g. &lt;code&gt;int i[][];&lt;/code&gt; declares a two dimensional array. Note that, for example, &lt;code&gt;int[]i[];&lt;/code&gt; is also legal, and means the same thing. In Java, multidimensional arrays can be "not square" i.e. they are just arrays of arrays, and each of those constituent arrays can be of a different size. &lt;/p&gt;          &lt;h3&gt;&lt;a name="d0e138"&gt;&lt;/a&gt;Construct arrays:          &lt;/h3&gt;          &lt;p&gt;Arrays are objects. Use the &lt;code&gt;new&lt;/code&gt; keyword to construct them. For example having declared an array i:          &lt;/p&gt;&lt;pre&gt;int[] i;&lt;/pre&gt;&lt;p&gt;you then construct the array and assign it to i as follows:&lt;/p&gt;&lt;pre&gt;i = new int[10];&lt;/pre&gt;&lt;p&gt;The size of the array is in the brackets (in this example 10). It is common to do both operations in one statement:&lt;/p&gt;&lt;pre&gt;int i[] = new int[10];&lt;/pre&gt;&lt;h3&gt;&lt;a name="d0e155"&gt;&lt;/a&gt;To initialize an array using loop iteration:          &lt;/h3&gt;          &lt;p&gt;An example:&lt;/p&gt;&lt;pre&gt; int array[] = new int[15];
 for(int j=0; j&lt;array.length;j++){
  array[j]=j;
 }&lt;/pre&gt;&lt;h3&gt;&lt;a name="d0e161"&gt;&lt;/a&gt;Write code to initialize an array using the combined declaration and initialization format:          &lt;/h3&gt;          &lt;p&gt;An example:&lt;/p&gt;&lt;pre&gt;char c[]= new char[] {'a','b','c','d','e'};&lt;/pre&gt;&lt;p&gt;or you can use&lt;/p&gt;&lt;pre&gt;char c[]= {'a','b','c','d','e'};&lt;/pre&gt;
&lt;table bg border="0" cellpadding="5" cellspacing="0" width="100%" style="color:black;"&gt;             &lt;tbody&gt;&lt;tr&gt;                &lt;td class="objh"&gt;&lt;span style="color:white;"&gt;&lt;a name="d0e172"&gt;&lt;/a&gt;Declare classes, nested classes, methods, instance variables, static variables and automatic (method local)                      variables making appropriate use of all permitted modifiers (such as &lt;code&gt;public&lt;/code&gt;, &lt;code&gt;final&lt;/code&gt;,                      &lt;code&gt;static&lt;/code&gt;, &lt;code&gt;abstract&lt;/code&gt; etc.). State the significance of each of these modifiers both singly and in combination and state the effect of package relationships on declared items qualified by these modifiers. &lt;/span&gt;&lt;/td&gt;             &lt;/tr&gt;          &lt;/tbody&gt;&lt;/table&gt;          &lt;p&gt;This is fundamental Java. If you are unsure of this topic, see a textbook.&lt;/p&gt;          &lt;p&gt;A good  but technical reference for these kinds of issues is the Java Language Specification (not for beginners).             It is available at the following URL:            
&lt;a href="http://java.sun.com/docs/books/jls/html/index.html"&gt;http://java.sun.com/docs/books/jls/html/index.html&lt;/a&gt;&lt;/p&gt;          &lt;h3&gt;&lt;a name="d0e193"&gt;&lt;/a&gt;Some terms and their synonyms:          &lt;/h3&gt;          &lt;p&gt;&lt;u&gt;Scope/Visibility:&lt;/u&gt; Where something can be seen / is accessable from.          &lt;/p&gt;          &lt;p&gt;&lt;u&gt;Nested/Inner Class:&lt;/u&gt; A class whose code sits inside the body of another 'outer' class. It exists 'inside' the class in that it             can see the private methods and variables.          &lt;/p&gt;          &lt;p&gt;&lt;u&gt;Instance/Member:&lt;/u&gt; Means the method/variable/nested class belongs to each object which is an instance of the class.             The term 'a member'             is often used to refer to both methods and variables of this type.             Cannot be accessed by statically i.e. without having an instance of the class.          &lt;/p&gt;          &lt;p&gt;&lt;u&gt;Class/Static:&lt;/u&gt; The method/variable/nested class belongs to the class as opposed to the instances of the class. Can be used without creating an instance of the class, but static methods/nested class cannot use instancts variables/methods. &lt;/p&gt;          &lt;p&gt;&lt;u&gt;Local/Automatic variable:&lt;/u&gt; A variable which is declared within a method or as a parameter to the method.             Cannot be seen outside the method.          &lt;/p&gt;          &lt;h3&gt;&lt;a name="d0e215"&gt;&lt;/a&gt;Scoping Types          &lt;/h3&gt;          &lt;p&gt;"default" or "friendly" - this is where no modifier is used. Means something is only visible to classes in the same package.&lt;/p&gt;          &lt;p&gt;&lt;code&gt;protected&lt;/code&gt; - can only be accessed by classes in the same package or subclasses of this class. This frequently surprises experienced developers, especially those with a prior backround in the mutant hybrid of object orientated programming and assembly language known as 'C++' :-) To fair the name is misleading, as it sounds like it restricts access, where as it in fact it adds subclasses outside the package to the list of things that can access the item in question, as compared to using "default" access. &lt;/p&gt;          &lt;p&gt;&lt;code&gt;public&lt;/code&gt; - can be accessed by any other class.                       &lt;/p&gt;          &lt;p&gt;&lt;code&gt;private&lt;/code&gt; - can only be accessed from inside the class.           &lt;/p&gt;          &lt;h3&gt;&lt;a name="d0e231"&gt;&lt;/a&gt;Declare classes using the modifiers &lt;code&gt;public&lt;/code&gt;, &lt;code&gt;abstract&lt;/code&gt; or &lt;code&gt;final&lt;/code&gt;:          &lt;/h3&gt;          &lt;p&gt;&lt;code&gt;public&lt;/code&gt; - is visible outside of its package. Without this modifier, the class cannot be accessed outside             its package.                       &lt;/p&gt;          &lt;p&gt;&lt;code&gt;abstract&lt;/code&gt; - cannot be instantiated, is allowed to contain &lt;code&gt;abstract&lt;/code&gt; methods.                       &lt;/p&gt;          &lt;p&gt;&lt;code&gt;final&lt;/code&gt; - cannot be subsclassed.          &lt;/p&gt;          &lt;h3&gt;&lt;a name="d0e257"&gt;&lt;/a&gt;Using the modifiers &lt;code&gt;private&lt;/code&gt;, &lt;code&gt;protected&lt;/code&gt;, &lt;code&gt;public&lt;/code&gt;, &lt;code&gt;static&lt;/code&gt;,             &lt;code&gt;final&lt;/code&gt;, &lt;code&gt;native&lt;/code&gt; or &lt;code&gt;abstract&lt;/code&gt;:          &lt;/h3&gt;          &lt;p&gt;&lt;code&gt;private&lt;/code&gt; - can only be accessed from inside the class. Private members are not inherited by subclasses. Inner classes             can be declared &lt;code&gt;private&lt;/code&gt;.                       &lt;/p&gt;          &lt;p&gt;&lt;code&gt;protected&lt;/code&gt; - can only be accessed by classes in the same package or subclasses of this class.                       &lt;/p&gt;          &lt;p&gt;&lt;code&gt;public&lt;/code&gt; - can be accessed by any other class.                       &lt;/p&gt;          &lt;p&gt;&lt;code&gt;static&lt;/code&gt; - belongs to the class rather than any particular instance of the class. For variables, effectively, there is just one copy of this variable for all instances of the class, and if an instance changes the value, the other instances see that new value. For methods, it means the method can be called without having created an instance, but within the methodd you cannot use the &lt;code&gt;this&lt;/code&gt; keyword, or refer to instance variables and methods directly (without creating an instance and referring to the variable/class in that instance). For inner classes, it means they can be instantiated without having an instance of the enclosing class, but as with static methods, the methods of the inner class cannot refer to instance variables or methods of the enclosing class directly. &lt;/p&gt;          &lt;p&gt;&lt;code&gt;final&lt;/code&gt; - cannot be changed. Variables are constants, methods cannot be overridden, classes cannot be subclassed. Since Java1.1 you can declare the variable without assigning a value. Once you assign a value, you cannot change it. The are known as 'blank' finals, are frequently used for things like constants you wish to initialise from a configuration file. &lt;/p&gt;          &lt;p&gt;&lt;code&gt;native&lt;/code&gt; - a &lt;b&gt;method&lt;/b&gt; which is not written in java and is outside the JVM in a library.                       &lt;/p&gt;          &lt;p&gt;&lt;code&gt;abstract&lt;/code&gt; - a &lt;b&gt;method&lt;/b&gt; which is not implemented. Must be implemented in a subclass if that subclass is to be             'concrete' and allow people to instantiate it.          &lt;/p&gt;          &lt;h2&gt;&lt;a name="d0e320"&gt;&lt;/a&gt;Nested Classes          &lt;/h2&gt;          &lt;h3&gt;&lt;a name="d0e322"&gt;&lt;/a&gt;To define a non-static nested class either in a class or method scope:          &lt;/h3&gt;          &lt;p&gt;Place the class definition (for the nested class) inside another class definition (the outer class) or a method.&lt;/p&gt;          &lt;h3&gt;&lt;a name="d0e326"&gt;&lt;/a&gt;To define, in method scope, an anonymous nested class that implements a specified interface:          &lt;/h3&gt;          &lt;p&gt;An anonymous nested class is defined where is it instantiated (in a method). An anonymous nested class must either             implement an interface or extend a class, but the &lt;code&gt;implements&lt;/code&gt; or &lt;code&gt;extends&lt;/code&gt; keywords are not used. For example the following line causes the method to return an object which is an instance of an anonymous nested class: &lt;/p&gt;&lt;pre&gt;return new SomeClass() { /*body of the anonymous class goes here*/ };&lt;/pre&gt;&lt;p&gt;You might like to think of an anonymous nested class as part of a really long &lt;code&gt;new&lt;/code&gt; statement, which happens to             contain a class definition, and which is why it has a ";" at the end.              The following example calls &lt;code&gt;someMethod()&lt;/code&gt;, passing an instance of the anonymous nested class:          &lt;/p&gt;&lt;pre&gt;someMethod(new SomeClass() { /*body of the anonymous class goes here*/ });&lt;/pre&gt;&lt;p&gt;In both cases &lt;code&gt;SomeClass()&lt;/code&gt; is not the name of the anonymous class (anonymous means it has no name) rather is it the name of the class that you are extending or the interface you are implementing. These classes cannot define a constructor, as they do not have a name that you can use to declare the constructor method. If SomeClass() is a class, the default constructor of that class is called, if you want to use a non-default constructor instead, you supply arguments e.g.: &lt;/p&gt;&lt;pre&gt;return new SomeClass(12) { /*body of the anonymous class goes here*/ };&lt;/pre&gt;&lt;p&gt;will call the SomeClass constructor which takes an int.&lt;/p&gt;          &lt;h3&gt;&lt;a name="d0e357"&gt;&lt;/a&gt;Write code in a non-static method of the outer class to construct an instance of the nested class.          &lt;/h3&gt;&lt;code&gt;Inner x = new Inner();&lt;/code&gt; constructs an instance of Inner where Inner is a nested class defined in the current class.                              &lt;h3&gt;&lt;a name="d0e362"&gt;&lt;/a&gt;Write code to construct an instance on a nested class where either no &lt;code&gt;this&lt;/code&gt; object exists,             or the current &lt;code&gt;this&lt;/code&gt; object is not an instance of the outer class.          &lt;/h3&gt;          You must create an instance of the outer class first. Given a class, Outer, containing a nested class Inner:          &lt;pre&gt;Outer.Inner y = new Outer().new Inner();&lt;/pre&gt;&lt;p&gt;The above creates an instance of Inner called y, but it had to construct an instance of Outer first. The following example creates the Outer instance on a separate line, the syntax in the second line is the one you use when you already have an instance of the outer class. &lt;/p&gt;&lt;pre&gt;Outer x = new Outer();
Outer.Inner y = x.new Inner();&lt;/pre&gt;          If Inner is static, you can use:          &lt;pre&gt;Outer.Inner I= new Outer.Inner();&lt;/pre&gt;&lt;h3&gt;&lt;a name="d0e380"&gt;&lt;/a&gt;State which variables and methods in enclosing scopes are accessible from methods of the inner class.          &lt;/h3&gt;          &lt;p&gt; A non-static inner class has access to all member variables and methods of the containing class. If the inner class is defined inside a method, it has access to those method (a.k.a. automatic or local) variables which are declared &lt;code&gt;final&lt;/code&gt;, in addition to the above.                       &lt;/p&gt;          &lt;p&gt;A static inner class is restricted in the same way as a static method: it cannot refer to instance variables and methods of the containing class directly (without creating an instance and referring to the variable/class in that instance). &lt;/p&gt;
&lt;table bg border="0" cellpadding="5" cellspacing="0" width="100%" style="color:black;"&gt;             &lt;tbody&gt;&lt;tr&gt;                &lt;td class="objh"&gt;&lt;span style="color:white;"&gt;&lt;a name="d0e390"&gt;&lt;/a&gt;For a given class, determine if a default constructor will be created and if so state the prototype of that constructor. &lt;/span&gt;&lt;/td&gt;             &lt;/tr&gt;          &lt;/tbody&gt;&lt;/table&gt;          &lt;p&gt;The default constructor takes no arguments e.g. &lt;code&gt;classname()&lt;/code&gt; where classname is the name of you class.              A default constructor is automatically created only if you do not create &lt;b&gt;any&lt;/b&gt; constructors in your class.              If you create a non-default constructor (i.e. one that takes an argument), then you may have to create a default one             yourself, if you want there to be one.                        &lt;/p&gt;          &lt;p&gt;All constructors call the default constructor of its parents class (if there is one), and so on up the hierarchy to Object,             unless you specify a different constructor using &lt;code&gt;super(...)&lt;/code&gt; (to use a constructor in the parent) or &lt;code&gt;this(...)&lt;/code&gt;.              If you use such calls, they must be the first thing in the constructor.                       &lt;/p&gt;              &lt;p align="center"&gt;          &lt;/p&gt;&lt;hr /&gt;&lt;a href="file:///C:/temp/java/d0e409.htm"&gt;&lt;/a&gt;©1999, 2000, 2002 Dylan Walsh.  Under free documentation liscence.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15047166-114391925391908739?l=java-coders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-coders.blogspot.com/feeds/114391925391908739/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15047166&amp;postID=114391925391908739' title='57 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15047166/posts/default/114391925391908739'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15047166/posts/default/114391925391908739'/><link rel='alternate' type='text/html' href='http://java-coders.blogspot.com/2006/04/declarations-and-access-control.html' title='Declarations and Access Control'/><author><name>shabda</name><uri>http://www.blogger.com/profile/07961528262493927188</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>57</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15047166.post-114029749631969287</id><published>2006-02-18T13:14:00.000-08:00</published><updated>2006-02-18T13:18:19.253-08:00</updated><title type='text'>This link is to get listed in a directory.</title><content type='html'>&lt;a href="http://www.human-anatomy.net"&gt;Human-Anatomy.net Software&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15047166-114029749631969287?l=java-coders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-coders.blogspot.com/feeds/114029749631969287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15047166&amp;postID=114029749631969287' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15047166/posts/default/114029749631969287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15047166/posts/default/114029749631969287'/><link rel='alternate' type='text/html' href='http://java-coders.blogspot.com/2006/02/this-link-is-to-get-listed-in.html' title='This link is to get listed in a directory.'/><author><name>shabda</name><uri>http://www.blogger.com/profile/07961528262493927188</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15047166.post-113582471837034612</id><published>2005-12-28T18:43:00.000-08:00</published><updated>2005-12-28T18:51:59.086-08:00</updated><title type='text'></title><content type='html'>&lt;a name="d0e115"&gt;&lt;h2&gt;
&lt;/h2&gt;Written by &lt;small&gt;Dylan Walsh. Released under FDL.&lt;/small&gt;

&lt;h2&gt;Declarations and Access Control&lt;/h2&gt; &lt;/a&gt;
 &lt;table bg border="0" cellpadding="5" cellspacing="0" width="100%" style="color:black;"&gt;  &lt;tbody&gt; &lt;tr&gt; &lt;td class="objh"&gt;&lt;span style="color:white;"&gt;&lt;a name="d0e118"&gt;&lt;/a&gt;Write code that declares,  constructs and initializes arrays of any base type using any of the permitted  forms both for declaration and for initialization.  &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt; &lt;/table&gt;  &lt;h3&gt;&lt;a name="d0e120"&gt;&lt;/a&gt;Declaring arrays: &lt;/h3&gt;  &lt;p&gt;For example,use either &lt;/p&gt; &lt;pre&gt; int[] x;&lt;/pre&gt;  &lt;p&gt;or&lt;/p&gt; &lt;pre&gt; int x[];&lt;/pre&gt;  &lt;p&gt;Both are legal positions for the brackets. To declare a multidimensional  array, use multiple sets of brackets, e.g. &lt;code&gt;int i[][];&lt;/code&gt; declares a  two dimensional array. Note that, for example, &lt;code&gt;int[]i[];&lt;/code&gt; is also  legal, and means the same thing. In Java, multidimensional arrays can be "not  square" i.e. they are just arrays of arrays, and each of those constituent  arrays can be of a different size. &lt;/p&gt;  &lt;h3&gt;&lt;a name="d0e138"&gt;&lt;/a&gt;Construct arrays: &lt;/h3&gt;  &lt;p&gt;Arrays are objects. Use the &lt;code&gt;new&lt;/code&gt; keyword to construct them. For  example having declared an array i: &lt;/p&gt; &lt;pre&gt;int[] i;&lt;/pre&gt;  &lt;p&gt;you then construct the array and assign it to i as follows:&lt;/p&gt; &lt;pre&gt;i = new int[10];&lt;/pre&gt;  &lt;p&gt;The size of the array is in the brackets (in this example 10). It is common  to do both operations in one statement:&lt;/p&gt; &lt;pre&gt;int i[] = new int[10];&lt;/pre&gt;  &lt;h3&gt;&lt;a name="d0e155"&gt;&lt;/a&gt;To initialize an array using loop iteration: &lt;/h3&gt;  &lt;p&gt;An example:&lt;/p&gt; &lt;pre&gt; int array[] = new int[15];
 for(int j=0; j&lt;array.length;j++){
  array[j]=j;
 }&lt;/pre&gt;  &lt;h3&gt;&lt;a name="d0e161"&gt;&lt;/a&gt;Write code to initialize an array using the combined  declaration and initialization format: &lt;/h3&gt;  &lt;p&gt;An example:&lt;/p&gt; &lt;pre&gt;char c[]= new char[] {'a','b','c','d','e'};&lt;/pre&gt;  &lt;p&gt;or you can use&lt;/p&gt; &lt;pre&gt;char c[]= {'a','b','c','d','e'};&lt;/pre&gt;
 &lt;table bg border="0" cellpadding="5" cellspacing="0" width="100%" style="color:black;"&gt;  &lt;tbody&gt; &lt;tr&gt; &lt;td class="objh"&gt;&lt;span style="color:white;"&gt;&lt;a name="d0e172"&gt;&lt;/a&gt;Declare classes, nested  classes, methods, instance variables, static variables and automatic (method  local) variables making appropriate use of all permitted modifiers (such as  &lt;code&gt;public&lt;/code&gt;, &lt;code&gt;final&lt;/code&gt;, &lt;code&gt;static&lt;/code&gt;,  &lt;code&gt;abstract&lt;/code&gt; etc.). State the significance of each of these modifiers  both singly and in combination and state the effect of package relationships on  declared items qualified by these modifiers. &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt; &lt;/table&gt;  &lt;p&gt;This is fundamental Java. If you are unsure of this topic, see a  textbook.&lt;/p&gt;  &lt;p&gt;A good but technical reference for these kinds of issues is the Java Language  Specification (not for beginners). It is available at the following URL:
&lt;a href="http://java.sun.com/docs/books/jls/html/index.html"&gt;http://java.sun.com/docs/books/jls/html/index.html&lt;/a&gt;&lt;/p&gt;  &lt;h3&gt;&lt;a name="d0e193"&gt;&lt;/a&gt;Some terms and their synonyms: &lt;/h3&gt;  &lt;p&gt;&lt;u&gt;Scope/Visibility:&lt;/u&gt; Where something can be seen / is accessable from.  &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Nested/Inner Class:&lt;/u&gt; A class whose code sits inside the body of another  'outer' class. It exists 'inside' the class in that it can see the private  methods and variables. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Instance/Member:&lt;/u&gt; Means the method/variable/nested class belongs to  each object which is an instance of the class. The term 'a member' is often used  to refer to both methods and variables of this type. Cannot be accessed by  statically i.e. without having an instance of the class. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Class/Static:&lt;/u&gt; The method/variable/nested class belongs to the class as  opposed to the instances of the class. Can be used without creating an instance  of the class, but static methods/nested class cannot use instancts  variables/methods. &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Local/Automatic variable:&lt;/u&gt; A variable which is declared within a method  or as a parameter to the method. Cannot be seen outside the method. &lt;/p&gt;  &lt;h3&gt;&lt;a name="d0e215"&gt;&lt;/a&gt;Scoping Types &lt;/h3&gt;  &lt;p&gt;"default" or "friendly" - this is where no modifier is used. Means something  is only visible to classes in the same package.&lt;/p&gt;  &lt;p&gt;&lt;code&gt;protected&lt;/code&gt; - can only be accessed by classes in the same package  or subclasses of this class. This frequently surprises experienced developers,  especially those with a prior backround in the mutant hybrid of object  orientated programming and assembly language known as 'C++' :-) To fair the name  is misleading, as it sounds like it restricts access, where as it in fact it  adds subclasses outside the package to the list of things that can access the  item in question, as compared to using "default" access. &lt;/p&gt;  &lt;p&gt;&lt;code&gt;public&lt;/code&gt; - can be accessed by any other class. &lt;/p&gt;  &lt;p&gt;&lt;code&gt;private&lt;/code&gt; - can only be accessed from inside the class. &lt;/p&gt;  &lt;h3&gt;&lt;a name="d0e231"&gt;&lt;/a&gt;Declare classes using the modifiers &lt;code&gt;public&lt;/code&gt;,  &lt;code&gt;abstract&lt;/code&gt; or &lt;code&gt;final&lt;/code&gt;: &lt;/h3&gt;  &lt;p&gt;&lt;code&gt;public&lt;/code&gt; - is visible outside of its package. Without this  modifier, the class cannot be accessed outside its package. &lt;/p&gt;  &lt;p&gt;&lt;code&gt;abstract&lt;/code&gt; - cannot be instantiated, is allowed to contain  &lt;code&gt;abstract&lt;/code&gt; methods. &lt;/p&gt;  &lt;p&gt;&lt;code&gt;final&lt;/code&gt; - cannot be subsclassed. &lt;/p&gt;  &lt;h3&gt;&lt;a name="d0e257"&gt;&lt;/a&gt;Using the modifiers &lt;code&gt;private&lt;/code&gt;,  &lt;code&gt;protected&lt;/code&gt;, &lt;code&gt;public&lt;/code&gt;, &lt;code&gt;static&lt;/code&gt;,  &lt;code&gt;final&lt;/code&gt;, &lt;code&gt;native&lt;/code&gt; or &lt;code&gt;abstract&lt;/code&gt;: &lt;/h3&gt;  &lt;p&gt;&lt;code&gt;private&lt;/code&gt; - can only be accessed from inside the class. Private  members are not inherited by subclasses. Inner classes can be declared  &lt;code&gt;private&lt;/code&gt;. &lt;/p&gt;  &lt;p&gt;&lt;code&gt;protected&lt;/code&gt; - can only be accessed by classes in the same package  or subclasses of this class. &lt;/p&gt;  &lt;p&gt;&lt;code&gt;public&lt;/code&gt; - can be accessed by any other class. &lt;/p&gt;  &lt;p&gt;&lt;code&gt;static&lt;/code&gt; - belongs to the class rather than any particular  instance of the class. For variables, effectively, there is just one copy of  this variable for all instances of the class, and if an instance changes the  value, the other instances see that new value. For methods, it means the method  can be called without having created an instance, but within the methodd you  cannot use the &lt;code&gt;this&lt;/code&gt; keyword, or refer to instance variables and  methods directly (without creating an instance and referring to the  variable/class in that instance). For inner classes, it means they can be  instantiated without having an instance of the enclosing class, but as with  static methods, the methods of the inner class cannot refer to instance  variables or methods of the enclosing class directly. &lt;/p&gt;  &lt;p&gt;&lt;code&gt;final&lt;/code&gt; - cannot be changed. Variables are constants, methods  cannot be overridden, classes cannot be subclassed. Since Java1.1 you can  declare the variable without assigning a value. Once you assign a value, you  cannot change it. The are known as 'blank' finals, are frequently used for  things like constants you wish to initialise from a configuration file. &lt;/p&gt;  &lt;p&gt;&lt;code&gt;native&lt;/code&gt; - a &lt;b&gt;method&lt;/b&gt; which is not written in java and is  outside the JVM in a library. &lt;/p&gt;  &lt;p&gt;&lt;code&gt;abstract&lt;/code&gt; - a &lt;b&gt;method&lt;/b&gt; which is not implemented. Must be  implemented in a subclass if that subclass is to be 'concrete' and allow people  to instantiate it. &lt;/p&gt;  &lt;h2&gt;&lt;a name="d0e320"&gt;&lt;/a&gt;Nested Classes &lt;/h2&gt;  &lt;h3&gt;&lt;a name="d0e322"&gt;&lt;/a&gt;To define a non-static nested class either in a class or  method scope: &lt;/h3&gt;  &lt;p&gt;Place the class definition (for the nested class) inside another class  definition (the outer class) or a method.&lt;/p&gt;  &lt;h3&gt;&lt;a name="d0e326"&gt;&lt;/a&gt;To define, in method scope, an anonymous nested class  that implements a specified interface: &lt;/h3&gt;  &lt;p&gt;An anonymous nested class is defined where is it instantiated (in a method).  An anonymous nested class must either implement an interface or extend a class,  but the &lt;code&gt;implements&lt;/code&gt; or &lt;code&gt;extends&lt;/code&gt; keywords are not used.  For example the following line causes the method to return an object which is an  instance of an anonymous nested class: &lt;/p&gt; &lt;pre&gt;return new SomeClass() { /*body of the anonymous class goes here*/ };&lt;/pre&gt;  &lt;p&gt;You might like to think of an anonymous nested class as part of a really long  &lt;code&gt;new&lt;/code&gt; statement, which happens to contain a class definition, and  which is why it has a ";" at the end. The following example calls  &lt;code&gt;someMethod()&lt;/code&gt;, passing an instance of the anonymous nested class:  &lt;/p&gt; &lt;pre&gt;someMethod(new SomeClass() { /*body of the anonymous class goes here*/ });&lt;/pre&gt;  &lt;p&gt;In both cases &lt;code&gt;SomeClass()&lt;/code&gt; is not the name of the anonymous class  (anonymous means it has no name) rather is it the name of the class that you are  extending or the interface you are implementing. These classes cannot define a  constructor, as they do not have a name that you can use to declare the  constructor method. If SomeClass() is a class, the default constructor of that  class is called, if you want to use a non-default constructor instead, you  supply arguments e.g.: &lt;/p&gt; &lt;pre&gt;return new SomeClass(12) { /*body of the anonymous class goes here*/ };&lt;/pre&gt;  &lt;p&gt;will call the SomeClass constructor which takes an int.&lt;/p&gt;  &lt;h3&gt;&lt;a name="d0e357"&gt;&lt;/a&gt;Write code in a non-static method of the outer class to  construct an instance of the nested class. &lt;/h3&gt; &lt;code&gt;Inner x = new  Inner();&lt;/code&gt; constructs an instance of Inner where Inner is a nested class  defined in the current class.  &lt;h3&gt;&lt;a name="d0e362"&gt;&lt;/a&gt;Write code to construct an instance on a nested class  where either no &lt;code&gt;this&lt;/code&gt; object exists, or the current  &lt;code&gt;this&lt;/code&gt; object is not an instance of the outer class. &lt;/h3&gt; You must  create an instance of the outer class first. Given a class, Outer, containing a  nested class Inner:  &lt;pre&gt;Outer.Inner y = new Outer().new Inner();&lt;/pre&gt;  &lt;p&gt;The above creates an instance of Inner called y, but it had to construct an  instance of Outer first. The following example creates the Outer instance on a  separate line, the syntax in the second line is the one you use when you already  have an instance of the outer class. &lt;/p&gt; &lt;pre&gt;Outer x = new Outer();
Outer.Inner y = x.new Inner();&lt;/pre&gt; If Inner is static, you can use:  &lt;pre&gt;Outer.Inner I= new Outer.Inner();&lt;/pre&gt;  &lt;h3&gt;&lt;a name="d0e380"&gt;&lt;/a&gt;State which variables and methods in enclosing scopes are  accessible from methods of the inner class. &lt;/h3&gt;  &lt;p&gt;A non-static inner class has access to all member variables and methods of  the containing class. If the inner class is defined inside a method, it has  access to those method (a.k.a. automatic or local) variables which are declared  &lt;code&gt;final&lt;/code&gt;, in addition to the above. &lt;/p&gt;  &lt;p&gt;A static inner class is restricted in the same way as a static method: it  cannot refer to instance variables and methods of the containing class directly  (without creating an instance and referring to the variable/class in that  instance). &lt;/p&gt;
 &lt;table bg border="0" cellpadding="5" cellspacing="0" width="100%" style="color:black;"&gt;  &lt;tbody&gt; &lt;tr&gt; &lt;td class="objh"&gt;&lt;span style="color:white;"&gt;&lt;a name="d0e390"&gt;&lt;/a&gt;For a given class, determine  if a default constructor will be created and if so state the prototype of that  constructor. &lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt; &lt;/table&gt;  &lt;p&gt;The default constructor takes no arguments e.g. &lt;code&gt;classname()&lt;/code&gt;  where classname is the name of you class. A default constructor is automatically  created only if you do not create &lt;b&gt;any&lt;/b&gt; constructors in your class. If you  create a non-default constructor (i.e. one that takes an argument), then you may  have to create a default one yourself, if you want there to be one. &lt;/p&gt;  &lt;p&gt;All constructors call the default constructor of its parents class (if there  is one), and so on up the hierarchy to Object, unless you specify a different  constructor using &lt;code&gt;super(...)&lt;/code&gt; (to use a constructor in the parent)  or &lt;code&gt;this(...)&lt;/code&gt;. If you use such calls, they must be the first thing  in the constructor. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15047166-113582471837034612?l=java-coders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-coders.blogspot.com/feeds/113582471837034612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15047166&amp;postID=113582471837034612' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15047166/posts/default/113582471837034612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15047166/posts/default/113582471837034612'/><link rel='alternate' type='text/html' href='http://java-coders.blogspot.com/2005/12/written-by-dylan-walsh.html' title=''/><author><name>shabda</name><uri>http://www.blogger.com/profile/07961528262493927188</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15047166.post-113025823589390009</id><published>2005-10-25T09:28:00.000-07:00</published><updated>2005-10-25T09:37:17.623-07:00</updated><title type='text'>Should I use an Ide while learning java.</title><content type='html'>Hmmmmmm. IDE's making coding really easy. And they save a lot of time. So If you are a serious Java developer coding without an IDE is realy foolish. But if you are trying to learn Java, and SCJP is an entry level certification, then dont even think about using an advanced IDE like Eclipse. In fact, I gave my SCJP exam after I had learnt a lot of Java and was using Eclipse for some time. I really had forgotten how to use the basic features, the features you are tested on in SCJP. So I had to leave using Eclipse for sometime. But a basic IDE with syntax highlighting, code explorer but certainly without code completion is ok. I would personaly recommend JCreator Lite. I did use it when I was beginning to use java.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15047166-113025823589390009?l=java-coders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-coders.blogspot.com/feeds/113025823589390009/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15047166&amp;postID=113025823589390009' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15047166/posts/default/113025823589390009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15047166/posts/default/113025823589390009'/><link rel='alternate' type='text/html' href='http://java-coders.blogspot.com/2005/10/should-i-use-ide-while-learning-java.html' title='Should I use an Ide while learning java.'/><author><name>shabda</name><uri>http://www.blogger.com/profile/07961528262493927188</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15047166.post-113025603841625165</id><published>2005-10-25T08:45:00.000-07:00</published><updated>2005-10-25T09:00:38.466-07:00</updated><title type='text'></title><content type='html'>&lt;a href=http://bobcat.webappcabaret.net/javachina/faq/01.htm&gt;
This site&lt;/a&gt; has some extremely good java resources. And it is completely free.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15047166-113025603841625165?l=java-coders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-coders.blogspot.com/feeds/113025603841625165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15047166&amp;postID=113025603841625165' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15047166/posts/default/113025603841625165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15047166/posts/default/113025603841625165'/><link rel='alternate' type='text/html' href='http://java-coders.blogspot.com/2005/10/this-site-has-some-extremely-good-java.html' title=''/><author><name>shabda</name><uri>http://www.blogger.com/profile/07961528262493927188</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15047166.post-112548082597371818</id><published>2005-08-31T02:32:00.000-07:00</published><updated>2005-08-31T02:33:46.020-07:00</updated><title type='text'>SCJP study notes:Chapter 8 java.lang package</title><content type='html'>&lt;h1&gt;
&lt;/h1&gt; Originally written by Velmurugan Periasamy. Copyright belongs to him.

&lt;h1&gt;Chapter 8 java.lang package&lt;/h1&gt;   &lt;p class="Preformatted" style="text-align: center;" align="center"&gt;&lt;b style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Object class is the ultimate ancestor of all classes. If there is no extends clause, compiler inserts ‘extends object’. The following methods are defined in Object class. All methods are public, if not specified otherwise.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;table class="MsoNormalTable" style="border: medium none ; margin-left: -30.6pt; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;   &lt;tbody&gt;&lt;tr style="height: 11.65pt;"&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0cm 5.4pt; width: 139.5pt; height: 11.65pt;" valign="top" width="186"&gt;   &lt;p class="Preformatted" style="text-align: center;" align="center"&gt;&lt;b style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Method&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 378pt; height: 11.65pt;" valign="top" width="504"&gt;   &lt;p class="Preformatted" style="text-align: center;" align="center"&gt;&lt;b style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Description&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 14.35pt;"&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 139.5pt; height: 14.35pt;" valign="top" width="186"&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;boolean equals(Object o)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 378pt; height: 14.35pt;" valign="top" width="504"&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;just does a == comparison, override in   descendents to provide meaningful comparison&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 14.35pt;"&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 139.5pt; height: 14.35pt;" valign="top" width="186"&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;final native void wait()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;final native void notify()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;final native void notifyAll()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 378pt; height: 14.35pt;" valign="top" width="504"&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Thread control. Two other versions of   wait() accept timeout parameters and may throw InterruptedException.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 14.35pt;"&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 139.5pt; height: 14.35pt;" valign="top" width="186"&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;native int hashcode()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 378pt; height: 14.35pt;" valign="top" width="504"&gt;   &lt;p class="MsoNormal"&gt;Returns a hash code value for the object.&lt;/p&gt;   &lt;p class="MsoNormal"&gt;If two objects are equal according to the &lt;span class="CODE"&gt;equals&lt;/span&gt; method, then calling the &lt;span class="CODE"&gt;hashCode&lt;/span&gt;   method on each of the two objects must produce the same integer result. &lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 14.35pt;"&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 139.5pt; height: 14.35pt;" valign="top" width="186"&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;protected Object clone() throws   CloneNotSupportedException&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;CloneNotSupportedException is a checked   Exception&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 378pt; height: 14.35pt;" valign="top" width="504"&gt;   &lt;p class="MsoNormal"&gt;Creates a new object of the same class as this object. It   then initializes each of the new object's fields by assigning it the same   value as the corresponding field in this object. &lt;b style=""&gt;No constructor is called.&lt;/b&gt; &lt;/p&gt;   &lt;p class="MsoNormal"&gt;The &lt;span class="CODE"&gt;clone&lt;/span&gt; method of class &lt;span class="CODE"&gt;Object&lt;/span&gt; will only clone an object whose class indicates that   it is willing for its instances to be cloned. A class indicates that its   instances can be cloned by declaring that it implements the &lt;span class="CODE"&gt;Cloneable&lt;/span&gt;   interface. Also the method has to be made public to be called from outside   the class. &lt;/p&gt;   &lt;p class="MsoNormal"&gt;Arrays have a public clone method. &lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;int ia[ ][ ] = { { 1 , 2}, null   };&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;int ja[ ][ ] = (int[ ] [   ])ia.clone();&lt;/p&gt;   &lt;p class="MsoNormal"&gt;A clone of a multidimensional array is shallow, which is to   say that it creates only a single new array. Subarrays are shared, so ia and   ja are different but ia[0] and ja[0] are same.&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 14.35pt;"&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 139.5pt; height: 14.35pt;" valign="top" width="186"&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;final native Class getClass()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 378pt; height: 14.35pt;" valign="top" width="504"&gt;   &lt;p class="MsoNormal"&gt;Returns the runtime class of an object. &lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 14.35pt;"&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 139.5pt; height: 14.35pt;" valign="top" width="186"&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;String toString&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 378pt; height: 14.35pt;" valign="top" width="504"&gt;   &lt;p class="MsoNormal"&gt;Returns the string representation of the object. Method in   Object returns a string consisting of the name of the class of which the   object is an instance, the at-sign character `&lt;span class="CODE"&gt;@&lt;/span&gt;', and   the unsigned hexadecimal representation of the hash code of the object.   Override to provide useful information.&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 14.35pt;"&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 139.5pt; height: 14.35pt;" valign="top" width="186"&gt;   &lt;p class="MsoNormal"&gt;protected void finalize() throws &lt;/p&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Throwable&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 378pt; height: 14.35pt;" valign="top" width="504"&gt;   &lt;p class="MsoNormal"&gt;Called by the garbage collector on an object when garbage   collection determines that there are no more references to the object. &lt;/p&gt;   &lt;p class="MsoNormal"&gt;Any exception thrown by the &lt;span class="CODE"&gt;finalize&lt;/span&gt;   method causes the finalization of this object to be halted, but is otherwise   ignored. &lt;/p&gt;   &lt;p class="MsoNormal"&gt;The &lt;span class="CODE"&gt;finalize&lt;/span&gt; method in &lt;span class="CODE"&gt;Object&lt;/span&gt; does nothing. A subclass overrides the &lt;span class="CODE"&gt;finalize&lt;/span&gt; method to dispose of system resources or to   perform other cleanup.&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Math class is final, cannot be sub-classed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Math constructor is private, cannot be instantiated.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;All constants and methods are public and static, just access using class name.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Two constants PI and E are specified.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Methods that implement Trigonometry functions are native. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;All Math trig functions take angle input in radians.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Angle degrees * PI / 180 = Angle radians&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Order of floating/double values:&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;-Infinity --&gt; Negative Numbers/Fractions --&gt; -0.0 --&gt; +0.0 --&gt; Positive Numbers/Fractions --&gt; Infinity &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;abs – int, long, float, double versions available&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;floor – greatest integer smaller than this number (look below towards the floor)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;ceil – smallest integer greater than this number (look above towards the ceiling)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;For floor and ceil functions, if the argument is NaN or infinity or positive zero or negative zero or already a value equal to a mathematical integer, the result is the same as the argument.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;For ceil, if the argument is less than zero but greater than –1.0, then the result is a negative zero&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;random – returns a double between 0.0(including) and 1.0(excluding)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;round returns a long for double, returns an int for float. (closest int or long value to the argument)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;The result is rounded to an integer by adding&lt;span style=""&gt;  &lt;/span&gt;½ , taking the floor of the result, and casting the result to type int / long.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;(int)Math.floor(a + 0.5f)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;(long)Math.floor(a + 0.5d)&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;double rint(double) returns closest double equivalent to a mathematical integer. If two values are equal, it returns the even integer value. rint(2.7) is 3, rint(2.5) is 2.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Math.min(-0.0, +0.0) returns –0.0, Math.max(-0.0, +0.0) returns 0.0, -0.0 == +0.0 returns true.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;For a NaN or a negative argument, sqrt returns a NaN.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Every primitive type has a wrapper class (some names are different – Integer, Boolean, Character)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Wrapper class objects are immutable.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;All Wrapper classes are final.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;All wrapper classes, except Character, have a constructor accepting string. A Boolean object, created by passing a string, will have a value of false for any input other than “true” (case doesn’t matter).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Numeric wrapper constructors will throw a NumberFormatException, if the passed string is not a valid number. (empty strings and null strings also throw this exception)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;equals also tests the class of the object, so even if an Integer object and a Long object are having the same value, equals will return false.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;NaN’s can be tested successfully with equals method. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Float f1 = new Float(Float.NaN);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Float f2 = new Float(Float.NaN);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;System.out.println( ""+ (f1 == f2)+"&lt;span style=""&gt;  &lt;/span&gt;"+f1.equals(f2)+ "&lt;span style=""&gt;  &lt;/span&gt;"+(Float.NaN == Float.NaN) );&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt;"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;The above code will print false true false.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Numeric wrappers have 6 methods to return the numeric value – intValue(), longValue(), etc.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;valueOf method parses an input string (optionally accepts a radix in case of int and long) and returns a new instance of wrapper class, on which it was invoked. It’s a static method. For empty/invalid/null strings it throws a NumberFormatException. For null strings valueOf in Float and Double classes throw NullPointerException.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;parseInt and parseLong return primitive int and long values respectively, parsing a string (optionally a radix). Throw a NumberFormatException for invalid/empty/null strings.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Numeric wrappers have overloaded toString methods, which accept corresponding primitive values (also a radix in case of int,long) and return a string.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Void class represents void primitive type. It’s not instantiable. Just a placeholder class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Strings are immutable.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;They can be created from a literal, a byte array, a char array or a string buffer.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Literals are taken from pool (for optimization), so == will return true, if two strings are pointing to the same literal.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Anonymous String objects (literals) may have been optimized even across classes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;A String created by new operator is always a different new object, even if it’s created from a literal.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;But a String can specify that its contents should be placed in a pool of unique strings for possible reuse, by calling intern() method. In programs that do a lot of String comparisons, ensuring that all Strings are in the pool, allows to use == comparison rather than the equals() method, which is slower.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;All string operations (concat, trim, replace, substring etc) construct and return new strings.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;toUpperCase and toLowerCase will return the same string if no case conversion was needed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;equals takes an object (String class also has a version of equals that accepts a String), equalsIgnoreCase takes a string. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Passing null to indexOf or lastIndexOf will throw NullPointerException, passing empty string returns 0, passing a string that’s not in the target string returns –1.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;trim method removes all leading and trailing white-space from a String and returns a new String. White-space means, all characters with value less than or equal to the space character – ‘\u0020’.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;String class is final.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;+ and += operators are overloaded for Strings. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;reverse, append, insert are not String methods.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;String Buffers are mutable strings.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;StringBuffer is a final class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;They can be created empty, from a string or with a capacity. An empty StringBuffer is created with 16-character capacity. A StringBuffer created from a String has the capacity of the length of String + 16. StringBuffers created with the specified capacity has the exact capacity specified. Since they can grow dynamically in size without bounds, capacity doesn’t have much effect.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;append, insert, setCharAt, reverse are used to manipulate the string buffer.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;setLength changes the length, if the current content is larger than specified length, it’s truncated. If it is smaller than the specified length, nulls are padded. This method doesn’t affect the capacity.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;equals on StringBuffer&lt;span style=""&gt;  &lt;/span&gt;does a shallow comparison. (same like ==) Will return true only if the objects are same. Don’t use it to test content equality&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;trim is not a StringBuffer method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;There is no relationship between String and StringBuffer. Both extend Object class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;String context means, ‘+’ operator appearing with one String operand. String concatenation cannot be applied to StringBuffers.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;A new String buffer is created.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;All operands are appended (by calling toString method, if needed)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Finally a string is returned by calling toString on the String Buffer.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;String concatenation process will add a string with the value of “null”, if an object reference is null and that object is appearing in a concatenation expression by itself. But if we try to access its members or methods, a NullPointerException is thrown. The same is true for arrays, array name is replaced with null, but trying to index it when it’s null throws a NullPointerException.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;span style="font-size: 10pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;
 &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15047166-112548082597371818?l=java-coders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-coders.blogspot.com/feeds/112548082597371818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15047166&amp;postID=112548082597371818' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15047166/posts/default/112548082597371818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15047166/posts/default/112548082597371818'/><link rel='alternate' type='text/html' href='http://java-coders.blogspot.com/2005/08/scjp-study-noteschapter-8-javalang.html' title='SCJP study notes:Chapter 8 java.lang package'/><author><name>shabda</name><uri>http://www.blogger.com/profile/07961528262493927188</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15047166.post-112548068305582641</id><published>2005-08-31T02:28:00.000-07:00</published><updated>2005-08-31T02:50:39.826-07:00</updated><title type='text'>SCJP study notes: Chapter 7 Threads</title><content type='html'>&lt;h1&gt;
&lt;/h1&gt; Originally written by Velmurugan Periasamy. Copyright belongs to him.

&lt;h1&gt;Chapter 7 Threads&lt;/h1&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; (Some info is outdated if you are preparing for the SCJP 1.4 exam).
&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Java is fundamentally multi-threaded.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Every thread corresponds to an instance of java.lang.Thread class or a sub-class.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;A thread becomes eligible to run, when its start() method is called. Thread scheduler co-ordinates between the threads and allows them to run.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;When a thread begins execution, the scheduler calls its run method.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;Signature of run method – public void run()&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;When a thread returns from its run method (or stop method is called – deprecated in 1.2), its dead. It cannot be restarted, but its methods can be called. (it’s just an object no more in a running state) &lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;If start is called again on a dead thread, IllegalThreadStateException is thrown.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;When a thread is in running state, it may move out of that state for various reasons. When it becomes eligible for execution again, thread scheduler allows it to run.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;There are two ways to implement threads.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;1.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Extend Thread class&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Create a new class, extending the Thread class.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Provide a public void run method, otherwise empty run in Thread class will be executed.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Create an instance of the new class.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Call start method on the instance (don’t call run – it will be executed on the same thread)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;2.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Implement Runnable interface&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Create a new class implementing the Runnable interface.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Provide a public void run method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Create an instance of this class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Create a Thread, passing the instance as a target – new Thread(object)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Target should implement Runnable, Thread class implements it, so it can be a target itself.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Call the start method on the Thread.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;JVM creates one user thread for running a program. This thread is called main thread. The main method of the class is called from the main thread. It dies when the main method ends. If other user threads have been spawned from the main thread, program keeps running even if main thread dies. Basically a program runs until all the user threads (non-daemon threads) are dead.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;A thread can be designated as a daemon thread by calling setDaemon(boolean) method. This method should be called before the thread is started, otherwise IllegalThreadStateException will be thrown.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;A thread spawned by a daemon thread is a daemon thread.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Threads have priorities. Thread class have constants MAX_PRIORITY (10), MIN_PRIORITY (1), NORM_PRIORITY (5)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;A newly created thread gets its priority from the creating thread. Normally it’ll be NORM_PRIORITY.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;getPriority and setPriority are the methods to deal with priority of threads.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Java leaves the implementation of thread scheduling to JVM developers. Two types of scheduling can be done.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;1.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;        &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Pre-emptive Scheduling.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt;"&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Ways for a thread to leave running state -&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;It can cease to be ready to execute ( by calling a blocking i/o method)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;It can get pre-empted by a high-priority thread, which becomes ready to execute.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;It can explicitly call a thread-scheduling method such as wait or suspend.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt;"&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Solaris JVM’s are pre-emptive.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Windows JVM’s were pre-emptive until Java 1.0.2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt;"&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;2.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;        &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Time-sliced or Round Robin Scheduling&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;A thread is only allowed to execute for a certain amount of time. After that, it has to contend for the CPU (virtual CPU, JVM) time with other threads.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;This prevents a high-priority thread mono-policing the CPU.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;The drawback with this scheduling is – it creates a non-deterministic system – at any point in time, you cannot tell which thread is running and how long it may continue to run.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt;"&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Mactinosh JVM’s &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Windows JVM’s after Java 1.0.2 &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Different states of a thread:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;1.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;        &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Yielding&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Yield is a static method. Operates on current thread.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Moves the thread from running to ready state.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;If there are no threads in ready state, the yielded thread may continue execution, otherwise it may have to compete with the other threads to run.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Run the threads that are doing time-consuming operations with a low priority and call yield periodically from those threads to avoid those threads locking up the CPU.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;2.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;        &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Sleeping&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Sleep is also a static method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Sleeps for a certain amount of time. (passing time without doing anything and w/o using CPU) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Two overloaded versions – one with milliseconds, one with milliseconds and nanoseconds.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Throws an InterruptedException.(must be caught)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;After the time expires, the sleeping thread goes to ready state. It may not execute immediately after the time expires. If there are other threads in ready state, it may have to compete with those threads to run. The correct statement is the sleeping thread would execute &lt;i style=""&gt;some time after&lt;/i&gt; the specified time period has elapsed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;If interrupt method is invoked on a sleeping thread, the thread moves to ready state. The next time it begins running, it executes the InterruptedException handler.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;3.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;        &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Suspending&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Suspend and resume are instance methods and are deprecated in 1.2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;A thread that receives a suspend call, goes to suspended state and stays there until it receives a resume call on it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;A thread can suspend it itself, or another thread can suspend it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;But, a thread can be resumed only by another thread.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Calling resume on a thread that is not suspended has no effect.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Compiler won’t warn you if suspend and resume are successive statements, although the thread may not be able to be restarted. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;4.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;        &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Blocking&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Methods that are performing I/O have to wait for some occurrence in the outside world to happen before they can proceed. This behavior is blocking.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;If a method needs to wait an indeterminable amount of time until some I/O takes place, then the thread should graciously step out of the CPU. All Java I/O methods behave this way.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;A thread can also become blocked, if it failed to acquire the lock of a monitor.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;5.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;        &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Waiting&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;wait, notify and notifyAll methods are not called on Thread, they’re called on Object. Because the object is the one which controls the threads in this case. It asks the threads to wait and then notifies when its state changes. It’s called a monitor.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Wait puts an executing thread into waiting state.(to the monitor’s waiting pool)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Notify moves one thread in the monitor’s waiting pool to ready state. We cannot control which thread is being notified. notifyAll is recommended.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;NotifyAll moves all threads in the monitor’s waiting pool to ready.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;These methods can only be called from synchronized code, or an IllegalMonitorStateException will be thrown. In other words, only the threads that obtained the object’s lock can call these methods.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Locks, Monitors and Synchronization&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Every object has a lock (for every synchronized code block). At any moment, this lock is controlled by &lt;u&gt;at most&lt;/u&gt; one thread.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;A thread that wants to execute an object’s synchronized code must acquire the lock of the object. If it cannot acquire the lock, the thread goes into blocked state and comes to ready only when the object’s lock is available.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;When a thread, which owns a lock, finishes executing the synchronized code, it gives up the lock.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Monitor (a.k.a Semaphore) is an object that can block and revive threads, an object that controls client threads. Asks the client threads to wait and notifies them when the time is right to continue, based on its state. In strict Java terminology, any object that has some synchronized code is a monitor.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;2 ways to synchronize:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 25.5pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;1.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;        &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Synchronize the entire method&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 43.5pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Declare the method to be synchronized - very common practice.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 43.5pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Thread should obtain the object’s lock.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 25.5pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;2.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;        &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Synchronize part of the method&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 43.5pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Have to pass an arbitrary object which lock is to be obtained to execute the synchronized code block (part of a method).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 43.5pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;We can specify “this” in place object, to obtain very brief locking – not very common.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;wait – points to remember&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Wingdings;"&gt;&lt;span style=""&gt;§&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;calling thread gives up CPU&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Wingdings;"&gt;&lt;span style=""&gt;§&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;calling thread gives up the lock&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Wingdings;"&gt;&lt;span style=""&gt;§&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;calling thread goes to monitor’s waiting pool&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Wingdings;"&gt;&lt;span style=""&gt;§&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;wait also has a version with timeout in milliseconds. Use this if you’re not sure when the current thread will get notified, this avoids the thread being stuck in wait state forever.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;notify – points to remember&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Wingdings;"&gt;&lt;span style=""&gt;§&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;one thread gets moved out of monitor’s waiting pool to ready state&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Wingdings;"&gt;&lt;span style=""&gt;§&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;notifyAll moves all the threads to ready state&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Wingdings;"&gt;&lt;span style=""&gt;§&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Thread gets to execute &lt;u&gt;must re-acquire&lt;/u&gt; the lock of the monitor before it can proceed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Note the differences between blocked and waiting.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;table class="MsoNormalTable" style="border: medium none ; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;   &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0cm 5.4pt; width: 203.4pt;" valign="top" width="271"&gt;   &lt;p class="Preformatted" style=""&gt;&lt;b style=""&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Blocked&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td  style="border-style: solid solid solid none; padding: 0cm 5.4pt; width: 202.5pt;color:windowtext windowtext windowtext -moz-use-text-color;" valign="top" width="270"&gt;   &lt;p class="Preformatted" style=""&gt;&lt;b style=""&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Waiting&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td  style="border-style: none solid solid; padding: 0cm 5.4pt; width: 203.4pt;color:-moz-use-text-color windowtext windowtext;" valign="top" width="271"&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Thread is waiting to get a lock on the   monitor.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style=";font-family:&amp;quot;;" &gt;(or waiting for a blocking i/o method)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td  style="border-style: none solid solid none; padding: 0cm 5.4pt; width: 202.5pt;color:-moz-use-text-color windowtext windowtext -moz-use-text-color;" valign="top" width="270"&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Thread has been asked to wait. (by   means of wait method)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td  style="border-style: none solid solid; padding: 0cm 5.4pt; width: 203.4pt;color:-moz-use-text-color windowtext windowtext;" valign="top" width="271"&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Caused by the thread tried to execute   some synchronized code. (or a blocking i/o method)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td  style="border-style: none solid solid none; padding: 0cm 5.4pt; width: 202.5pt;color:-moz-use-text-color windowtext windowtext -moz-use-text-color;" valign="top" width="270"&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style=";font-family:&amp;quot;;" &gt;The thread already acquired the lock   and executed some synchronized code before coming across a wait call.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td  style="border-style: none solid solid; padding: 0cm 5.4pt; width: 203.4pt;color:-moz-use-text-color windowtext windowtext;" valign="top" width="271"&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Can move to ready only when the lock is   available. ( or the i/o operation is complete)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td  style="border-style: none solid solid none; padding: 0cm 5.4pt; width: 202.5pt;color:-moz-use-text-color windowtext windowtext -moz-use-text-color;" valign="top" width="270"&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Can move to ready only when it gets   notified (by means of notify or notifyAll)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Points for complex models:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;1.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;        &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Always check monitor’s state in a while loop, rather than in an if statement.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;2.&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;        &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Always call notifyAll, instead of notify.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Class locks control the static methods.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;wait and sleep must be enclosed in a try/catch for InterruptedException.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;A single thread can obtain multiple locks on multiple objects (or on the same object)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;A thread owning the lock of an object can call other synchronous methods on the same object. (this is another lock) Other threads can’t do that. They should wait to get the lock.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Non-synchronous methods can be called at any time by any thread.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Synchronous methods are re-entrant. So they can be called recursively.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Synchronized methods can be overrided to be non-synchronous. synchronized behavior affects only the original class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Locks on inner/outer objects are independent. Getting a lock on outer object doesn’t mean getting the lock on an inner object as well, that lock should be obtained separately.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;wait and notify should be called from synchronized code. This ensures that while calling these methods the thread always has the lock on the object. If you have wait/notify in non-synchronized code compiler won’t catch this. At runtime, if the thread doesn’t have the lock while calling these methods, an IllegalMonitorStateException is thrown.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Deadlocks can occur easily. e.g, Thread A locked Object A and waiting to get a lock on Object B, but Thread B locked Object B and waiting to get a lock on Object A. They’ll be in this state forever.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;It’s the programmer’s responsibility to avoid the deadlock. Always get the locks in the same order.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;While ‘suspended’, the thread keeps the locks it obtained – so suspend is deprecated in 1.2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=";font-family:&amp;quot;;font-size:7;"  &gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Use of stop is also deprecated, instead use a flag in run method. Compiler won’t warn you, if you have statements after a call to stop, even though they are not reachable.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15047166-112548068305582641?l=java-coders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-coders.blogspot.com/feeds/112548068305582641/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15047166&amp;postID=112548068305582641' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15047166/posts/default/112548068305582641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15047166/posts/default/112548068305582641'/><link rel='alternate' type='text/html' href='http://java-coders.blogspot.com/2005/08/scjp-study-notes-chapter-7-threads.html' title='SCJP study notes: Chapter 7 Threads'/><author><name>shabda</name><uri>http://www.blogger.com/profile/07961528262493927188</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15047166.post-112548043647853015</id><published>2005-08-31T02:24:00.000-07:00</published><updated>2005-08-31T02:27:16.636-07:00</updated><title type='text'>SCJP study notes: Chapter 6 Objects and Classes</title><content type='html'>&lt;span style="font-size: 10pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Originally written by Velmurugan Periasamy. Copyright belongs to him.
 &lt;/span&gt;  &lt;h1&gt;Chapter 6 Objects and Classes&lt;/h1&gt;   &lt;p class="MsoNormal"&gt;Implementing OO relationships&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;“is a” relationship is implemented by inheritance (extends keyword)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;“has a” relationship is implemented by providing the class with member variables.&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;Overloading and Overriding&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Overloading is an example of polymorphism. (operational / parametric)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Overriding is an example of runtime polymorphism (inclusive)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;A method can have the same name as another method in the same class, provided it forms either a valid overload or override&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;table class="MsoNormalTable" style="border: medium none ; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;   &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0cm 5.4pt; width: 212.4pt;" valign="top" width="283"&gt;   &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;Overloading&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 230.4pt;" valign="top" width="307"&gt;   &lt;h3&gt;Overriding&lt;/h3&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 212.4pt;" valign="top" width="283"&gt;   &lt;p class="MsoNormal"&gt;Signature has to be different. Just a difference in return   type is not enough.&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 230.4pt;" valign="top" width="307"&gt;   &lt;p class="MsoNormal"&gt;Signature has to be the same. (including the return type)&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 212.4pt;" valign="top" width="283"&gt;   &lt;p class="MsoNormal"&gt;Accessibility may vary freely.&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 230.4pt;" valign="top" width="307"&gt;   &lt;p class="MsoNormal"&gt;Overriding methods cannot be more private than the   overridden methods.&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 212.4pt;" valign="top" width="283"&gt;   &lt;p class="MsoNormal"&gt;Exception list may vary freely.&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 230.4pt;" valign="top" width="307"&gt;   &lt;p class="MsoNormal"&gt;Overriding methods may not throw more checked exceptions   than the overridden methods.&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 212.4pt;" valign="top" width="283"&gt;   &lt;p class="MsoNormal"&gt;Just the name is reused. Methods are independent methods.   Resolved at compile-time based on method signature.&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 230.4pt;" valign="top" width="307"&gt;   &lt;p class="MsoNormal"&gt;Related directly to sub-classing. Overrides the parent   class method. Resolved at run-time based on type of the object.&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 212.4pt;" valign="top" width="283"&gt;   &lt;p class="MsoNormal"&gt;Can call each other by providing appropriate argument   list.&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 230.4pt;" valign="top" width="307"&gt;   &lt;p class="MsoNormal"&gt;Overriding method can call overridden method by   super.methodName(), this can be used only to access the immediate   super-class’s method. super.super won’t work. Also, a class outside the   inheritance hierarchy can’t use this technique.&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 212.4pt;" valign="top" width="283"&gt;   &lt;p class="MsoNormal"&gt;Methods can be static or non-static. Since the methods are   independent, it doesn’t matter. But if two methods have the same signature,   declaring one as static and another as non-static does not provide a valid   overload. It’s a compile time error.&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 230.4pt;" valign="top" width="307"&gt;   &lt;p class="MsoNormal"&gt;static methods don’t participate in overriding, since they   are resolved at compile time based on the type of reference variable. A   static method in a sub-class can’t use ‘super’ (for the same reason that it   can’t use ‘this’ for)&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;Remember that a static method can’t be overridden to be   non-static and a non-static method can’t be overridden to be static. In other   words, a static method and a non-static method cannot have the same name and   signature (if signatures are different, it would have formed a valid   overload)&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 212.4pt;" valign="top" width="283"&gt;   &lt;p class="MsoNormal"&gt;There’s no limit on number of overloaded methods a class   can have.&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 230.4pt;" valign="top" width="307"&gt;   &lt;p class="MsoNormal"&gt;Each parent class method may be overridden at most once in   any sub-class. (That is, you cannot have two identical methods in the same   class)&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Variables can also be overridden, it’s known as shadowing or hiding. But, member variable references are resolved at compile-time. So at the runtime, if the class of the object referred by a parent class reference variable, is in fact a sub-class having a shadowing member variable, only the parent class variable is accessed, since it’s already resolved at compile time based on the reference variable type. Only methods are resolved at run-time.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;public class Shadow {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;public static void main(String s[]) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;S1 s1 = new S1();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;S2 s2 = new S2();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;System.out.println(s1.s); // prints S1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;System.out.println(s1.getS()); // prints S1&lt;/span&gt;&lt;span style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;                &lt;/span&gt;System.out.println(s2.s); // prints S2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;System.out.println(s2.getS()); // prints S2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;s1 = s2;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;System.out.println(s1.s); // &lt;/span&gt;&lt;span style=""&gt;prints S1, not S2 -&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;&lt;span style=""&gt;          &lt;/span&gt;// &lt;/span&gt;&lt;span style=""&gt;since variable is resolved at compile time&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;System.out.println(s1.getS()); // &lt;/span&gt;&lt;span style=""&gt;prints S2 - &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;                           &lt;/span&gt;&lt;span style=""&gt;     &lt;/span&gt;// &lt;/span&gt;&lt;span style=""&gt;since method is resolved at run time&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;      &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;class S1 {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;public String s = "S1";&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;public String getS() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;return s;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;class S2 extends S1{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;public String s = "S2";&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;public String getS() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;return s;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: 36pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;}&lt;/span&gt;&lt;span style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoBodyTextIndent"&gt;In the above code, if we didn’t have the overriding getS() method in the sub-class and if we call the method from sub-class reference variable, the method will return only the super-class member variable value. For explanation, see the following point.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Also, methods access variables only in context of the class of the object they belong to. If a sub-class method calls explicitly a super class method, the super class method always will access the super-class variable. Super class methods will not access the shadowing variables declared in subclasses because they don’t know about them. (When an object is created, instances of all its super-classes are also created.) But the method accessed will be again subject to dynamic lookup. It is always decided at runtime which implementation is called. (Only static methods are resolved at compile-time)&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;public class Shadow2 {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;String s = "main";&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;public static void main(String s[]) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;S2 s2 = new S2();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;s2.display();&lt;span style=""&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;// Produces an output – S1, S2&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;S1 s1 = new S1();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;System.out.println(s1.getS()); &lt;/span&gt;&lt;span style=""&gt;// prints S1&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;System.out.println(s2.getS()); &lt;/span&gt;&lt;span style=""&gt;//&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt; &lt;/span&gt;&lt;span style=""&gt;prints S1 – since super-class method &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 216pt;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;     &lt;/span&gt;&lt;span style=""&gt;           &lt;/span&gt;// always accesses super-class variable&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;class S1 {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;String s = "S1";&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;public String getS() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;return s;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;void display() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;System.out.println(s);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;class S2 extends S1{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;String s = "S2";&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;void display() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;super.display();&lt;span style=""&gt;   &lt;/span&gt;// Prints S1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;System.out.println(s); // prints S2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;}&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;With OO languages, the class of the object may not be known at compile-time (by virtue of inheritance). JVM from the start is designed to support OO. So, the JVM insures that the method called will be from the real class of the object (not with the variable type declared). This is accomplished by virtual method invocation (late binding). Compiler will form the argument list and produce one method invocation instruction – its job is over. The job of identifying and calling the proper target code is performed by JVM.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;JVM knows about the variable’s real type at any time since when it allocates memory for an object, it also marks the type with it. Objects always know ‘who they are’. This is the basis of instanceof operator.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Sub-classes can use super keyword to access the shadowed variables in super-classes. This technique allows for accessing only the immediate super-class. super.super is not valid. But casting the ‘this’ reference to classes up above the hierarchy will do the trick. By this way, variables in super-classes above any level can be accessed from a sub-class, since variables are resolved at compile time, when we cast the ‘this’ reference to a super-super-class, the compiler binds the super-super-class variable. But this technique is not possible with methods since methods are resolved &lt;b style=""&gt;always&lt;/b&gt; at runtime, and the method gets called depends on the type of object, not the type of reference variable. So &lt;b style=""&gt;it is not at all possible&lt;/b&gt; to access a method in a super-super-class from a subclass.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;public class ShadowTest {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;public static void main(String s[]){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;new STChild().demo();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;class STGrandParent {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;double wealth = 50000.00;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;public double getWealth() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;System.out.println("GrandParent-" + wealth);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;return wealth;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;class STParent extends STGrandParent {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;double wealth = 100000.00;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;public double getWealth() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;System.out.println("Parent-" + wealth);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;return wealth;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;class STChild extends STParent {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;double wealth = 200000.00;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;public double getWealth() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;System.out.println("Child-" + wealth);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;return wealth;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;public void demo() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;getWealth(); // Calls Child method&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;super.getWealth(); // Calls Parent method&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 108pt; text-indent: 36pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;// Compiler error, GrandParent method cannot be accessed&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;//super.super.getWealth(); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;// Calls Child method, due to dynamic method lookup&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 108pt; text-indent: 36pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;((STParent)this).getWealth();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 108pt; text-indent: 36pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;// Calls Child method, due to dynamic method lookup&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 108pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;((STGrandParent)this).getWealth();&lt;span style=""&gt;     &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;System.out.println(wealth); // Prints Child wealth&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;System.out.println(super.wealth); // Prints Parent wealth&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 108pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;// Prints Parent wealth &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 108pt; text-indent: 36pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;System.out.println(((STParent)(this)).wealth); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 108pt; text-indent: 36pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;// Prints GrandParent wealth&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;System.out.println(((STGrandParent)(this)).wealth);&lt;span style=""&gt;    &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: 36pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;}&lt;/span&gt;&lt;span style="font-size: 8pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;An inherited method, which was not abstract on the super-class, can be declared abstract in a sub-class (thereby making the sub-class abstract). There is no restriction. In the same token, a subclass can be declared abstract regardless of whether the super-class was abstract or not.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Private members are not inherited, but they do exist in the sub-classes. Since the private methods are not inherited, they cannot be overridden. A method in a subclass with the same signature as a private method in the super-class is essentially a new method, independent from super-class, since the private method in the super-class is not visible in the sub-class.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;public class PrivateTest {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;public static void main(String s[]){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;new PTSuper().hi(); &lt;/span&gt;&lt;span style="font-size: 8pt;"&gt;// Prints always Super&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style=""&gt;                                &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;new PTSub().hi();&lt;/span&gt;&lt;span style="font-size: 8pt;"&gt; // Prints Super when subclass doesn't have hi method&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style=""&gt;                                                &lt;/span&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;span style=""&gt;               &lt;/span&gt;// Prints Sub when subclass has hi method&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style=""&gt;                                &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;PTSuper sup;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;sup = new PTSub();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;sup.hi();&lt;/span&gt;&lt;span style="font-size: 8pt;"&gt; // Prints Super when subclass doesn't have hi method&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style=""&gt;                                                &lt;/span&gt;// Prints Sub when subclass has hi method&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;class PTSuper {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;public void hi() {&lt;/span&gt;&lt;span style="font-size: 8pt;"&gt; // Super-class implementation always calls superclass hello&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style=""&gt;                                &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;hello();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;private void hello() {&lt;/span&gt;&lt;span style="font-size: 8pt;"&gt; // This method is not inherited by subclasses, but exists in them.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style=""&gt;                                                &lt;/span&gt;// Commenting out both the methods in the subclass show this.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style=""&gt;                                                &lt;/span&gt;// The test will then print "hello-Super" for all three calls&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style=""&gt;                                                &lt;/span&gt;// i.e. Always the super-class implementations are called&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style=""&gt;                                &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;System.out.println("hello-Super");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;class PTSub extends PTSuper {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;public void hi() {&lt;/span&gt;&lt;span style="font-size: 8pt;"&gt; // This method overrides super-class hi, calls subclass hello&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style=""&gt;                                &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;try {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;hello(); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;catch(Exception e) {}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;void hello() throws Exception { &lt;/span&gt;&lt;span style="font-size: 8pt;"&gt;// This method is independent from super-class hello&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style=""&gt;                                                                &lt;/span&gt;// Evident from, it's allowed to throw Exception&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style=""&gt;                                &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;System.out.println("hello-Sub");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Private methods are not overridden, so calls to private methods are resolved at compile time and not subject to dynamic method lookup. See the following example.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;public class Poly {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;public static void main(String args[]) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;PolyA ref1 = new PolyC();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;PolyB ref2 = (PolyB)ref1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;System.out.println(ref2.g()); &lt;/span&gt;&lt;span style="font-size: 8pt;"&gt;// This prints 1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style=""&gt;                                                                                &lt;/span&gt;// If f() is not private in PolyB, then prints 2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;class PolyA {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;private int f() { return 0; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;public int g() { return 3; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;class PolyB extends PolyA {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;private int f() { return 1; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;public int g() { return f(); }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;class PolyC extends PolyB {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;public int f() { return 2; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;Constructors and Sub-classing&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Constructors are not inherited as normal methods, they have to be defined in the class itself.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;If you define no constructors at all, then the compiler provides a default constructor with no arguments. Even if, you define one constructor, this default is not provided. &lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;We can’t compile a sub-class if the immediate super-class doesn’t have a no argument default constructor, and sub-class constructors are not calling super or this explicitly (and expect the compiler to insert an implicit super() call )&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;A constructor can call other overloaded constructors by ‘this (arguments)’. If you use this, it must be the first statement in the constructor. This construct can be used only from within a constructor.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;A constructor can’t call the same constructor from within. Compiler will say ‘ recursive constructor invocation’&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;A constructor can call the parent class constructor explicitly by using ‘super (arguments)’. If you do this, it must be first the statement in the constructor. This construct can be used only from within a constructor.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Obviously, we can’t use both this and super in the same constructor. If compiler sees a this or super, it won’t insert a default call to super().&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Constructors can’t have a return type. A method with a class name, but with a return type is not considered a constructor, but just a method by compiler. Expect trick questions using this.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Constructor body can have an empty return statement. Though void cannot be specified with the constructor signature, empty return statement is acceptable.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Only modifiers that a constructor can have are the accessibility modifiers.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Constructors cannot be overridden, since they are not inherited.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Initializers are used in initialization of objects and classes and to define constants in interfaces. These initializers are :&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;1.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Static and Instance variable initializer expressions.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: 36pt;"&gt;Literals and method calls to initialize variables. Static variables can be initialized &lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: 36pt;"&gt;only by static method calls.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: 36pt;"&gt;Cannot pass on the checked exceptions. Must catch and handle them.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;2.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Static initializer blocks.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style=""&gt;       &lt;/span&gt;Used to initialize static variables and load native libraries.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: 36pt;"&gt;Cannot pass on the checked exceptions. Must catch and handle them.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;3.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Instance initializer blocks.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style=""&gt;       &lt;/span&gt;Used to factor out code that is common to all the constructors.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style=""&gt;       &lt;/span&gt;Also useful with anonymous classes since they cannot have constructors.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style=""&gt;       &lt;/span&gt;All constructors must declare the uncaught checked exceptions, if any.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style=""&gt;       &lt;/span&gt;Instance Initializers in anonymous classes can throw any exception.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;In all the initializers, forward referencing of variables is not allowed. Forward referencing of methods is allowed.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Order of code execution (when creating an object) is a bit tricky.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;1.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;static variables initialization.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;2.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;static initializer block execution. (in the order of declaration, if multiple blocks found)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;3.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;constructor header ( super or this – implicit or explicit )&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;4.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;instance variables initialization / instance initializer block(s) execution&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;5.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;rest of the code in the constructor&lt;/p&gt;   &lt;p class="MsoNormal"&gt;Interfaces&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;All methods in an interface are implicitly public, abstract, and never static.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;All variables in an interface are implicitly static, public, final. They cannot be transient or volatile. A class can shadow the variables it inherits from an interface, with its own variables.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;A top-level interface itself cannot be declared as static or final since it doesn’t make sense.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Declaring parameters to be final is at method’s discretion, this is not part of method signature.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Same case with final, synchronized, native. Classes can declare the methods to be final, synchronized or native whereas in an interface they cannot be specified like that. (These are implementation details, interface need not worry about this)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;But classes cannot implement an interface method with a static method.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;If an interface specifies an exception list for a method, then the class implementing the interface need not declare the method with the exception list. (Overriding methods can specify sub-set of overridden method’s exceptions, here none is a sub-set). But if the interface didn’t specify any exception list for a method, then the class cannot throw any exceptions.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;All interface methods should have public accessibility when implemented in class.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Interfaces cannot be declared final, since they are implicitly abstract.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;A class can implement two interfaces that have a method with the same signature or variables with the same name.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Inner Classes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;A class can be declared in any scope. Classes defined inside of other classes are known as &lt;b style=""&gt;nested classes&lt;/b&gt;. There are four categories of nested classes.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;1.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Top-level nested classes / interfaces&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Declared as a class member with static modifier. &lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Just like other static features of a class. Can be accessed / instantiated without an instance of the outer class. Can access only static members of outer class. Can’t access instance variables or methods. &lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Very much like any-other package level class / interface. Provide an extension to packaging by the modified naming scheme at the top level.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Classes can declare both static and non-static members.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Any accessibility modifier can be specified.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Interfaces are implicitly static (static modifier also can be specified). They can have any accessibility modifier. There are no non-static inner, local or anonymous interfaces.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;2.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Non-static inner classes&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Declared as a class member without static.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;An instance of a non-static inner class can exist only with an instance of its enclosing class. So it always has to be created within a context of an outer instance.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Just like other non-static features of a class. Can access all the features (even private) of the enclosing outer class. Have an implicit reference to the enclosing instance.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Cannot have any static members.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Can have any access modifier.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;3.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Local classes&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Defined inside a block (could be a method, a constructor, a local block, a static initializer or an instance initializer). Cannot be specified with static modifier.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Cannot have any access modifier (since they are effectively local to the block)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Cannot declare any static members.(Even declared in a static context)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Can access all the features of the enclosing class (because they are defined inside the method of the class) but can access only final variables defined inside the method (including method arguments). This is because the class can outlive the method, but the method local variables will go out of scope – in case of final variables, compiler makes a copy of those variables to be used by the class. (New meaning for final)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Since the names of local classes are not visible outside the local context, references of these classes cannot be declared outside. So their functionality could be accessed only via super-class references (either interfaces or classes). Objects of those class types are created inside methods and returned as super-class type references to the outside world. This is the reason that they can only access final variables within the local block. That way, the value of the variable can be always made available to the objects returned from the local context to outside world.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Cannot be specified with static modifier. But if they are declared inside a static context such as a static method or a static initializer, they become static classes. They can only access static members of the enclosing class and local final variables. But this doesn’t mean they cannot access any non-static features inherited from super classes. These features are their own, obtained via the inheritance hierarchy. They can be accessed normally with ‘this’ or ‘super’. &lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;4.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Anonymous classes &lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Anonymous classes are defined where they are constructed. They can be created wherever a reference expression can be used.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Anonymous classes cannot have explicit constructors. Instance initializers can be used to achieve the functionality of a constructor.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Typically used for creating objects on the fly.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Anonymous classes can implement an interface (implicit extension of Object) or explicitly extend a class. Cannot do both.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 108pt; text-indent: 18pt;"&gt;Syntax: new interface name() { } or new class name() { }&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Keywords implements and extends are not used in anonymous classes.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Abstract classes can be specified in the creation of an anonymous class. The new class is a concrete class, which automatically extends the abstract class.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Discussion for local classes on static/non-static context, accessing enclosing variables, and declaring static variables also holds good for anonymous classes. In other words, anonymous classes cannot be specified with static, but based on the context, they could become static classes. In any case, anonymous classes are not allowed to declare static members. Based on the context, non-static/static features of outer classes are available to anonymous classes. Local final variables are always available to them.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;One enclosing class can have multiple instances of inner classes. &lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Inner classes can have synchronous methods. But calling those methods obtains the lock for inner object only not the outer object.&lt;span style=""&gt;  &lt;/span&gt;If you need to synchronize an inner class method based on outer object, outer object lock must be obtained explicitly. Locks on inner object and outer object are independent.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Nested classes can extend any class or can implement any interface. No restrictions.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;All nested classes (except anonymous classes) can be abstract or final.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Classes can be nested to any depth. Top-level static classes can be nested only within other static top-level classes or interfaces. Deeply nested classes also have access to all variables of the outer-most enclosing class (as well the immediate enclosing class’s)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Member inner classes can be forward referenced. Local inner classes cannot be.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;An inner class variable can shadow an outer class variable. In this case, an outer class variable can be referred as (outerclassname.this.variablename).&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Outer class variables are accessible within the inner class, but they are not inherited. They don’t become members of the inner class. This is different from inheritance. (Outer class cannot be referred using ‘super’, and outer class variables cannot be accessed using ‘this’)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;An inner class variable can shadow an outer class variable. If the inner class is sub-classed within the same outer class, the variable has to be qualified explicitly in the sub-class. To fully qualify the variable, use classname.this.variablename. If we don’t correctly qualify the variable, a compiler error will occur. (Note that this does not happen in multiple levels of inheritance where an upper-most super-class’s variable is silently shadowed by the most recent super-class variable or in multiple levels of nested inner classes where an inner-most class’s variable silently shadows an outer-most class’s variable. Problem comes only when these two hierarchy chains (inheritance and containment) clash.)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;If the inner class is sub-classed outside of the outer class (only possible with top-level nested classes) explicit qualification is not needed (it becomes regular class inheritance)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;span style="font-size: 10pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;
 &lt;/span&gt;  &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;// Example 1&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;public class InnerInnerTest {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;  &lt;/span&gt;public static void main(String s[]) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;new Outer().new Inner().new InnerInner().new InnerInnerInner().doSomething();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;new Outer().new InnerChild().doSomething();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;new Outer2().new Inner2().new InnerInner2().doSomething();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;new InnerChild2().doSomething();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;class Outer {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;  &lt;/span&gt;String name = "Vel";&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;  &lt;/span&gt;class Inner {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;String name = "Sharmi";&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;class InnerInner {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;class InnerInnerInner {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                        &lt;/span&gt;public void doSomething() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                        &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;// No problem in accessing without full qualification, &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                        &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;// inner-most class variable shadows the outer-most class variable &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                        &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;System.out.println(name); // Prints "Sharmi"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                        &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;System.out.println(Outer.this.name); // Prints "Vel", explicit reference to Outer&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;// error, variable is not inherited from the outer class, it can be just accessible&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;//&lt;span style=""&gt;                      &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;System.out.println(this.name); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;//&lt;span style=""&gt;                      &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;System.out.println(InnerInner.this.name); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;//&lt;span style=""&gt;                      &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;System.out.println(InnerInnerInner.this.name); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;// error, super cannot be used to access outer class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;// super will always refer the parent, in this case Object&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;//&lt;span style=""&gt;                      &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;System.out.println(super.name);&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                        &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;System.out.println(Inner.this.name); // Prints "Sharmi", Inner has declared 'name'&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;  &lt;/span&gt;/* This is an inner class extending an inner class in the same scope */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;  &lt;/span&gt;class InnerChild extends Inner {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;public void doSomething() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;// compiler error, explicit qualifier needed &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;// 'name' is inherited from Inner, Outer's 'name' is also in scope&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;//&lt;span style=""&gt;      &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;System.out.println(name); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;System.out.println(Outer.this.name); // prints "Vel", explicit reference to Outer&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;System.out.println(super.name); // prints "Sharmi", Inner has declared 'name'&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;System.out.println(this.name); // prints "Sharmi", name is inherited by InnerChild&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;class Outer2 {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;  &lt;/span&gt;static String name = "Vel";&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;  &lt;/span&gt;static class Inner2 {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;static String name = "Sharmi";&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;class InnerInner2 {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;public void doSomething() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;System.out.println(name); // prints "Sharmi", inner-most hides outer-most&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;System.out.println(Outer2.name); // prints "Vel", explicit reference to Outer2's static variable&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;//&lt;span style=""&gt;      &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;System.out.println(this.name); // error, 'name' is not inherited&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;//&lt;span style=""&gt;      &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;System.out.println(super.name); // error, super refers to Object&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;/* This is a stand-alone class extending an inner class */&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;class InnerChild2 extends Outer2.Inner2 {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;public void doSomething() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;System.out.println(name); // prints "Sharmi", Inner2's name is inherited&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;System.out.println(Outer2.name); // prints "Vel", explicit reference to Outer2's static variable&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;System.out.println(super.name); // prints "Sharmi", Inner2 has declared 'name'&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;System.out.println(this.name); // prints "Sharmi", name is inherited by InnerChild2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;// Example 2&lt;/p&gt;   &lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;public class InnerTest2 {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;  &lt;/span&gt;public static void main(String s[]) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                &lt;/span&gt;new OuterClass().doSomething(10, 20);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;// This is legal&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;//&lt;span style=""&gt;              &lt;/span&gt;OuterClass.InnerClass ic = new OuterClass().new InnerClass();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;//&lt;span style=""&gt;              &lt;/span&gt;ic.doSomething();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;// Compiler error, local inner classes cannot be accessed from outside&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;//&lt;span style=""&gt;              &lt;/span&gt;OuterClass.LocalInnerClass lic = new OuterClass().new LocalInnerClass(); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;//&lt;span style=""&gt;              &lt;/span&gt;lic.doSomething();&lt;span style=""&gt;                                   &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                &lt;/span&gt;new OuterClass().doAnonymous();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;class OuterClass {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;  &lt;/span&gt;final int a = 100;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;  &lt;/span&gt;private String secret = "Nothing serious";&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;  &lt;/span&gt;public void doSomething(int arg, final int fa) { &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                &lt;/span&gt;final int x = 100;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                &lt;/span&gt;int y = 200;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                &lt;/span&gt;System.out.println(this.getClass() + " - in doSomething");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                &lt;/span&gt;System.out.print("a = " + a + " secret = " + secret + " arg = " + arg + " fa = " + fa);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                &lt;/span&gt;System.out.println(" x = " + x + " y = " + y);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;// Compiler error, forward reference of local inner class&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;//&lt;span style=""&gt;              &lt;/span&gt;new LocalInnerClass().doSomething();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                &lt;/span&gt;abstract class AncestorLocalInnerClass { } // inner class can be abstract&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                &lt;/span&gt;final class LocalInnerClass extends AncestorLocalInnerClass { // can be final&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;public void doSomething() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;System.out.println(this.getClass() + " - in doSomething");&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;System.out.print("a = " + a );&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;System.out.print(" secret = " + secret);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;//&lt;span style=""&gt;              &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;System.out.print(" arg = " + arg);&lt;span style=""&gt;  &lt;/span&gt;// Compiler error, accessing non-final argument&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;System.out.print(" fa = " + fa);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;System.out.println(" x = " + x); &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;//&lt;span style=""&gt;              &lt;/span&gt;&lt;span style=""&gt;    &lt;/span&gt;System.out.println(" y = " + y); // Compiler error, accessing non-final variable&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                &lt;/span&gt;new InnerClass().doSomething(); // forward reference fine for member inner class&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                &lt;/span&gt;new LocalInnerClass().doSomething();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;  &lt;/span&gt;abstract class AncestorInnerClass { }&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;  &lt;/span&gt;interface InnerInterface { final int someConstant = 999;} // inner interface&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;  &lt;/span&gt;class InnerClass extends AncestorInnerClass implements InnerInterface { &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;    &lt;/span&gt;public void doSomething() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;      &lt;/span&gt;System.out.println(this.getClass() + " - in doSomething");&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;      &lt;/span&gt;System.out.println("a = " + a + " secret = " + secret + " someConstant = " + someConstant);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;    &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;  &lt;/span&gt;public void doAnonymous() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                &lt;/span&gt;// Anonymous class implementing the inner interface&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                &lt;/span&gt;System.out.println((new InnerInterface() { }).someConstant);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                &lt;/span&gt;// Anonymous class extending the inner class&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;                &lt;/span&gt;( new InnerClass() { &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 108pt; text-indent: 36pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;public void doSomething() { &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 108pt; text-indent: 36pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;  &lt;/span&gt;secret = "secret is changed"; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 108pt; text-indent: 36pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;  &lt;/span&gt;super.doSomething();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 108pt; text-indent: 36pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;} &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: 36pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;} ).doSomething();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;span style=""&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;
 &lt;/span&gt;  &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: Arial; color: black;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;table class="MsoNormalTable" style="border: medium none ; margin-left: -12.6pt; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;   &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0cm 5.4pt; width: 81pt;" valign="top" width="108"&gt;   &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="color: black;"&gt;Entity&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 79.2pt;" valign="top" width="106"&gt;   &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="color: black;"&gt;Declaration Context&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 73.8pt;" valign="top" width="98"&gt;   &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="color: black;"&gt;Accessibility Modifiers&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 49.5pt;" valign="top" width="66"&gt;   &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="color: black;"&gt;Outer instance&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 90pt;" valign="top" width="120"&gt;   &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="color: black;"&gt;Direct Access to enclosing context&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 99pt;" valign="top" width="132"&gt;   &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="color: black;"&gt;Defines static or non-static   members&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 81pt;" valign="top" width="108"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Package   level class&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 79.2pt;" valign="top" width="106"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;As package   member&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 73.8pt;" valign="top" width="98"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Public or   default&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 49.5pt;" valign="top" width="66"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;No&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 90pt;" valign="top" width="120"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;N/A&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 99pt;" valign="top" width="132"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Both   static and non-static&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 81pt;" valign="top" width="108"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Top level   nested class (static)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 79.2pt;" valign="top" width="106"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;As static   class member&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 73.8pt;" valign="top" width="98"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;All&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 49.5pt;" valign="top" width="66"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;No&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 90pt;" valign="top" width="120"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Static   members in enclosing context&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 99pt;" valign="top" width="132"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Both   static and non-static&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 81pt;" valign="top" width="108"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Non static   inner class&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 79.2pt;" valign="top" width="106"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;As   non-static class member&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 73.8pt;" valign="top" width="98"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;All&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 49.5pt;" valign="top" width="66"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Yes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 90pt;" valign="top" width="120"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;All   members in enclosing context&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 99pt;" valign="top" width="132"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Only   non-static&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 81pt;" valign="top" width="108"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Local   class (non-static)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 79.2pt;" valign="top" width="106"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;In block   with non-static context&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 73.8pt;" valign="top" width="98"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;None&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 49.5pt;" valign="top" width="66"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Yes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 90pt;" valign="top" width="120"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;All   members in enclosing context + local final variables&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 99pt;" valign="top" width="132"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Only   non-static&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 81pt;" valign="top" width="108"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Local   class (static)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 79.2pt;" valign="top" width="106"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;In block   with static context&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 73.8pt;" valign="top" width="98"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;None&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 49.5pt;" valign="top" width="66"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;No&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 90pt;" valign="top" width="120"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Static members   in enclosing context + local final variables&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 99pt;" valign="top" width="132"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Only   non-static&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 81pt;" valign="top" width="108"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Anonymous   class (non-static)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 79.2pt;" valign="top" width="106"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;In block   with non-static context&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 73.8pt;" valign="top" width="98"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;None&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 49.5pt;" valign="top" width="66"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Yes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 90pt;" valign="top" width="120"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;All   members in enclosing context + local final variables&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 99pt;" valign="top" width="132"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Only   non-static&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 81pt;" valign="top" width="108"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Anonymous class   (static)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 79.2pt;" valign="top" width="106"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;In block   with static context&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 73.8pt;" valign="top" width="98"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;None&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 49.5pt;" valign="top" width="66"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;No&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 90pt;" valign="top" width="120"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Static   members in enclosing context + local final variables&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 99pt;" valign="top" width="132"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Only   non-static&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 81pt;" valign="top" width="108"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Package   level interface&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 79.2pt;" valign="top" width="106"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;As package   member&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 73.8pt;" valign="top" width="98"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Public or   default&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 49.5pt;" valign="top" width="66"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;No&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 90pt;" valign="top" width="120"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;N/A&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 99pt;" valign="top" width="132"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Static variables   and non-static method prototypes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 81pt;" valign="top" width="108"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Top level   nested interface (static)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 79.2pt;" valign="top" width="106"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;As static   class member&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 73.8pt;" valign="top" width="98"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;All&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 49.5pt;" valign="top" width="66"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;No&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 90pt;" valign="top" width="120"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Static   members in enclosing context&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 99pt;" valign="top" width="132"&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="color: black;"&gt;Static   variables and non-static method prototypes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt;   &lt;h1&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/h1&gt;   &lt;b style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;
 &lt;/span&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15047166-112548043647853015?l=java-coders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-coders.blogspot.com/feeds/112548043647853015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15047166&amp;postID=112548043647853015' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15047166/posts/default/112548043647853015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15047166/posts/default/112548043647853015'/><link rel='alternate' type='text/html' href='http://java-coders.blogspot.com/2005/08/scjp-study-notes-chapter-6-objects-and.html' title='SCJP study notes: Chapter 6 Objects and Classes'/><author><name>shabda</name><uri>http://www.blogger.com/profile/07961528262493927188</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15047166.post-112548018847246196</id><published>2005-08-31T02:21:00.000-07:00</published><updated>2005-08-31T02:23:08.503-07:00</updated><title type='text'>SCJP study notes:Chapter 5 Flow Control and Exceptions</title><content type='html'>&lt;span style="font-size: 10pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Originally written by&lt;/span&gt;Velmurugan Periasamy. Copyright belongs to him.  &lt;h1&gt;Chapter 5 Flow Control and Exceptions&lt;/h1&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Unreachable statements produce a compile-time error. &lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;while (false) { x = 3; }&lt;/span&gt; // won’t compile&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;for (;false;) { x =3; }&lt;/span&gt; // won’t compile&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;if (false) {x = 3; }&lt;/span&gt; // will compile, to provide the ability to conditionally compile the code.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Local variables already declared in an enclosing block, therefore visible in a nested block cannot be re-declared inside the nested block.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;A local variable in a block may be re-declared in another local block, if the blocks are disjoint.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Method parameters cannot be re-declared.&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;1.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;st1:place st="on"&gt;Loop&lt;/st1:place&gt; constructs&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;3 constructs – for, while, do&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;All loops are controlled by a boolean expression.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;In while and for, the test occurs at the top, so if the test fails at the first time, body of the loop might not be executed at all.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;In do, test occurs at the bottom, so the body is executed &lt;u&gt;at least once&lt;/u&gt;.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;In for, we can declare multiple variables in the first part of the loop separated by commas, also we can have multiple statements in the third part separated by commas.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;In the first section of for statement, we can have a list of declaration statements &lt;u&gt;or &lt;/u&gt;a list of expression statements, but not both. We cannot mix them.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;All expressions in the third section of for statement will always execute, even if the first expression makes the loop condition false. There is no short –circuit here.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;2.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Selection Statements&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;if takes a boolean arguments. Parenthesis required. else part is optional. else if structure provides multiple selective branching.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;switch takes an argument of byte, short, char or int.(assignment compatible to int)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;case value should be a constant expression that can be evaluated at compile time.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Compiler checks each case value against the range of the switch expression’s data type.&lt;span style=""&gt;  &lt;/span&gt;The following code won’t compile.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;byte b;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;switch (b) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;case 200: // 200 not in range of byte&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;default:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;}&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;We need to place a break statement in each case block to prevent the execution to fall through other case blocks. But this is not a part of switch statement and not enforced by the compiler.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;We can have multiple case statements execute the same code. Just list them one by one.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;default case can be placed anywhere. It’ll be executed &lt;i style=""&gt;only if&lt;/i&gt; none of the case values match.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;switch can be nested. Nested case labels are independent, don’t clash with outer case labels. &lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Empty switch construct is a valid construct. But any statement within the switch block should come under a case label or the default case label.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;3.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Branching statements&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;break statement can be used with any kind of loop or a switch statement or just a labeled block.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;continue statement can be used with only a loop (any kind of loop).&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Loops can have labels. We can use break and continue statements to branch out of multiple levels of nested loops using labels.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Names of the labels follow the same rules as the name of the variables.(Identifiers)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Labels can have the same name, as long as they don’t enclose one another.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style=""&gt;There is no restriction against using the same identifier as a label and as the name of a package, class, interface, method, field, parameter, or local variable.&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;4.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Exception Handling&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;An &lt;em&gt;exception&lt;/em&gt; is an event that occurs during the execution of a program that disrupts the normal flow of instructions.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;There are 3 main advantages for exceptions:&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;1.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Separates error handling code from “regular” code&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;2.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Propagating errors up the call stack (without tedious programming)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;3.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Grouping error types and error differentiation&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;An exception causes a jump to the end of try block. If the exception occurred in a method called from a try block, the called method is abandoned.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;If there’s a catch block for the occurred exception or a parent class of the exception, the exception is now considered handled.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span class="CODE"&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;At least one ‘catch’ block or one ‘finally’ block must accompany a ‘try’ statement&lt;span class="CODE"&gt;. If all 3 blocks are present, the order is important. (try/catch/finally) &lt;/span&gt;&lt;span class="CODE"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span class="CODE"&gt;finally and catch can come only with try, they cannot appear on their own.&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Regardless of whether or not an exception occurred or whether or not it was handled, if there is a finally block, it’ll be executed always. (Even if there is a return statement in try block). &lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;System.exit() and error conditions are the only exceptions where finally block is not executed.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;If there was no exception or the exception was handled, execution continues at the statement after the try/catch/finally blocks.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;If the exception is not handled, the process repeats looking for next enclosing try block up the call hierarchy. If this search reaches the top level of the hierarchy (the point at which the thread was created), then the thread is killed and message stack trace is dumped to System.err.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Use throw new xxxException() to throw an exception. If the thrown object is null, a NullPointerException will be thrown at the handler.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;If an exception handler re-throws an exception (throw in a catch block), same rules apply. Either you need to have a try/catch within the catch or specify the entire method as throwing the exception that’s being re-thrown in the catch block. Catch blocks at the same level will not handle the exceptions thrown in a catch block – it needs its own handlers.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;The method fillInStackTrace() in Throwable class throws a Throwable object. It will be useful when re-throwing an exception or error.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;The Java language requires that methods either &lt;em&gt;catch&lt;/em&gt; or &lt;em&gt;specify&lt;/em&gt; all checked exceptions that can be thrown within the scope of that method.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;All objects of type java.lang.Exception are checked exceptions. (Except the classes under java.lang.RuntimeException) If any method that contains lines of code that might throw checked exceptions, compiler checks whether you’ve handled the exceptions or you’ve declared the methods as throwing the exceptions. Hence the name checked exceptions.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;If there’s no code in try block that may throw exceptions specified in the catch blocks, compiler will produce an error. (This is not the case for super-class Exception)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Java.lang.RuntimeException and java.lang.Error need not be handled or declared.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;An overriding method may not throw a checked exception unless the overridden method also throws that exception or a super-class of that exception. In other words, an overriding method may not throw checked exceptions that are not thrown by the overridden method. If we allow the overriding methods in sub-classes to throw more general exceptions than the overridden method in the parent class, then the compiler has no way of checking the exceptions the sub-class might throw. (If we declared a parent class variable and at runtime it refers to sub-class object) This violates the concept of checked exceptions and the sub-classes would be able to by-pass the enforced checks done by the compiler for checked exceptions. This should not be allowed.&lt;/p&gt;   &lt;span style="font-size: 10pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;
 &lt;/span&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoBodyTextIndent"&gt;Here is the exception hierarchy.&lt;/p&gt;   &lt;p class="Preformatted"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Object&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;|&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt;   &lt;/span&gt;|&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Throwable&lt;span style=""&gt;   &lt;/span&gt;
&lt;span style=""&gt; &lt;/span&gt;|&lt;span style=""&gt;            &lt;/span&gt;|&lt;span style=""&gt;         &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt; &lt;/span&gt;|&lt;span style=""&gt;            &lt;/span&gt;|&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt; &lt;/span&gt;|&lt;span style=""&gt;            &lt;/span&gt;| &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt; &lt;/span&gt;|&lt;span style=""&gt;        &lt;/span&gt;Error&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt; &lt;/span&gt;| &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted"&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;span style=""&gt; &lt;/span&gt;| &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;Exception--&gt;ClassNotFoundException, ClassNotSupportedException, IllegalAccessException, InstantiationException, IterruptedException, NoSuchMethodException, &lt;u&gt;RuntimeException&lt;/u&gt;, AWTException, &lt;u&gt;IOException&lt;/u&gt; &lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;RuntimeException--&gt;EmptyStackException, NoSuchElementException, ArithmeticException, ArrayStoreException, ClassCastException, &lt;u&gt;IllegalArgumentException&lt;/u&gt;, IllegalMonitorStateException, &lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;u&gt;IndexOutOfBoundsException&lt;/u&gt;, NegativeArraySizeException, NullPointerException, SecurityException. &lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;IllegalArgumentException--&gt;IllegalThreadStateException, NumberFormatException &lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;IndexOutOfBoundsException--&gt;ArrayIndexOutOfBoundsException, StringIndexOutOfBoundsException &lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;IOException--&gt;EOFException, FileNotFoundException, InterruptedIOException, UTFDataFormatException, MalformedURLException, ProtocolException, SockException, UnknownHostException, UnknownServiceException. &lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;b style=""&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;
 &lt;/span&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15047166-112548018847246196?l=java-coders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-coders.blogspot.com/feeds/112548018847246196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15047166&amp;postID=112548018847246196' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15047166/posts/default/112548018847246196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15047166/posts/default/112548018847246196'/><link rel='alternate' type='text/html' href='http://java-coders.blogspot.com/2005/08/scjp-study-noteschapter-5-flow-control.html' title='SCJP study notes:Chapter 5 Flow Control and Exceptions'/><author><name>shabda</name><uri>http://www.blogger.com/profile/07961528262493927188</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15047166.post-112548003153285804</id><published>2005-08-31T02:19:00.000-07:00</published><updated>2005-08-31T02:20:31.566-07:00</updated><title type='text'>SCJP study notes:Chapter 4 Converting and Casting</title><content type='html'>&lt;span style="font-size: 10pt; font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Originally written by &lt;/span&gt;Velmurugan Periasamy. Copyright belongs to him.  &lt;h1&gt;Chapter 4 Converting and Casting&lt;/h1&gt;   &lt;p class="MsoNormal"&gt;Unary Numeric Promotion&lt;/p&gt;   &lt;p class="MsoNormal"&gt;Contexts:&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Operand of the unary arithmetic operators + and –&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Operand of the unary integer bit-wise complement operator ~&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;During array creation, for example new int[x], where the dimension expression x must evaluate to an int value.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Indexing array elements, for example table[‘a’], where the index expression must evaluate to an int value.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Individual operands of the shift operators.&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;Binary numeric promotion&lt;/p&gt;   &lt;p class="MsoNormal"&gt;Contexts:&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Operands of arithmetic operators *, / , %, + and –&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Operands of relational operators &lt;, &lt;= , &gt; and &gt;=&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Numeric Operands of equality operators == and !=&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Integer Operands of bit-wise operators &amp;, ^ and |&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Conversion of Primitives&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;1.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;3 types of conversion – assignment conversion, method call conversion and arithmetic promotion&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;2.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;boolean may not be converted to/from any non-boolean type.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;3.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Widening conversions accepted. Narrowing conversions rejected.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;4.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;byte, short can’t be converted to char and vice versa.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;5.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Arithmetic promotion&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;5.1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Unary operators&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;if the operand is byte, short or char&lt;span style=""&gt;  &lt;/span&gt;{&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;convert it to int;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style=""&gt;       &lt;/span&gt;}&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt;"&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style=""&gt;        &lt;/span&gt;else { &lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: 18pt;"&gt;do nothing; no conversion needed;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: 36pt;"&gt;}&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;5.2&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Binary operators&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;if one operand is double {&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;all double; convert the other operand to double;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style=""&gt;       &lt;/span&gt;}&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt;"&gt;&lt;span style=""&gt;        &lt;/span&gt;&lt;span style=""&gt;       &lt;/span&gt;else if one operand is float { &lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;all float; convert the other operand to float;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: 18pt;"&gt;}&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: 18pt;"&gt;else if one operand is long { &lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;all long; convert the other operand to long;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: 18pt;"&gt;}&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: 18pt;"&gt;else { &lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;all int; convert all to int;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: 18pt;"&gt;}&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;6.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;When assigning a literal value to a variable, the range of the variable’s data type is checked against the value of the literal and assignment is allowed or compiler will produce an error.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;char c = 3;&lt;/span&gt; // this will compile, even though a numeric literal is by default an int since the range of char will accept the value&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;int a = 3;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;char d = a;&lt;/span&gt; // this won’t compile, since we’re assigning an int to char&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;char e = -1;&lt;/span&gt; // this also won’t compile, since the value is not in the range of char &lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;float f = 1.3;&lt;/span&gt; // this won’t compile, even though the value is within float range. Here range is not&lt;span style=""&gt;  &lt;/span&gt;important, but precision is. 1.3 is by default a double, so a specific cast or f = 1.3f will work.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;float f = 1/3; // this will compile, since RHS evaluates to an int.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;Float f = 1.0 / 3.0; // this won’t compile, since RHS evaluates to a double.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;7.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Also when assigning a final variable to a variable, even if the final variable’s data type is wider than the variable, if the value is within the range of the variable an implicit conversion is done.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;byte b;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;final int a = 10;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;b = a; // Legal, since value of ‘a’ is determinable and within range of b&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;final int x = a;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;b = x; // Legal, since value of ‘x’ is determinable and within range of b&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;int y;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;final int z = y;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;b = z; // Illegal, since value of ‘z’ is not determinable&lt;/p&gt;   &lt;p class="MsoNormal" style="text-indent: 18pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;8.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Method call conversions always look for the exact data type or a wider one in the method signatures. They will not do narrowing conversions to resolve methods, instead we will get a compile error.&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;Here is the figure of allowable primitive conversion.&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;byte &lt;span style="font-family: Wingdings;"&gt;&lt;span style=""&gt;à&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt; short &lt;/span&gt;&lt;span style="font-family: Wingdings;"&gt;&lt;span style=""&gt;à&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt; int &lt;/span&gt;&lt;span style="font-family: Wingdings;"&gt;&lt;span style=""&gt;à&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt; long &lt;/span&gt;&lt;span style="font-family: Wingdings;"&gt;&lt;span style=""&gt;à&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt; float &lt;/span&gt;&lt;span style="font-family: Wingdings;"&gt;&lt;span style=""&gt;à&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt; double&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;                            &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;­&lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: 36pt;"&gt;&lt;span style=""&gt;&lt;span style=""&gt;           &lt;/span&gt;char&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;Casting of Primitives&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;9.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Needed with narrowing conversions. Use with care – radical information loss. Also can be used with widening conversions, to improve the clarity of the code.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;10.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Can cast any non-boolean type to another non-boolean type.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;11.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Cannot cast a boolean or to a boolean type.&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;Conversion of Object references&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;12.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Three types of reference variables to denote objects - class, interface or array type.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;13.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Two kinds of objects can be created – class or array.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;14.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Two types of conversion – assignment and method call.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;15.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Permitted if the direction of the conversion is ‘up’ the inheritance hierarchy. Means that types can be assigned/substituted to only super-types – super-classes or interfaces. Not the other way around, explicit casting is needed for that.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;16.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Interfaces can be used as types when declaring variables, so they participate in the object reference conversion. But we cannot instantiate an interface, since it is abstract and doesn’t provide any implementation. These variables can be used to hold objects of classes that implement the interface. The reason for having interfaces as types may be, I think, several unrelated classes may implement the same interface and if there’s a need to deal with them collectively one way of treating them may be an array of the interface type that they implement.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;17.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Primitive arrays can be converted to only the arrays of the same primitive type. They cannot be converted to another type of primitive array. Only object reference arrays can be converted / cast.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;18.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Primitive arrays can be converted to an Object reference, but not to an Object[] reference. This is because all arrays (primitive arrays and Object[]) are extended from Object.&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;Casting of Object references&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;19.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Allows super-types to be assigned to subtypes. Extensive checks done both at compile and runtime. At compile time, class of the object may not be known, so at runtime if checks fail, a ClassCastException is thrown.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;20.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Cast operator, instanceof operator and the == operator behave the same way in allowing references to be the operands of them. You cannot cast or apply instanceof or compare &lt;i style=""&gt;unrelated references&lt;/i&gt;, &lt;i style=""&gt;sibling references or any incompatible references.&lt;/i&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;Compile-time Rules&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;When old and new types are classes, one class must be the sub-class of the other.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;When old and new types are arrays, both must contain reference types and it must be legal to cast between those types (primitive arrays cannot be cast, conversion possible only between same type of primitive arrays).&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;We can always cast between an interface and a non-final object.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;Run-time rules&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;If new type is a class, the class of the expression being converted must be new type or extend new type.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;If new type is an interface, the class of the expression being converted must implement the interface.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;An Object reference can be converted to: (java.lang.Object)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;an Object reference&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;a Cloneable interface reference, with casting, with runtime check&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;any class reference, with casting, with runtime check&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;any array referenece, with casting, with runtime check&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;any interface reference, with casting, with runtime check&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;A Class type reference can be converted to:&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;any super-class type reference, (including Object)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;any sub-class type reference, with casting, with runtime check&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;an interface reference, if the class implements that interface&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;any interface reference, with casting, with runtime check (except if the class is final and doesn’t implement the interface)&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;An Interface reference can be converted to:&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;an Object reference&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;a super-interface reference&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;any interface/class reference with casting, with runtime check (except if the class is final and doesn’t implement the interface)&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;A Primitive Array reference can be converted to:&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;an Object reference&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;a Cloneable interface reference&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;a primitive array reference of the same type&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;An Object Array reference can be converted to:&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;an Object reference&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;a&lt;span style=""&gt;  &lt;/span&gt;Cloneable interface reference&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;a super-class Array reference, including an Object Array reference&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;any sub-class Array reference with casting, with runtime check&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15047166-112548003153285804?l=java-coders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-coders.blogspot.com/feeds/112548003153285804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15047166&amp;postID=112548003153285804' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15047166/posts/default/112548003153285804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15047166/posts/default/112548003153285804'/><link rel='alternate' type='text/html' href='http://java-coders.blogspot.com/2005/08/scjp-study-noteschapter-4-converting.html' title='SCJP study notes:Chapter 4 Converting and Casting'/><author><name>shabda</name><uri>http://www.blogger.com/profile/07961528262493927188</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15047166.post-112547986011369217</id><published>2005-08-31T02:14:00.000-07:00</published><updated>2005-08-31T02:17:40.183-07:00</updated><title type='text'>SCJP study notes:Chapter 3 Modifiers</title><content type='html'>Originally written by Velmurugan Periasamy. Copyright belongs to him.  &lt;h1&gt;Chapter 3 Modifiers&lt;o:p&gt;&lt;/o:p&gt;&lt;/h1&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;1.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Modifiers are Java keywords that provide information to compiler about the nature of the code, data and classes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;2.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Access modifiers – public, protected, private&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Only applied to class level variables. Method variables are visible only inside the method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Can be applied to class itself (only to inner classes declared at class level, no such thing as protected or private top level class)&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Can be applied to methods and constructors.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;If a class is accessible, it doesn’t mean, the members are also accessible. Members’ accessibility determines what is accessible and what is not. But if the class is not accessible, the members are not accessible, even though they are declared public.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;If no access modifier is specified, then the accessibility is default package visibility. All classes in the same package can access the feature. It’s called as friendly access. But friendly is not a Java keyword. Same directory is same package in Java’s consideration.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;‘private’ means only the class can access it, not even sub-classes.&lt;span style=""&gt;  &lt;/span&gt;So, it’ll cause access denial to a sub-class’s own variable/method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;These modifiers dictate, which &lt;u&gt;classes&lt;/u&gt; can access the features. An &lt;u&gt;instance&lt;/u&gt; of a &lt;u&gt;class&lt;/u&gt; can access the private features of another &lt;u&gt;instance&lt;/u&gt; of the same &lt;u&gt;class&lt;/u&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;‘protected’ means all classes in the same package (like default) and sub-classes in any package can access the features. But a subclass in another package can access the protected members in the super-class via only the references of subclass or its subclasses. A subclass in the same package doesn’t have this restriction. This ensures that classes from other packages are accessing only the members that are part of their inheritance hierarchy.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Methods cannot be overridden to be more private. Only the direction shown in following figure is permitted from parent classes to sub-classes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: 36pt;"&gt;private &lt;span style="font-family: Wingdings;"&gt;&lt;span style=""&gt;à&lt;/span&gt;&lt;/span&gt; friendly (default) &lt;span style="font-family: Wingdings;"&gt;&lt;span style=""&gt;à&lt;/span&gt;&lt;/span&gt; protected &lt;span style="font-family: Wingdings;"&gt;&lt;span style=""&gt;à&lt;/span&gt;&lt;/span&gt; public&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;                &lt;/span&gt;Parent classes &lt;span style=""&gt;                                                                      &lt;/span&gt;Sub-classes&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;3.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;final&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;final features cannot be changed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;final classes cannot be sub-classed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;final variables cannot be changed. (Either a value has to be specified at declaration or an assignment statement can appear only once).&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;final methods cannot be overridden.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Method arguments marked final are read-only. Compiler error, if trying to assign values to final arguments inside the method. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Member variables marked final are not initialized by default. They have to be explicitly assigned a value at declaration or in an initializer block. Static finals must be assigned to a value in a static initializer block, instance finals must be assigned a value in an instance initializer or in every constructor. Otherwise the compiler will complain.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Final variables that are not assigned a value at the declaration and method arguments that are marked final are called blank final variables. They can be assigned a value at most once.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Local variables can be declared final as well.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;4.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;abstract&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Can be applied to classes and methods.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;For deferring implementation to sub-classes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Opposite of final, final can’t be sub-classed, abstract must be sub-classed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;A class should be declared abstract, &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;1.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;if it has any abstract methods.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;2.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;if it doesn’t provide implementation to any of the abstract methods it inherited&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;3.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;if it doesn’t provide implementation to any of the methods in an interface that it says implementing.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Just terminate the abstract method signature with a ‘;’, curly braces will give a compiler error.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;A class can be abstract even if it doesn’t have any abstract methods.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;5.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;static&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Can be applied to nested classes, methods, variables, free floating code-block (static initializer)&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Static variables are initialized at class load time. A class has only one copy of these variables.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Static methods can access only static variables. (They have no this)&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Access by class name is a recommended way to access static methods/variables.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Static initializer code is run at class load time.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Static methods may not be overridden to be non-static. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Non-static methods may not be overridden to be static.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Abstract methods may not be static.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Local variables cannot be declared as static.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Actually, static methods are not participating in the usual overriding mechanism of invoking the methods based on the class of the object at runtime. Static method binding is done at compile time, so the method to be invoked is determined by the type of reference variable rather than the actual type of the object it holds at runtime. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: 18pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;Let’s say a sub-class has a static method which ‘overrides’ a static method in a parent class.&lt;span style=""&gt;  &lt;/span&gt;If you have a reference variable of parent class type and you assign a child class object to that variable and invoke the static method, the method invoked will be the parent class method, not the child class method.&lt;span style=""&gt;  &lt;/span&gt;The following code explains this.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;public class StaticOverridingTest {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;public static void main(String s[]) {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;Child c = new Child();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;c.doStuff(); // This will invoke Child.doStuff()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;Parent p = new Parent();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;p.doStuff(); // This will invoke Parent.doStuff()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;p = c;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoBodyTextIndent3"&gt;&lt;span style=""&gt;       &lt;/span&gt;p.doStuff(); // This will invoke Parent.doStuff(), rather than Child.doStuff()&lt;span style=""&gt;    &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;class Parent {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;static int x = 100;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;public static void doStuff() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;System.out.println("In Parent..doStuff");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;System.out.println(x);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;class Child extends Parent {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;static int x = 200;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;public static void doStuff() {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;System.out.println("In Child..doStuff");&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;System.out.println(x);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;&lt;span style=""&gt; &lt;/span&gt;}&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;6.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;native&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Can be applied to methods only. (static methods also)&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Written in a non-Java language, compiled for a single machine target type.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Java classes use lot of native methods for performance and for accessing hardware Java is not aware of.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Native method signature should be terminated by a ‘;’, curly braces will provide a compiler error.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;native doesn’t affect access qualifiers. Native methods can be private.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Can pass/return Java objects from native methods.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;System.loadLibrary is used in static initializer code to load native libraries. If the library is not loaded when the static method is called, an UnsatisfiedLinkError is thrown.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;7.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;transient&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Can be applied to class level variables only.(Local variables cannot be declared transient)&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Transient variables may not be final or static.(But compiler allows the declaration, since it doesn’t do any harm. Variables marked transient are never serialized. Static variables are not serialized anyway.)&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Not stored as part of object’s persistent state, i.e. not written out during serialization.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Can be used for security.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;8.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;synchronized&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Can be applied to methods or parts of methods only.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Used to control access to critical code in multi-threaded programs.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;9.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;volatile&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Can be applied to variables only.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Can be applied to static variables.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Cannot be applied to final variables.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Declaring a variable volatile indicates that it might be modified asynchronously, so that all threads will get the correct value of the variable.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Used in multi-processor environments.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;table class="MsoNormalTable" style="border: medium none ; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;   &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0cm 5.4pt; width: 68.4pt;" valign="top" width="91"&gt;   &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt;"&gt;Modifier&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 31.5pt;" valign="top" width="42"&gt;   &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt;"&gt;Class&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 81pt;" valign="top" width="108"&gt;   &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt;"&gt;Inner classes (Except local   and anonymous classes)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 45pt;" valign="top" width="60"&gt;   &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt;"&gt;Variable&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 45pt;" valign="top" width="60"&gt;   &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt;"&gt;Method&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 63pt;" valign="top" width="84"&gt;   &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt;"&gt;Constructor&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 108pt;" valign="top" width="144"&gt;   &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size: 9pt;"&gt;Free floating Code block&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 68.4pt;" valign="top" width="91"&gt;   &lt;p class="MsoNormal"&gt;public&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 31.5pt;" valign="top" width="42"&gt;   &lt;p class="MsoNormal"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 81pt;" valign="top" width="108"&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 45pt;" valign="top" width="60"&gt;   &lt;p class="MsoNormal"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 45pt;" valign="top" width="60"&gt;   &lt;p class="MsoNormal"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 63pt;" valign="top" width="84"&gt;   &lt;p class="MsoNormal"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 108pt;" valign="top" width="144"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 68.4pt;" valign="top" width="91"&gt;   &lt;p class="MsoNormal"&gt;protected&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 31.5pt;" valign="top" width="42"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 81pt;" valign="top" width="108"&gt;   &lt;p class="MsoNormal"&gt;Y &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 45pt;" valign="top" width="60"&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 45pt;" valign="top" width="60"&gt;   &lt;p class="MsoNormal"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 63pt;" valign="top" width="84"&gt;   &lt;p class="MsoNormal"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 108pt;" valign="top" width="144"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 68.4pt;" valign="top" width="91"&gt;   &lt;p class="MsoNormal"&gt;(friendly)&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;No access modifier&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 31.5pt;" valign="top" width="42"&gt;   &lt;p class="MsoNormal"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 81pt;" valign="top" width="108"&gt;   &lt;p class="MsoNormal"&gt;Y (OK for all)&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 45pt;" valign="top" width="60"&gt;   &lt;p class="MsoNormal"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 45pt;" valign="top" width="60"&gt;   &lt;p class="MsoNormal"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 63pt;" valign="top" width="84"&gt;   &lt;p class="MsoNormal"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 108pt;" valign="top" width="144"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 68.4pt;" valign="top" width="91"&gt;   &lt;p class="MsoNormal"&gt;private&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 31.5pt;" valign="top" width="42"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 81pt;" valign="top" width="108"&gt;   &lt;p class="MsoNormal"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 45pt;" valign="top" width="60"&gt;   &lt;p class="MsoNormal"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 45pt;" valign="top" width="60"&gt;   &lt;p class="MsoNormal"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 63pt;" valign="top" width="84"&gt;   &lt;p class="MsoNormal"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 108pt;" valign="top" width="144"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 68.4pt;" valign="top" width="91"&gt;   &lt;p class="MsoNormal"&gt;final&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 31.5pt;" valign="top" width="42"&gt;   &lt;p class="MsoNormal"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 81pt;" valign="top" width="108"&gt;   &lt;p class="MsoNormal"&gt;Y (Except anonymous classes)&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 45pt;" valign="top" width="60"&gt;   &lt;p class="MsoNormal"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 45pt;" valign="top" width="60"&gt;   &lt;p class="MsoNormal"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 63pt;" valign="top" width="84"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 108pt;" valign="top" width="144"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 68.4pt;" valign="top" width="91"&gt;   &lt;p class="MsoNormal"&gt;abstract&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 31.5pt;" valign="top" width="42"&gt;   &lt;p class="MsoNormal"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 81pt;" valign="top" width="108"&gt;   &lt;p class="MsoNormal"&gt;Y (Except anonymous classes)&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 45pt;" valign="top" width="60"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 45pt;" valign="top" width="60"&gt;   &lt;p class="MsoNormal"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 63pt;" valign="top" width="84"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 108pt;" valign="top" width="144"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 68.4pt;" valign="top" width="91"&gt;   &lt;p class="MsoNormal"&gt;static&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 31.5pt;" valign="top" width="42"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 81pt;" valign="top" width="108"&gt;   &lt;p class="MsoNormal"&gt;Y &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 45pt;" valign="top" width="60"&gt;   &lt;p class="MsoNormal"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 45pt;" valign="top" width="60"&gt;   &lt;p class="MsoNormal"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 63pt;" valign="top" width="84"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 108pt;" valign="top" width="144"&gt;   &lt;p class="MsoNormal"&gt;Y (static initializer)&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 68.4pt;" valign="top" width="91"&gt;   &lt;p class="MsoNormal"&gt;native&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 31.5pt;" valign="top" width="42"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 81pt;" valign="top" width="108"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 45pt;" valign="top" width="60"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 45pt;" valign="top" width="60"&gt;   &lt;p class="MsoNormal"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 63pt;" valign="top" width="84"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 108pt;" valign="top" width="144"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 68.4pt;" valign="top" width="91"&gt;   &lt;p class="MsoNormal"&gt;transient&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 31.5pt;" valign="top" width="42"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 81pt;" valign="top" width="108"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 45pt;" valign="top" width="60"&gt;   &lt;p class="MsoNormal"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 45pt;" valign="top" width="60"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 63pt;" valign="top" width="84"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 108pt;" valign="top" width="144"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 68.4pt;" valign="top" width="91"&gt;   &lt;p class="MsoNormal"&gt;synchronized&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 31.5pt;" valign="top" width="42"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 81pt;" valign="top" width="108"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 45pt;" valign="top" width="60"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 45pt;" valign="top" width="60"&gt;   &lt;p class="MsoNormal"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 63pt;" valign="top" width="84"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 108pt;" valign="top" width="144"&gt;   &lt;p class="MsoNormal"&gt;Y (part of method, also need to specify an object on which   a lock should be obtained)&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 68.4pt;" valign="top" width="91"&gt;   &lt;p class="MsoNormal"&gt;volatile&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 31.5pt;" valign="top" width="42"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 81pt;" valign="top" width="108"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 45pt;" valign="top" width="60"&gt;   &lt;p class="MsoNormal"&gt;Y&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 45pt;" valign="top" width="60"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 63pt;" valign="top" width="84"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 108pt;" valign="top" width="144"&gt;   &lt;p class="MsoNormal"&gt;N&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/15047166-112547986011369217?l=java-coders.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-coders.blogspot.com/feeds/112547986011369217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=15047166&amp;postID=112547986011369217' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/15047166/posts/default/112547986011369217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/15047166/posts/default/112547986011369217'/><link rel='alternate' type='text/html' href='http://java-coders.blogspot.com/2005/08/scjp-study-noteschapter-3-modifiers.html' title='SCJP study notes:Chapter 3 Modifiers'/><author><name>shabda</name><uri>http://www.blogger.com/profile/07961528262493927188</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-15047166.post-112547958056442008</id><published>2005-08-31T02:10:00.000-07:00</published><updated>2005-08-31T02:13:00.636-07:00</updated><title type='text'>SCJP study notes:Chapter 2 Operators and assignments</title><content type='html'>Originally written by Velmurugan Periasamy. Copyright belongs to him.  &lt;h2&gt;Chapter 2 Operators and assignments&lt;/h2&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;1.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Unary operators.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;1.1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Increment and Decrement operators ++ --&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;We have postfix and prefix notation. In post-fix notation value of the variable/expression is &lt;u&gt;modified after&lt;/u&gt; the value is taken for the execution of statement. In prefix notation, value of the variable/expression is &lt;u&gt;modified before&lt;/u&gt; the value is taken for the execution of statement.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;x = 5; y = 0; y = x++;&lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;Result will be x = 6, y = 5&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;x = 5; y = 0; y = ++x;&lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;Result will be x = 6, y = 6&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;Implicit narrowing conversion is done, when applied to byte, short or char.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;1.2&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Unary minus and unary plus + -&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;+ has no effect than to stress positivity.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;- negates an expression’s value. (2’s complement for integral expressions)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;1.3&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Negation !&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;Inverts the value of a boolean expression.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;1.4&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Complement ~&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;Inverts the bit pattern of an integral expression. (1’s complement – 0s to 1s and 1s to 0s)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;Cannot be applied to non-integral types.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;1.5&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Cast ()&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt;"&gt;Persuades compiler to allow certain assignments. Extensive checking is done at compile and runtime to ensure type-safety.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;2.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Arithmetic operators - *, /, %, +, - &lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Can be applied to all numeric types. &lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Can be applied to only the numeric types, except ‘+’ – it can be applied to Strings as well.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;All arithmetic operations are done at least with ‘int’. (If types are smaller, promotion happens. Result will be of a type at least as wide as the wide type of operands)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Accuracy is lost silently when arithmetic overflow/error occurs. Result is a nonsense value.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Integer division by zero throws an exception.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;% - reduce the magnitude of LHS by the magnitude of RHS. (continuous subtraction)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;% - sign of the result entirely determined by sign of LHS&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;5 % 0 throws an ArithmeticException.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Floating point calculations can produce &lt;st1:place st="on"&gt;NaN&lt;/st1:place&gt; (square root of a negative no) or Infinity ( division by zero). Float and Double wrapper classes have named constants for &lt;st1:place st="on"&gt;NaN&lt;/st1:place&gt; and infinities.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;st1:place st="on"&gt;NaN&lt;/st1:place&gt;’s are non-ordinal for comparisons. x ==&lt;span style=""&gt;  &lt;/span&gt;Float.NaN won’t work. Use Float.IsNaN(x) But equals method on wrapper objects(Double or Float) with NaN values compares &lt;st1:place st="on"&gt;Nan&lt;/st1:place&gt;’s correctly.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Infinities are ordinal. X == Double.POSITIVE_INFINITY will give expected result.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;+ also performs String concatenation (when any operand in an expression is a String). The language itself overloads this operator. toString method of non-String object operands are called to perform concatenation. In case of primitives, a wrapper object is created with the primitive value and toString method of that object is called. (“Vel” + 3 will work.)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Be aware of associativity when multiple operands are involved.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;System.out.println( 1 + 2 + “3” );&lt;/span&gt; // Prints 33&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;System.out.println( “1” + 2 + 3 );&lt;/span&gt; // Prints 123&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;3.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Shift operators - &lt;&lt;, &gt;&gt;, &gt;&gt;&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;&lt;&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&gt;&gt; performs a signed right shift. Sign bit is brought in from the left. (0 if positive, 1 if negative. Value becomes old value / 2 ^ x where x is no of bits shifted. Also called arithmetic right shift.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&gt;&gt;&gt; performs an unsigned logical right shift. 0 bits are brought in from the left. This operator exists since Java doesn’t provide an unsigned data type (except char). &gt;&gt;&gt; changes the sign of a negative number to be positive. So don’t use it with negative numbers, if you want to preserve the sign. Also don’t use it with types smaller than int. (Since types smaller than int are promoted to an int before any shift operation and the result is cast down again, so the end result is unpredictable.)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Shift operators can be applied to only integral types.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;-1 &gt;&gt; 1 is –1, not 0. This differs from simple division by 2. We can think of it as shift operation rounding down.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;1 &lt;&lt;&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Negative numbers are represented in two’s complement notation. (Take one’s complement and add 1 to get two’s complement)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Shift operators never shift more than the number of bits the type of result can have. ( i.e. int 32, long 64) RHS operand is reduced to RHS % x where x is no of bits in type of result.&lt;span style=""&gt;  &lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 90pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;int x; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 90pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;x =&lt;span style=""&gt;  &lt;/span&gt;x &gt;&gt; 33;&lt;/span&gt; &lt;span style=""&gt; &lt;/span&gt;// Here actually what happens is x &gt;&gt; 1&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;4.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Comparison operators – all return boolean type.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;4.1&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Ordinal comparisons - &lt;, &lt;=, &gt; , &gt;= &lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Only operate on numeric types. Test the relative value of the numeric operands.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Arithmetic promotions apply. char can be compared to float.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;4.2&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Object type comparison – instanceof&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Tests the class of an object at runtime. Checking is done at compile and runtime same as the cast operator.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Returns true if the object denoted by LHS reference can be cast to RHS type.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;LHS should be an object reference expression, variable or an array reference.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;RHS should be a class (abstract classes are fine), an interface or an array type, castable to LHS object reference. Compiler error if LHS &amp; RHS are unrelated.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Can’t use java.lang.Class or its String name as RHS.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Returns true if LHS is a class or subclass of RHS class&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Returns true if LHS implements RHS interface.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Returns true if LHS is an array reference and of type RHS.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;x instanceof Component[] – legal.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;x instanceof [] – illegal. Can’t test for ‘any array of any type’&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Returns false if LHS is null, no exceptions are thrown.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;If x instanceof Y is not allowed by compiler, then Y y = (Y) x is not a valid cast expression. If x instanceof Y is allowed and returns false, the above cast is valid but throws a ClassCastException at runtime. If x instanceof Y returns true, the above cast is valid and runs fine.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 54pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;4.3&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Equality comparisons - ==, !=&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;For primitives it’s a straightforward value comparison. (promotions apply)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;For object references, this doesn’t make much sense. Use equals method for meaningful comparisons. (Make sure that the class implements equals in a meaningful way, like for X.equals(Y) to be true, Y instance of X must be true as well)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;For String literals, == will return true, this is because of compiler optimization.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;5.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Bit-wise operators - &amp;, ^, |&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Operate on numeric and boolean operands.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&amp; - AND operator, both bits must be 1 to produce 1.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;| - OR operator, any one bit can be 1 to produce 1.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;^ - XOR operator, any one bit can be 1, but not both, to produce 1.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;In case of booleans true is 1, false is 0.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Can’t cast any other type to boolean.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;6.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Short-circuit logical operators - &amp;&amp;amp;, ||&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Operate only on boolean types.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;RHS might not be evaluated (hence the name short-circuit), if the result can be determined only by looking at LHS.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;false &amp;&amp;amp; X&lt;span style=""&gt;  &lt;/span&gt;is always false.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;true || X is always true.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;RHS is evaluated only if the result is not certain from the LHS.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;That’s why there’s no logical XOR operator. Both bits need to be known to calculate the result.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Short-circuiting doesn’t change the result of the operation. But side effects might be changed. (i.e. some statements in RHS might not be executed, if short-circuit happens. Be careful)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;7.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Ternary operator&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Format a = x ? b : c ;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;x should be a boolean expression.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Based on x, either b or c is evaluated. Both are never evaluated.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;b will be assigned to a if x is true, else c is assigned to a.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;b and c should be assignment compatible to a. &lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;b and c are made identical during the operation according to promotions. &lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;8.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Assignment operators.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Simple assignment =.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;op= calculate and assign operators(extended assignment operators)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;*=, /=, %=, +=, -=&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;x += y means x = x + y. But x is evaluated only once. Be aware.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Assignment of reference variables copies the reference value, not the object body.&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Assignment has value, value of LHS after assignment. So a = b = c = 0 is legal. c = 0 is executed first, and the value of the assignment (0) assigned to b, then the value of that assignment (again 0) is assigned to a. &lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Extended assignment operators do an implicit cast. (Useful when applied to byte, short or char)&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: 36pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;byte b = 10;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;b = b + 10; // Won’t compile, explicit cast required since the expression evaluates to an int&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 72pt;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;b += 10; // OK, += does an implicit cast from int to byte&lt;/span&gt;&lt;/p&gt;   &lt;p class="Preformatted" style=""&gt;&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 18pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=""&gt;9.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;General&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;In Java, No overflow or underflow of integers happens. i.e. The values wrap around. Adding 1 to the maximum int value results in the minimum value. &lt;/p&gt;   &lt;p class="MsoNormal" style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span style=""&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;Always keep in mind that operands are evaluated from left to right, and the operations are executed in the order of precedence and associativity.&lt;span style=""
