<?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'><id>tag:blogger.com,1999:blog-7844341291913287808</id><updated>2009-10-20T04:49:54.735-04:00</updated><title type='text'>Learning Java Programming</title><subtitle type='html'>Java Sansar - Learning java in 5 weeks</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default?start-index=26&amp;max-results=25'/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>32</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7844341291913287808.post-2221444376672234742</id><published>2009-01-07T00:49:00.012-05:00</published><updated>2009-08-25T19:17:10.170-04:00</updated><title type='text'>About Javasansar</title><content type='html'>&lt;table border="0" cellpadding="2" cellspacing="2" bgcolor="white" align="left"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href="http://1.bp.blogspot.com/_NoEeV7yoSLs/SVuHps69ptI/AAAAAAAAAAM/EGFE3mQxK3Q/s1600-h/java_logo_1.jpeg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img id="BLOGGER_PHOTO_ID_5285967738152265426" border="0" style="margin: width: 10px; height: 20px;" alt="" src="http://1.bp.blogspot.com/_NoEeV7yoSLs/SVuHps69ptI/AAAAAAAAAAM/EGFE3mQxK3Q/s200/java_logo_1.jpeg"/&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

Welcome to the Learning Java Programming. I would like to thank you for visiting my  blog for those of you who have tremendous interests in learning basic of java programming  in a quick easy steps via tutorials. Here, you will not only find java tutorials  but lots of other knowledgeable materials such as software testing techniques, methodologies and more which lead you to become a successful java developer as well as a Software Test  Engineer and get you started with a successful career ahead. 
&lt;/p&gt;&lt;p&gt;
&lt;a href="http://javasansar.blogspot.com"&gt;javasansar.blogspot.com&lt;/a&gt; is a beginner Java tutorial site designed to teach  basics of Java programming Language to those who have never programmed before  and are willing to learn it quickly in a very short period of time.
Java has  emerged to be the most popular general purpose programming language of the  current age. Java programming language is a simple, portable, distributed,  robust, secure, dynamic, architecture neutral, object oriented language.

&lt;p&gt;
Java Programming formally appeared in 1995 designed by Sun Microsystems. Java  generally refers to a combination of three things: the Java programming language  (a high-level, object-oriented programming language); the Java Virtual Machine  (a high-performance virtual machine that executes bytecodes on a specific  computing platform, typically abbreviated JVM); and the Java platform, a JVM  running compiled Java bytecodes, usually calling on a set of standard libraries  such as those provided by Java Standard Edition (SE) or Enterprise Edition (EE).  Java is a simple programming language. 
&lt;/p&gt;&lt;p&gt;
Colleges and Universities all over the world are adapting Java in their  introduction courses as well as their junior and senior software engineering  courses. This brings great demand for java developers and programmers opening  the doors for the great opportunities. Java programming language is used to  develop various applications or projects world wide in the various sectors  including banking, telecom, insurance, retail, media, education, manufacturing  etc. Java language is significantly used by Gaming, Mobile, Embedded, Media, and  many more types of applications.
&lt;/p&gt;&lt;p&gt;This site (&lt;a href="http://javasansar.blogspot.com"&gt;javasansar.blogspot.com&lt;/a&gt;) was developed considering the  importance of this language and the benefits that it provides to new developers,  students, education institutions etc. javasansar.blogspot.com is free online  Java tutorial site with a huge number of java tutorials including software  testing techniques for software testers. This site will keep adding more  content, updates, features, links, and other useful information on daily or weekly basis. Your comments, suggestions, ideas will always be appreciated and an inspiration for us.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7844341291913287808-2221444376672234742?l=javasansar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/2221444376672234742/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7844341291913287808&amp;postID=2221444376672234742' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/2221444376672234742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/2221444376672234742'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/2009/01/about-javasansar.html' title='About Javasansar'/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08436281743629996970'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_NoEeV7yoSLs/SVuHps69ptI/AAAAAAAAAAM/EGFE3mQxK3Q/s72-c/java_logo_1.jpeg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7844341291913287808.post-5533684166890472569</id><published>2009-01-07T00:37:00.005-05:00</published><updated>2009-01-25T18:24:30.369-05:00</updated><title type='text'>Java Glossary of Terms</title><content type='html'>&lt;p&gt;
&lt;font color="blue"&gt;&lt;MARQUEE width="700%"&gt;Learn Java in just 5 weeks&lt;/MARQUEE&gt;&lt;/font&gt;
&lt;hr&gt;

&lt;table border="0" cellpadding="0" cellspacing="0" width="80%" bgcolor="#F0FeFF"&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="#A1"&gt;A&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#B1"&gt;B&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#C1"&gt;C&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#D1"&gt;D&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#E1"&gt;E&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#F1"&gt;F&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#G1"&gt;G&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#H1"&gt;H&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#I1"&gt;I&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#J1"&gt;J&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#K1"&gt;K&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#L1"&gt;L&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#M1"&gt;M&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#N1"&gt;N&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#O1"&gt;O&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#P1"&gt;P&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#Q1"&gt;Q&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#R1"&gt;R&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#S1"&gt;S&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#T1"&gt;T&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#U1"&gt;U&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#V1"&gt;V&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#W1"&gt;W&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#X1"&gt;X&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#Y1"&gt;Y&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="#Z1"&gt;Z&lt;/a&gt;&lt;/td&gt;

&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;

&lt;table border="0" cellpadding="1" cellspacing="1" width="90%" bgcolor="#F0FeFF"&gt;
&lt;tr&gt;
&lt;td cellpadding="3" cellspacing="3" align="left"&gt;
&lt;script type="text/javascript"&gt;&lt;!--
indeed_jobroll_format = "300x250";
indeed_jobroll_publisher = "4159526527794233";
indeed_jobroll_keywords = "java developers";
indeed_jobroll_location = "";
indeed_jobroll_channel = "java developer";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="http://jobroll.indeed.com/ads/jobroll2.js"&gt;
&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://www.indeed.com/"&gt;Jobs&lt;/a&gt; by Indeed&lt;/noscript&gt;
&lt;/td&gt;

&lt;td cellpadding="3" cellspacing="3" align="right"&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-5347178153387462";
/* 300x250_qa_books */
google_ad_slot = "5552569284";
google_ad_width = 300;
google_ad_height = 250;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;
&lt;a name="A1"&gt;&lt;font color="red"&gt;&lt;b&gt;A&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Abstract Window Toolkit (AWT):&lt;/b&gt;&lt;/font&gt; A collection of graphical user interface (GUI) components that were implemented using native-platform versions of the components. These components provide that subset of functionality which is common to all native platforms. Largely supplanted by the Project Swing component set. See also Swing Set.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;abstract:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used in a class definition to specify that a class is not to be instantiated, but rather inherited by other classes. An abstract class can have abstract methods that are not implemented in the abstract class, but in subclasses.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;abstract class:&lt;/b&gt;&lt;/font&gt; A class that contains one or more abstract methods, and therefore can never be instantiated. Abstract classes are defined so that other classes can extend them and make them concrete by implementing the abstract methods.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;abstract method:&lt;/b&gt;&lt;/font&gt; A method that has no implementation.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;actual parameter list:&lt;/b&gt;&lt;/font&gt; The arguments specified in a particular method call. See also formal parameter list.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;alpha value:&lt;/b&gt;&lt;/font&gt; A value that indicates the opacity of a pixel.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;API:&lt;/b&gt;&lt;/font&gt; Application Programming Interface. The specification of how a programmer writing an application accesses the behavior and state of classes and objects.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;appliances:&lt;/b&gt;&lt;/font&gt; Networked devices such as printers, Java(TM) technology-enabled terminals, and clients, that are managed using applications built using the Java Management API (JMAPI).
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;applet:&lt;/b&gt;&lt;/font&gt; A program written in the Java(TM) programming language to run within a web browser compatible with the Java platform, such as HotJava(TM) or Netscape Navigator(TM).
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;argument:&lt;/b&gt;&lt;/font&gt; A data item specified in a method call. An argument can be a literal value, a variable, or an expression.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;array:&lt;/b&gt;&lt;/font&gt; A collection of data items, all of the same type, in which each item's position is uniquely designated by an integer.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;ASCII:&lt;/b&gt;&lt;/font&gt; American Standard Code for Information Interchange. A standard assignment of 7-bit numeric codes to characters. See also Unicode.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;atomic:&lt;/b&gt;&lt;/font&gt; Refers to an operation that is never interrupted or left in an incomplete state under any circumstance.
&lt;p&gt;
&lt;a name="B1"&gt;&lt;font color="red"&gt;&lt;b&gt;B&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;

&lt;font color="blue"&gt;&lt;b&gt;Bean:&lt;/b&gt;&lt;/font&gt; A reusable software component. Beans can be combined to create an application.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;binary operator:&lt;/b&gt;&lt;/font&gt; An operator that has two arguments.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;bit:&lt;/b&gt;&lt;/font&gt; The smallest unit of information in a computer, with a value of either 0 or 1.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;bitwise operator:&lt;/b&gt;&lt;/font&gt; An operator that manipulates two values comparing each bit of one value to the corresponding bit of the other value.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;block:&lt;/b&gt;&lt;/font&gt; In the Java(TM) programming language, any code between matching braces. Example: { x = 1; }.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;boolean:&lt;/b&gt;&lt;/font&gt; Refers to an expression or variable that can have only a true or false value. The Java(TM) programming language provides the boolean type and the literal values true and false.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;bounding box:&lt;/b&gt;&lt;/font&gt; For a Raster object, the smallest rectangle that completely encloses all the pixels that are not fully transparent.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;break:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used to resume program execution at the statement immediately following the current statement. If followed by a label, the program resumes execution at the labeled statement.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;byte:&lt;/b&gt;&lt;/font&gt; A sequence of eight bits. The Java(TM) programming language provides a corresponding byte type.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;bytecode:&lt;/b&gt;&lt;/font&gt; Machine-independent code generated by the Java(TM) compiler and executed by the Java interpreter.
&lt;p&gt;

&lt;a name="C1"&gt;&lt;font color="red"&gt;&lt;b&gt;C&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;

&lt;font color="blue"&gt;&lt;b&gt;case:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword that defines a group of statements to begin executing if a value specified matches the value defined by a preceding "switch" keyword.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;casting:&lt;/b&gt;&lt;/font&gt; Explicit conversion from one data type to another.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;catch:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used to declare a block of statements to be executed in the event that a Java exception, or run time error, occurs in a preceding "try" block.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;char:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used to declare a variable of type character.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;class:&lt;/b&gt;&lt;/font&gt; In the Java(TM) programming language, a type that defines the implementation of a particular kind of object. A class definition defines instance and class variables and methods, as well as specifying the interfaces the class implements and the immediate superclass of the class. If the superclass is not explicitly specified, the superclass will implicitly be Object.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;class method:&lt;/b&gt;&lt;/font&gt; A method that is invoked without reference to a particular object. Class methods affect the class as a whole, not a particular instance of the class. Also called a static method. See also instance method.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;classpath:&lt;/b&gt;&lt;/font&gt; A classpath is an environmental variable which tells the Java(TM) virtual machine and Java technology-based applications (for example, the tools located in the JDK(TM) 1.1.X\bin directory) where to find the class libraries, including user-defined class libraries.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;class variable:&lt;/b&gt;&lt;/font&gt; A data item associated with a particular class as a whole--not with particular instances of the class. Class variables are defined in class definitions. Also called a static field. See also instance variable.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;client:&lt;/b&gt;&lt;/font&gt; In the client/server model of communcations, the client is a process that remotely accesses resources of a compute server, such as compute power and large memory capacity.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;codebase:&lt;/b&gt;&lt;/font&gt; Works together with the code attribute in the &amp;lt;APPLET&amp;gt; tag to give a complete specification of where to find the main applet class file: code specifies the name of the file, and codebase specifies the URL of the directory containing the file.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;comment:&lt;/b&gt;&lt;/font&gt; In a program, explanatory text that is ignored by the compiler. In programs written in the Java(TM) programming language, comments are delimited using // or /*...*/.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;compilation unit:&lt;/b&gt;&lt;/font&gt; The smallest unit of source code that can be compiled. In the current implementation of the Java(TM) platform, the compilation unit is a file.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;compiler:&lt;/b&gt;&lt;/font&gt; A program to translate source code into code to be executed by a computer. The Java(TM) compiler translates source code written in the Java programming language into bytecode for the Java virtual machine. See also interpreter.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;compositing:&lt;/b&gt;&lt;/font&gt; The process of superimposing one image on another to create a single image.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;constructor:&lt;/b&gt;&lt;/font&gt; A pseudo-method that creates an object. In the Java(TM) programming language, constructors are instance methods with the same name as their class. Constructors are invoked using the new keyword.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;const:&lt;/b&gt;&lt;/font&gt; This is a reserved Java(TM) programming language keyword. However, it is not used by current versions of the Java programming language.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;continue:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used to resume program execution at the end of the current loop. If followed by a label, "continue" resumes execution where the label occurs.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;core class:&lt;/b&gt;&lt;/font&gt; A public class (or interface) that is a standard member of the Java(TM) Platform. The intent is that the core classes for the Java platform, at minimum, are available on all operating systems where the Java platform runs. A program written entirely in the Java programming language relies only on core classes, meaning it can run anywhere. See also, 100% Pure Java(TM).
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Core Packages:&lt;/b&gt;&lt;/font&gt; The required set of APIs in a Java platform edition which must be supported in any and all compatible implementations.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;critical section:&lt;/b&gt;&lt;/font&gt; A segment of code in which a thread uses resources (such as certain instance variables) that can be used by other threads, but that must not be used by them at the same time.
&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-5347178153387462";
/* 728x90, created 1/1/09 */
google_ad_slot = "6054553841";
google_ad_width = 728;
google_ad_height = 90;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;p&gt;
&lt;a name="D1"&gt;&lt;font color="red"&gt;&lt;b&gt;D&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;

&lt;font color="blue"&gt;&lt;b&gt;declaration:&lt;/b&gt;&lt;/font&gt; A statement that establishes an identifier and associates attributes with it, without necessarily reserving its storage (for data) or providing the implementation (for methods). See also definition.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;default:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword optionally used after all "case" conditions in a "switch" statement. If all "case" conditions are not matched by the value of the "switch" variable, the "default" keyword will be executed.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;definition:&lt;/b&gt;&lt;/font&gt; A declaration that reserves storage (for data) or provides implementation (for methods). See also declaration.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;deprecation:&lt;/b&gt;&lt;/font&gt; Refers to a class, interface, constructor, method or field that is no longer recommended, and may cease to exist in a future version.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;derived from:&lt;/b&gt;&lt;/font&gt; Class X is "derived from" class Y if class X extends class Y. See also subclass, superclass.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;distributed:&lt;/b&gt;&lt;/font&gt; Running in more than one address space.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;do:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used to declare a loop that will iterate a block of statements. The loop`s exit condition can be specified with the "while" keyword.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;double:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used to define a variable of type double.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;double precision:&lt;/b&gt;&lt;/font&gt; In the Java(TM) programming language specification, describes a floating point number that holds 64 bits of data. See also single precision.
&lt;p&gt;

&lt;a name="E1"&gt;&lt;font color="red"&gt;&lt;b&gt;E&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;

&lt;font color="blue"&gt;&lt;b&gt;else:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used to execute a block of statements in the case that the test condition with the "if" keyword evaluates to false.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;EmbeddedJava(TM) Technology:&lt;/b&gt;&lt;/font&gt; The availability of Sun's Java 2 Platform, Micro Edition technology under a restrictive license agreement that allows a licensee to leverage certain Java technologies to create and deploy a closed-box application that exposes no APIs.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;encapsulation:&lt;/b&gt;&lt;/font&gt; The localization of knowledge within a module. Because objects encapsulate data and implementation, the user of an object can view the object as a black box that provides services. Instance variables and methods can be added, deleted, or changed, but as long as the services provided by the object remain the same, code that uses the object can continue to use it without being rewritten. See also instance variable, instance method.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;exception:&lt;/b&gt;&lt;/font&gt; An event during program execution that prevents the program from continuing normally; generally, an error. The Java(TM) programming language supports exceptions with the try, catch, and throw keywords. See also exception handler.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;exception handler:&lt;/b&gt;&lt;/font&gt; A block of code that reacts to a specific type of exception. If the exception is for an error that the program can recover from, the program can resume executing after the exception handler has executed.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;executable content:&lt;/b&gt;&lt;/font&gt; An application that runs from within an HTML file. See also applet.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;extends:&lt;/b&gt;&lt;/font&gt; Class X extends class Y to add functionality, either by adding fields or methods to class Y, or by overriding methods of class Y. An interface extends another interface by adding methods. Class X is said to be a subclass of class Y. See also derived from.
&lt;p&gt;

&lt;a name="F1"&gt;&lt;font color="red"&gt;&lt;b&gt;F&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;

&lt;font color="blue"&gt;&lt;b&gt;FCS:&lt;/b&gt;&lt;/font&gt; First Customer Ship. The day in which a product is released/shipped to the customer.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;field:&lt;/b&gt;&lt;/font&gt; A data member of a class. Unless specified otherwise, a field is not static.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;final:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword. You define an entity once and cannot change it or derive from it later. More specifically: a final class cannot be subclassed, a final method cannot be overridden and a final variable cannot change from its initialized value.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;finally:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword that executes a block of statements regardless of whether a Java Exception, or run time error, occurred in a block defined previously by the "try" keyword.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;float:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used to define a floating point number variable.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;for:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used to declare a loop that reiterates statements. The programmer can specify the statements to be executed, exit conditions, and initialization variables for the loop.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;FTP:&lt;/b&gt;&lt;/font&gt; The basic Internet File Transfer Protocol. FTP, which is based on TCP/IP, enables the fetching and storing of files between hosts on the Internet. See also TCP/IP.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;formal parameter list:&lt;/b&gt;&lt;/font&gt; The parameters specified in the definition of a particular method. See also actual parameter list.
&lt;p&gt;

&lt;a name="G1"&gt;&lt;font color="red"&gt;&lt;b&gt;G&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;

&lt;font color="blue"&gt;&lt;b&gt;garbage collection:&lt;/b&gt;&lt;/font&gt; The automatic detection and freeing of memory that is no longer in use. The Java(TM) runtime system performs garbage collection so that programmers never explicitly free objects.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;goto:&lt;/b&gt;&lt;/font&gt; This is a reserved Java(TM) programming language keyword. However, it is not used by current versions of the Java programming language.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;GUI:&lt;/b&gt;&lt;/font&gt; Graphical User Interface. Refers to the techniques involved in using graphics, along with a keyboard and a mouse, to provide an easy-to-use interface to some program.
&lt;p&gt;

&lt;a name="H1"&gt;&lt;font color="red"&gt;&lt;b&gt;H&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;

&lt;font color="blue"&gt;&lt;b&gt;hexadecimal:&lt;/b&gt;&lt;/font&gt; The numbering system that uses 16 as its base. The marks 0-9 and a-f (or equivalently A-F) represent the digits 0 through 15. In programs written in the Java(TM) programming language, hexadecimal numbers must be preceded with 0x. See also octal.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;hierarchy:&lt;/b&gt;&lt;/font&gt; A classification of relationships in which each item except the top one (known as the root) is a specialized form of the item above it. Each item can have one or more items below it in the hierarchy. In the Java(TM) class hierarchy, the root is the Object class.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;HotJava Browser:&lt;/b&gt;&lt;/font&gt; An easily customizable Web browser developed by Sun Microsystems, which is written in the Java(TM) programming language.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;HTML:&lt;/b&gt;&lt;/font&gt; HyperText Markup Language. This is a file format, based on SGML, for hypertext documents on the Internet. It is very simple and allows for the embedding of images, sounds, video streams, form fields and simple text formatting. References to other objects are embedded using URLs.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;HTTP:&lt;/b&gt;&lt;/font&gt; HyperText Transfer Protocol. The Internet protocol, based on TCP/IP, used to fetch hypertext objects from remote hosts. See also TCP/IP.
&lt;p&gt;

&lt;a name="I1"&gt;&lt;font color="red"&gt;&lt;b&gt;I&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;

&lt;font color="blue"&gt;&lt;b&gt;IDL:&lt;/b&gt;&lt;/font&gt; Interface Definition Language. APIs written in the Java(TM) programming language that provide standards-based interoperability and connectivity with CORBA (Common Object Request Broker Architecture).
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;identifier:&lt;/b&gt;&lt;/font&gt; The name of an item in a program written in the Java(TM) programming language.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;if:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used to conduct a conditional test and execute a block of statements if the test evaluates to true.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;implements:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword optionally included in the class declaration to specify any interfaces that are implemented by the current class.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;import:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used at the beginning of a source file that can specify classes or entire packages to be referred to later without including their package names in the reference.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;inheritance:&lt;/b&gt;&lt;/font&gt; The concept of classes automatically containing the variables and methods defined in their supertypes. See also superclass, subclass.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;instance:&lt;/b&gt;&lt;/font&gt; An object of a particular class. In programs written in the Java(TM) programming language, an instance of a class is created using the new operator followed by the class name.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;instance method:&lt;/b&gt;&lt;/font&gt; Any method that is invoked with respect to an instance of a class. Also called simply a method. See also class method.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;instance variable:&lt;/b&gt;&lt;/font&gt; Any item of data that is associated with a particular object. Each instance of a class has its own copy of the instance variables defined in the class. Also called a field. See also class variable.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;instanceof:&lt;/b&gt;&lt;/font&gt; A two-argument Java(TM) programming language keyword that tests whether the run-time type of its first argument is assignment compatible with its second argument.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;int:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used to define a variable of type integer.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;interface:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used to define a collection of method definitions and constant values. It can later be implemented by classes that define this interface with the "implements" keyword.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Internet:&lt;/b&gt;&lt;/font&gt; An enormous network consisting of literally millions of hosts from many organizations and countries around the world. It is physically put together from many smaller networks and data travels by a common set of protocols.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;IP:&lt;/b&gt;&lt;/font&gt; Internet Protocol. The basic protocol of the Internet. It enables the unreliable delivery of individual packets from one host to another. It makes no guarantees about whether or not the packet will be delivered, how long it will take, or if multiple packets will arrive in the order they were sent. Protocols built on top of this add the notions of connection and reliability. See also TCP/IP.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;interpreter:&lt;/b&gt;&lt;/font&gt; A module that alternately decodes and executes every statement in some body of code. The Java(TM) interpreter decodes and executes bytecode for the Java virtual machine*. See also compiler, runtime system.
&lt;p&gt;

&lt;a name="J1"&gt;&lt;font color="red"&gt;&lt;b&gt;J&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;

&lt;font color="blue"&gt;&lt;b&gt;JAE:&lt;/b&gt;&lt;/font&gt; Java Application Environment. The source code release of the Java Development Kit (JDK(TM)) software.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;JAR Files (.jar):&lt;/b&gt;&lt;/font&gt; Java ARchive. A file format used for aggregating many files into one.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;JAR file format:&lt;/b&gt;&lt;/font&gt; JAR (Java Archive) is a platform-independent file format that aggregates many files into one. Multiple applets written in the Java(TM) programming language, and their requisite components (.class files, images, sounds and other resource files) can be bundled in a JAR file and subsequently downloaded to a browser in a single HTTP transaction. It also supports file compression and digital signatures.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Java(TM):&lt;/b&gt;&lt;/font&gt; Sun's trademark for a set of technologies for creating and safely running software programs in both stand-alone and networked environments.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Java Application Environment (JAE):&lt;/b&gt;&lt;/font&gt; The source code release of the Java Development Kit (JDK(TM)) software.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;JavaBeans(TM):&lt;/b&gt;&lt;/font&gt; A portable, platform-independent reusable component model.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Java Blend(TM):&lt;/b&gt;&lt;/font&gt; A product that enables developers to simplify database application development by mapping database records to objects in the Java(TM) programming language (Java objects) and Java objects to databases.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Java Card(TM) API:&lt;/b&gt;&lt;/font&gt; An ISO 7816-4 compliant application environment focused on smart cards.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;JJavaCheck(TM):&lt;/b&gt;&lt;/font&gt; A tool for checking compliance of applications and applets to a specification.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;JavaChip(TM):&lt;/b&gt;&lt;/font&gt; Sun's processor, which executes bytecode for the Java(TM) virtual machine* natively. With a JavaChip processor, bytecode bypasses the virtual machine or just-in-time compiler stage to go directly to the processor.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Java(TM) Compatibility Kit (JCK):&lt;/b&gt;&lt;/font&gt; A test suite, a set of tools, and other requirements used to certify a Java platform implementation conformant both to the applicable Java platform specifications and to Java Software reference implementations.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;JDBC(Java Database Connectivity ):&lt;/b&gt;&lt;/font&gt; An industry standard for database-independent connectivity between the Java(TM) platform and a wide range of databases. The JDBC(TM) provides a call-level API for SQL-based database access.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Java Developer Connection:&lt;/b&gt;&lt;/font&gt; A service designed for individual developers, providing online training, product discounts, feature articles, bug information, and early access capabilities.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Java Development Kit (JDK):&lt;/b&gt;&lt;/font&gt; A software development environment for writing applets and applications in the Java programming language.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Java Electronic Commerce Framework:&lt;/b&gt;&lt;/font&gt; A structured architecture for the development of electronic commerce applications in the Java(TM) programming language.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Java Enterprise API:&lt;/b&gt;&lt;/font&gt; This API makes it easy to create large-scale commercial and database applications that can share multimedia data with other applications within an organization or across the Internet. Four APIs have been designed within the Java(TM) Enterprise API family.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Java Foundation Classes (JFC):&lt;/b&gt;&lt;/font&gt; An extension that adds graphical user interface class libraries to the Abstract Windowing Toolkit (AWT).
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Java Interface Definition Language (IDL):&lt;/b&gt;&lt;/font&gt; APIs written in the Java programming language that provide standards-based interoperability and connectivity with CORBA (Common Object Request Broker Architecture).
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Java Media APIs:&lt;/b&gt;&lt;/font&gt; A set of APIs that support the integration of audio and video clips, 2D fonts, graphics, and images as well as 3D models and telephony.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Java Media Framework:&lt;/b&gt;&lt;/font&gt; The core framework supports clocks for synchronizing between different media (e.g., audio and video output). The standard extension framework allows users to do full audio and video streaming.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;JNDI (Java Naming and Directory Interface):&lt;/b&gt;&lt;/font&gt; A set of APIs that assists with the interfacing to multiple naming and directory services.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;JavaOS:&lt;/b&gt;&lt;/font&gt; An Java(TM) technology-based operating system that is optimized to run on a variety of computing and consumer platforms. The JavaOS(TM) operating environment provides a runtime specifically tuned to run applications written in the Java programming language directly on hardware platforms without requiring a host operating system.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;JavaPlan:&lt;/b&gt;&lt;/font&gt; An object-oriented design and diagramming tool written in the Java(TM) programming language.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Java(TM) Platform:&lt;/b&gt;&lt;/font&gt; Consists of a language for writing programs ("the Java(TM) programming language"); a set of APIs, class libraries, and other programs used in developing, compiling, and error-checking programs; and a virtual machine which loads and executes the class files.
&lt;p&gt;
In addition, the Java platform is subject to a set of compatibility requirements to ensure consistent and compatible implementations. Implementations that meet the compatibility requirements may qualify for Sun's targeted compatibility brands.
&lt;p&gt;
The Java(TM) 2 platform is the current generation of the Java platform.
&lt;p&gt;
Java(TM) Platform Editions: A Java platform "edition" is a definitive and agreed-upon version of the Java platform that provides the functionality needed over a broad market segment.
&lt;p&gt;
An edition is comprised of two kinds of API sets: (i) "core packages," which are essential to all implementations of a given platform edition, and (ii) "optional packages," which are available for a given platform edition and which may be supported in a compatible implementation.
&lt;p&gt;
There are 3 distinct editions of the Java Platform:&lt;br /&gt;

-Java 2 Platform, Enterprise Edition:&lt;br /&gt;
The edition of the Java platform that is targeted at enterprises to enable development, deployment, and management of multi-tier server-centric applications.
&lt;p&gt;
-Java 2 Platform, Standard Edition:&lt;br /&gt;
The edition of the Java platform that enables development, deployment, and management of cross-platform, general-purpose applications.
&lt;p&gt;
-Java 2 Platform, Micro Edition:&lt;br /&gt;
The edition of the Java platform that is targeted at small, standalone or connectable consumer and embedded devices to enable development, deployment, and management of applications that can scale from smart cards through mobile devices and set-top boxes to conventional computing devices.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;RMI(Remote Method Invocation):&lt;/b&gt;&lt;/font&gt; A distributed object model for Java(TM) program to Java program, in which the methods of remote objects written in the Java programming language can be invoked from other Java virtual machines*, possibly on different hosts.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Java(TM) Runtime Environment (JRE):&lt;/b&gt;&lt;/font&gt; A subset of the Java Development Kit (JDK(TM)) for end-users and developers who want to redistribute the runtime environment alone. The Java runtime environment consists of the Java virtual machine, the Java core classes, and supporting files.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;JavaSafe:&lt;/b&gt;&lt;/font&gt; A tool for tracking and managing source file changes, written in the Java(TM) programming language.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;JavaScript:&lt;/b&gt;&lt;/font&gt; A Web scripting language that is used in both browsers and Web servers. Like all scripting languages, it is used primarily to tie other components together or to accept user input.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Java Studio:&lt;/b&gt;&lt;/font&gt; The first program that allows you to easily create Java(TM) technology-based applications and applets without having to know the Java programming language.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Java(TM) Technologies:&lt;/b&gt;&lt;/font&gt; A set of technologies that enable the creation and safe running of software programs in both stand-alone and networked environments.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Java virtual machine (JVM):&lt;/b&gt;&lt;/font&gt; Sun's specification for or implementation of a software "execution engine" that safely and compatibly executes the byte codes in Java class files on a microprocessor (whether in a computer or in another electronic device).
&lt;p&gt;
-Java HotSpot(TM) performance engine - Sun's ultra-high-performance engine for implementing the Java runtime environment which features an adaptive compiler that dynamically optimizes the performance of running applications.
&lt;p&gt;
-KJava(TM) virtual machine - Sun's small-footprint, highly optimized foundation of a runtime environment within the Java 2 Platform, Micro Edition. Derived from the Java virtual machine, it is targeted at small connected devices and can scale from 30KB to approximately 128KB, depending on the target device's functionality.
&lt;p&gt;
-Java Card(TM) virtual machine - Sun's ultra-small-footprint, highly-optimized foundation of a runtime environment within the Java 2 Platform, Micro Edition. Derived from the Java virtual machine, it is targeted at smart cards and other severely memory-constrained devices and can run in devices with memory as small as 24K of ROM, 16K of EEPROM, and 512 bytes of RAM.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Java Web Server:&lt;/b&gt;&lt;/font&gt; The easy-to-use, extensible, easy-to-administer, secure, platform-independent solution to speed and simplify the deployment and management of your Internet and Intranet Web sites. It provides immediate productivity for robust, full-featured, Java technology-based server applications.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Java Workshop:&lt;/b&gt;&lt;/font&gt; A complete set of tools integrated into a single environment for managing programming with Java technology. The Java Workshop software uses a highly modular structure that enables you to easily plug new tools into the overall structure.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Java wallet:&lt;/b&gt;&lt;/font&gt; A user interface, built on the Java(TM) Electronic Commerce Framework, which allows for online purchases, value transfers, and administrative functions.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;JavaSpaces:&lt;/b&gt;&lt;/font&gt; A technology that provides distributed persistence and data exchange mechanisms for code in the Java(TM) programming language.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;JavaSoft:&lt;/b&gt;&lt;/font&gt; A former business unit of Sun Microsystems, Inc., currently known as Sun Microsystems, Inc., Java Software division.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;JDBC:&lt;/b&gt;&lt;/font&gt; Java Database Connectivity. An industry standard for database-independent connectivity between the Java platform and a wide range of databases. The JDBC interface provides a call-level API for SQL-based database access.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;JDK:&lt;/b&gt;&lt;/font&gt; Java Development Kit software. A software development environment for writing applets and application in the Java programming language.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;JFC:&lt;/b&gt;&lt;/font&gt; Java Foundation Class. An extension that adds graphical user interface class libraries to the Abstract Windowing Toolkit (AWT).
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Jini Technology:&lt;/b&gt;&lt;/font&gt; Sun's Jini technology includes a set of APIs that may be incorporated an optional package for any Java 2 platform edition. This set of APIs enables transparent networking of devices and services and eliminates the need for system or network administration intervention by a user.
The Jini technology is currently an optional package available on all Java 2 platform editions.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;JMAPI:&lt;/b&gt;&lt;/font&gt; Java(TM) Management API. A collection of Java programming language classes and interfaces that allow developers to build system, network, and service management applications.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;JNDI:&lt;/b&gt;&lt;/font&gt; Java Naming and Directory Interface(TM). A set of APIs that assist with the interfacing to multiple naming and directory services.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;JPEG:&lt;/b&gt;&lt;/font&gt; Joint Photographic Experts Group. An image file compression standard established by this group. It achieves tremendous compression at the cost of introducing distortions into the image which are almost always imperceptible.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;JRE:&lt;/b&gt;&lt;/font&gt; Java(TM) runtime environment. A subset of the Java Developer Kit for end-users and developers who want to redistribute the runtime environment. The Java runtime environment consists of the Java virtual machine, the Java core classes, and supporting files.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Just-in-time (JIT) Compiler:&lt;/b&gt;&lt;/font&gt; A compiler that converts all of the bytecode into native machine code just as a Java(TM) program is run. This results in run-time speed improvements over code that is interpreted by a Java virtual machine.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;JVM:&lt;/b&gt;&lt;/font&gt; Java(TM) Virtual Machine. The part of the Java Runtime Environment responsible for interpreting bytecodes.
&lt;p&gt;

&lt;a name="K1"&gt;&lt;font color="red"&gt;&lt;b&gt;K&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;

&lt;font color="blue"&gt;&lt;b&gt;keyword:&lt;/b&gt;&lt;/font&gt; The Java(TM) programming language sets aside words as keywords - these words are reserved by the language itself and therefore are not available as names for variables or methods.
&lt;p&gt;

&lt;a name="L1"&gt;&lt;font color="red"&gt;&lt;b&gt;L&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;

&lt;font color="blue"&gt;&lt;b&gt;lexical:&lt;/b&gt;&lt;/font&gt; Pertaining to how the characters in source code are translated into tokens that the compiler can understand.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;linker:&lt;/b&gt;&lt;/font&gt; A module that builds an executable, complete program from component machine code modules. The Java(TM) linker creates a runnable program from compiled classes. See also compiler, interpreter, runtime system.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;literal:&lt;/b&gt;&lt;/font&gt; The basic representation of any integer, floating point, or character value. For example, 3.0 is a double-precision floating point literal, and "a" is a character literal.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;local variable:&lt;/b&gt;&lt;/font&gt; A data item known within a block, but inaccessible to code outside the block. For example, any variable defined within a method is a local variable and can't be used outside the method.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;long:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used to define a variable of type long.
&lt;p&gt;

&lt;a name="M1"&gt;&lt;font color="red"&gt;&lt;b&gt;M&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;

&lt;font color="blue"&gt;&lt;b&gt;member:&lt;/b&gt;&lt;/font&gt; A field or method of a class. Unless specified otherwise, a member is not static.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;method:&lt;/b&gt;&lt;/font&gt; A function defined in a class. See also instance method, class method. Unless specified otherwise, a method is not static.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Mosaic:&lt;/b&gt;&lt;/font&gt; A program that provides a simple GUI that enables easy access to the data stored on the Internet. These data may be simple files or hypertext documents. Mosaic was written by a team at NCSA.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;multithreaded:&lt;/b&gt;&lt;/font&gt; Describes a program that is designed to have parts of its code execute concurrently. See also thread.
&lt;p&gt;

&lt;a name="N1"&gt;&lt;font color="red"&gt;&lt;b&gt;N&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;

&lt;font color="blue"&gt;&lt;b&gt;native:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword that is used in method declarations to specify that the method is not implemented in the same Java source file, but rather in another language.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;NCSA:&lt;/b&gt;&lt;/font&gt; National Center for Supercomputer Applications. See also Mosaic.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;new:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used to create an instance of a class.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;null:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used to specify an undefined value for reference variables.
&lt;p&gt;

&lt;a name="O1"&gt;&lt;font color="red"&gt;&lt;b&gt;O&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;

&lt;font color="blue"&gt;&lt;b&gt;object:&lt;/b&gt;&lt;/font&gt; The principal building blocks of object-oriented programs. Each object is a programming unit consisting of data (instance variables) and functionality (instance methods). See also class.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;object-oriented design:&lt;/b&gt;&lt;/font&gt; A software design method that models the characteristics of abstract or real objects using classes and objects.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;octal:&lt;/b&gt;&lt;/font&gt; The numbering system using 8 as its base, using the numerals 0-7 as its digits. In programs written in the Java(TM) programming language, octal numbers must be preceded with 0. See also hexadecimal.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Optional Packages:&lt;/b&gt;&lt;/font&gt; The set or sets of APIs in a Java platform edition which are available with and may be supported in a compatible implementation.

Over time, optional packages may become required in an edition as the marketplace requires them.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;overloading:&lt;/b&gt;&lt;/font&gt; Using one identifier to refer to multiple items in the same scope. In the Java(TM) programming language, you can overload methods but not variables or operators.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;overriding:&lt;/b&gt;&lt;/font&gt; Providing a different implementation of a method in a subclass of the class that originally defined the method.
&lt;p&gt;

&lt;a name="P1"&gt;&lt;font color="red"&gt;&lt;b&gt;P&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;

&lt;font color="blue"&gt;&lt;b&gt;package:&lt;/b&gt;&lt;/font&gt; A group of types. Packages are declared with the package keyword.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;peer:&lt;/b&gt;&lt;/font&gt; In networking, any functional unit in the same layer as another entity.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;PersonalJava:&lt;/b&gt;&lt;/font&gt; A Java runtime environment for network-connectable applications on personal consumer devices for home, office, and mobile use.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;pixel:&lt;/b&gt;&lt;/font&gt; The smallest addressable picture element on a display screen or printed page.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;POSIX:&lt;/b&gt;&lt;/font&gt; Portable Operating System for UNIX(TM). A standard that defines the language interface between the UNIX operating system and application programs through a minimal set of supported functions.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;private:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used in a method or variable declaration. It signifies that the method or variable can only be accessed by other elements of its class.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;process:&lt;/b&gt;&lt;/font&gt; A virtual address space containing one or more threads.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;property:&lt;/b&gt;&lt;/font&gt; Characteristics of an object that users can set, such as the color of a window.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Profiles:&lt;/b&gt;&lt;/font&gt; A Profile is a collection of Java APIs that complements one or more Java 2 Platform Editions by adding domain-specific capabilities. Profiles may also include other defined Profiles. A profile implementation requires a Java 2 Platform Edition to create a complete development and deployment environment in a targeted vertical market. Each profile is subject to an associated set of compatibility requirements.
Profiles may be usable on one or more editions.

Some examples of profiles within the Java 2 Platform, Micro Edition are:&lt;br /&gt;
&lt;p&gt;
-PersonalJava - for non-PC products that need to display web-compatible Java-based content
&lt;p&gt;
-Java Card - for secure smart cards and other severely memory-constrained devices.
&lt;p&gt;
protected: A Java(TM) programming language keyword used in a method or variable declaration. It signifies that the method or variable can only be accessed by elements residing in its class, subclasses, or classes in the same package.
&lt;p&gt;
public: A Java(TM) programming language keyword used in a method or variable declaration. It signifies that the method or variable can be accessed by elements residing in other classes.
&lt;p&gt;

&lt;a name="Q1"&gt;&lt;font color="red"&gt;&lt;b&gt;Q&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;


&lt;a name="R1"&gt;&lt;font color="red"&gt;&lt;b&gt;R&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;RMI(Remote Method Invocation):&lt;/b&gt;&lt;/font&gt; A distributed object model for Java(TM) program to Java program, in which the methods of remote objects written in the Java programming language can be invoked from other Java virtual machines, possibly on different hosts.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;raster:&lt;/b&gt;&lt;/font&gt; A line of pixels.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;reference:&lt;/b&gt;&lt;/font&gt; A data element whose value is an address.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;return:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used to finish the execution of a method. It can be followed by a value required by the method definition.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;RFE:&lt;/b&gt;&lt;/font&gt; Request for Enhancement.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;root:&lt;/b&gt;&lt;/font&gt; In a hierarchy of items, the one item from which all other items are descended. The root item has nothing above it in the hierarchy. See also hierarchy, class, package.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;RPC:&lt;/b&gt;&lt;/font&gt; Remote Procedure Call. Executing what looks like a normal procedure call (or method invocation) by sending network packets to some remote host.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;runtime system:&lt;/b&gt;&lt;/font&gt; The software environment in which programs compiled for the Java(TM) virtual machine can run. The runtime system includes all the code necessary to load programs written in the Java programming language, dynamically link native methods, manage memory, handle exceptions, and an implementation of the Java virtual machine, which may be a Java interpreter.
&lt;p&gt;

&lt;a name="S1"&gt;&lt;font color="red"&gt;&lt;b&gt;S&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;

&lt;font color="blue"&gt;&lt;b&gt;Sandbox:&lt;/b&gt;&lt;/font&gt; Comprises a number of cooperating system components, ranging from security managers that execute as part of the application, to security measures designed into the Java(TM) virtual machine and the language itself. The sandbox ensures that an untrusted, and possibly malicious, application cannot gain access to system resources.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;scope:&lt;/b&gt;&lt;/font&gt; A characteristic of an identifier that determines where the identifier can be used. Most identifiers in the Java(TM) programming environment have either class or local scope. Instance and class variables and methods have class scope; they can be used outside the class and its subclasses only by prefixing them with an instance of the class or (for class variables and methods) with the class name. All other variables are declared within methods and have local scope; they can be used only within the enclosing block.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Secure Socket Layer (SSL):&lt;/b&gt;&lt;/font&gt; A protocol that allows communication between a Web browser and a server to be encrypted for privacy.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;servlet:&lt;/b&gt;&lt;/font&gt; A server-side program that gives Java(TM) technology-enabled servers additional functionality.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;short:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used to define a variable of type short.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;single precision:&lt;/b&gt;&lt;/font&gt; In the Java(TM) language specification, describes a floating point number with 32 bits of data. See also double precision.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;SGML:&lt;/b&gt;&lt;/font&gt; Standardized Generalized Markup Language. An ISO/ANSI/ECMA standard that specifies a way to annotate text documents with information about types of sections of a document.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;static:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used to define a variable as a class variable. Classes maintain one copy of class variables regardless of how many instances exist of that class. "static" can also be used to define a method as a class method. Class methods are invoked by the class instead of a specific instance, and can only operate on class variables.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;static field:&lt;/b&gt;&lt;/font&gt; Another name for class variable.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;static method:&lt;/b&gt;&lt;/font&gt; Another name for class method.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;subarray:&lt;/b&gt;&lt;/font&gt; An array that is inside another array.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;subclass:&lt;/b&gt;&lt;/font&gt; A class that is derived from a particular class, perhaps with one or more classes in between. See also superclass, supertype.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;subtype:&lt;/b&gt;&lt;/font&gt; If type X extends or implements type Y, then X is a subtype of Y. See also supertype.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;superclass:&lt;/b&gt;&lt;/font&gt; A class from which a particular class is derived, perhaps with one or more classes in between. See also subclass, subtype.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;super:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used to access members of a class inherited by the class in which it appears.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;supertype:&lt;/b&gt;&lt;/font&gt; The supertypes of a type are all the interfaces and classes that are extended or implemented by that type. See also subtype, superclass.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;switch:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used to evaluate a variable that can later be matched with a value specified by the "case" keyword in order to execute a group of statements.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Swing Set:&lt;/b&gt;&lt;/font&gt; The code name for a collection of graphical user interface (GUI) components that runs uniformly on any native platform which supports the Java(TM) virtual machine. Because they are written entirely in the Java programming language, these components may provide functionality above and beyond that provided by native-platform equivalents. (Contrast with AWT.)
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;synchronized:&lt;/b&gt;&lt;/font&gt; A keyword in the Java programming language that, when applied to a method or code block, guarantees that at most one thread at a time executes that code.
&lt;p&gt;

&lt;a name="T1"&gt;&lt;font color="red"&gt;&lt;b&gt;T&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;

&lt;font color="blue"&gt;&lt;b&gt;TCP/IP:&lt;/b&gt;&lt;/font&gt; Transmission Control Protocol based on IP. This is an Internet protocol that provides for the reliable delivery of streams of data from one host to another. See also IP.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Technology Compatibility Kit (TCK):&lt;/b&gt;&lt;/font&gt; A test suite, a set of tools, and other requirements used to certify an implementation of a particular Sun technology conformant both to the applicable specifications and to Sun or Sun-designated reference implementations.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Thin Client:&lt;/b&gt;&lt;/font&gt; A system that runs a very light operating system with no local system administration and executes applications delivered over the network.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;this:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword that can be used to represent an instance of the class in which it appears. "this" can be used to access class variables and methods.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;thread:&lt;/b&gt;&lt;/font&gt; The basic unit of program execution. A process can have several threads running concurrently, each performing a different job, such as waiting for events or performing a time-consuming job that the program doesn't need to complete before going on. When a thread has finished its job, the thread is suspended or destroyed. See also process.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;throw:&lt;/b&gt;&lt;/font&gt; A Java programming language keyword that allows the user to throw an exception or any class that implements the "throwable" interface.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;throws:&lt;/b&gt;&lt;/font&gt; A Java programming language keyword used in method declarations that specify which exceptions are not handled within the method but rather passed to the next higher level of the program.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;transient:&lt;/b&gt;&lt;/font&gt; A keyword in the Java programming language that indicates that a field is not part of the serialized form of an object. When an object is serialized, the values of its transient fields are not included in the serial representation, while the values of its non-transient fields are included.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;try:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword that defines a block of statements that may throw a Java language exception. If an exception is thrown, an optional "catch" block can handle specific exceptions thrown within the "try" block. Also, an optional "finally" block will be executed regardless of whether an exception is thrown or not.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;type:&lt;/b&gt;&lt;/font&gt; A class or interface.
&lt;p&gt;

&lt;a name="U1"&gt;&lt;font color="red"&gt;&lt;b&gt;U&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;

&lt;font color="blue"&gt;&lt;b&gt;Unicode:&lt;/b&gt;&lt;/font&gt; A 16-bit character set defined by ISO 10646. See also ASCII. All source code in the Java(TM) programming environment is written in Unicode.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;URL:&lt;/b&gt;&lt;/font&gt; Uniform Resource Locator. A standard for writing a text reference to an arbitrary piece of data in the WWW. A URL looks like "protocol://host/localinfo" where protocol specifies a protocol to use to fetch the object (like HTTP or FTP), host specifies the Internet name of the host on which to find it, and localinfo is a string (often a file name) passed to the protocol handler on the remote host.
&lt;p&gt;

&lt;a name="V1"&gt;&lt;font color="red"&gt;&lt;b&gt;V&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;

&lt;font color="blue"&gt;&lt;b&gt;variable:&lt;/b&gt;&lt;/font&gt; An item of data named by an identifier. Each variable has a type, such as int or Object, and a scope. See also class variable, instance variable, local variable.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;virtual machine:&lt;/b&gt;&lt;/font&gt; An abstract specification for a computing device that can be implemented in different ways, in software or hardware. You compile to the instruction set of a virtual machine much like you'd compile to the instruction set of a microprocessor. The Java(TM) virtual machine consists of a bytecode instruction set, a set of registers, a stack, a garbage-collected heap, and an area for storing methods.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;void:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used in method declarations to specify that the method does not return any value. "void" can also be used as a nonfunctional statement.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;volatile:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used in variable declarations that specifies that the variable is modified asynchronously by concurrently running threads.
&lt;p&gt;

&lt;a name="W1"&gt;&lt;font color="red"&gt;&lt;b&gt;W&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;

&lt;font color="blue"&gt;&lt;b&gt;wait:&lt;/b&gt;&lt;/font&gt; A UNIX command which will wait for all background processes to complete, and report their termination status.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;while:&lt;/b&gt;&lt;/font&gt; A Java(TM) programming language keyword used to declare a loop that iterates a block of statements. The loop`s exit condition is specified as part of the while statement.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;world readable files:&lt;/b&gt;&lt;/font&gt; Files on a file system that can be viewed (read) by any user. For example: files residing on web servers can only be viewed by Internet users if their permissions have been set to world readable.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;wrapper:&lt;/b&gt;&lt;/font&gt; An object that encapsulates and delegates to another object to alter its interface or behavior in some way.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;WWW:&lt;/b&gt;&lt;/font&gt; World Wide Web. The web of systems and the data in them that is the Internet. See also Internet.
&lt;p&gt;
&lt;a name="X1"&gt;&lt;font color="red"&gt;&lt;b&gt;X&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;

&lt;a name="Y1"&gt;&lt;font color="red"&gt;&lt;b&gt;Y&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;

&lt;a name="Z1"&gt;&lt;font color="red"&gt;&lt;b&gt;Z&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
google_ad_client = "pub-5347178153387462";
/* 728x90, created 12/25/08 */
google_ad_slot = "5097582257";
google_ad_width = 728;
google_ad_height = 90;
//--&gt;
&lt;/script&gt;
&lt;script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
&lt;hr&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7844341291913287808-5533684166890472569?l=javasansar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/5533684166890472569/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7844341291913287808&amp;postID=5533684166890472569' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/5533684166890472569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/5533684166890472569'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/2009/01/java-glossary-of-terms.html' title='Java Glossary of Terms'/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08436281743629996970'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7844341291913287808.post-4526003583479840437</id><published>2009-01-06T22:39:00.008-05:00</published><updated>2009-02-03T22:33:56.122-05:00</updated><title type='text'>Testing Technique</title><content type='html'>&lt;hr color="silver" width="100%"&gt;
&lt;p&gt;
&lt;table border="0" cellpadding="2" cellspacing="2"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href = "#tt1"&gt;&lt;font face="Comic Sans MS"&gt;&lt;b&gt;&amp;#8226; What is Functional Testing? &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;
&lt;a href = "#tt2"&gt;&lt;font face="Comic Sans MS"&gt;&lt;b&gt;&amp;#8226; What is Structural Testing? &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;
&lt;a href ="#tt3"&gt;&lt;font face="Comic Sans MS"&gt;&lt;b&gt;&amp;#8226; What is Error-Oriented Testing? &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;
&lt;a href ="#tt4"&gt;&lt;font face="Comic Sans MS"&gt;&lt;b&gt;&amp;#8226; What is Hybrid Approaches Testing? &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;
&lt;a href = "#tt5"&gt;&lt;font face="Comic Sans MS"&gt;&lt;b&gt;&amp;#8226; What is Integration Strategies Testing? &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;
&lt;a href = "#tt6"&gt;&lt;font face="Comic Sans MS"&gt;&lt;b&gt;&amp;#8226; What is Transaction Flow Testing? &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;
&lt;a href = "#tt7"&gt;&lt;font face="Comic Sans MS"&gt;&lt;b&gt;&amp;#8226; What is Stress Testing? &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;
&lt;a href = "#tt8"&gt;&lt;font face="Comic Sans MS"&gt;&lt;b&gt;&amp;#8226; What is Failure Analysis? &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;
&lt;a href = "#tt9"&gt;&lt;font face="Comic Sans MS"&gt;&lt;b&gt;&amp;#8226; What is Concurrency Analysis? &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;p&gt;
&lt;a href ="#tt10"&gt;&lt;font face="Comic Sans MS"&gt;&lt;b&gt;&amp;#8226; What is Performance Analysis? &lt;/b&gt;&lt;/font&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;
&lt;a name = "tt1"&gt;&lt;b&gt;&lt;font color="blue"&gt;Functional Testing Technique: &lt;/font&gt;&lt;/b&gt;&lt;/a&gt;
&lt;p&gt;
Functional Testing generates test data based on the requirement document specifying the behavior of the software. The major objective of the functional testing technique is to verify the behavior of the software over some subset of its input and measure the quality of the function (business) component of the system. Functional testing is the beginning phase for any software test team during any given release. Functional testing is a powerful testing technique which reduces significant number of defects in the application. Functional test cases are derived from functional requirements of the software that are the basis for system testing
&lt;p&gt;
Functional testing is sometime also refers to as GUI Testing or Black Box testing which require no knowledge of code or inner design. It is a concrete box or functional testing that checks the output of a program, given certain inputs, conforms to the functional specification of the software programs.&lt;br&gt;
Functional Test can be designed as follows:
&lt;ul&gt;
&lt;li&gt;Specify Functional Test Cases: &lt;br /&gt;
Based on the requirement document, functional test cases are designed in a systematic and organized ways. Most of the companies adapt tools to manage their documents. There are vendor's management tools as well as open sources. Test Director/Quality Center from Mercury HP is one of the very popular tools. A group or test suite is necessary to organize test cases/scripts. A main folder is designed and named after usually a release month i.e. JanM09. &lt;br&gt;
A sub folder is designed to reflect whole project under the main folder and initiated its name after the project name i.e. '1000.ABC Online Transaction'. Any new or existing tests can be stored and retrieved easily in a manageable way. &lt;/li&gt;


&lt;li&gt;Creating Functional Test Cases: &lt;br /&gt; 
As mentioned above, we need to select the suite to generate new test cases. Two major aspects of generating test cases are a. Details of the test case and b. Design Steps of the test case. 
&lt;ol&gt;
&lt;li&gt; Details &lt;/li&gt;
&lt;li&gt; Design Steps &lt;/li&gt;
&lt;/ol&gt;
Details include following significant fields: &lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Test Name &lt;/li&gt;
&lt;li&gt;Test Status &lt;/li&gt;
&lt;li&gt;Test Plan Priority:&lt;/li&gt;
&lt;li&gt;Project: &lt;/li&gt;
&lt;li&gt;Program: &lt;/li&gt;
&lt;li&gt;Release: &lt;/li&gt;
&lt;li&gt;Test Designer: &lt;/li&gt;
&lt;li&gt;Application: &lt;/li&gt;
&lt;li&gt;Test Creation Date: &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Design Steps include the following fields: &lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Steps Name:&lt;/li&gt;
&lt;li&gt;Steps Description: &lt;/li&gt;
&lt;li&gt;Expected Result:&lt;/li&gt;
&lt;li&gt;Program:&lt;/li&gt;
&lt;/ol&gt;

&lt;/li&gt;

&lt;li&gt;Executing Functional Test Cases: &lt;br /&gt;
Upon completion of the test case design or planning, next phase of the testing is the execution of the test cases or scripts against AUT. Execution module needs to be selected to execute test cases. Test case can be run manually as well as by using automation. When we begin running manual test case, we need to concentrate mainly on the following modules :
&lt;ol&gt;
&lt;li&gt;Select first Steps Name &lt;/li&gt;
&lt;li&gt;Read the description &lt;/li&gt;
&lt;li&gt;Read the Expected Results &lt;/li&gt;
&lt;li&gt;Invoke AUT and start executing test case &lt;/li&gt;
&lt;li&gt;When execution is finished, change the status to passed/Failed  &lt;/li&gt;
&lt;li&gt;Insert the result of execution into Actual Result box &lt;/li&gt;
&lt;li&gt;End the Test Run &lt;/li&gt;
&lt;/ol&gt;
Follow all the steps mentioned above for each of the steps of the test case
&lt;/li&gt;

&lt;p&gt;
&lt;li&gt;Verify Functional Test Results: &lt;br /&gt;
After test case Execution, we can view/verify execution results to track the test run. We can check details of the execution results such as the execution date, attachments, Configuration, Status, History of execution etc. This will help manage projects, and all the documentation in an efficient way. 
&lt;/li&gt;

&lt;li&gt;Reporting &amp; Tracking Defect: &lt;br&gt;
When we come across any issue or defect during the execution of the test, another de facto technique is to record, report, and track the issue. Here is how we can track defects by using tools. Report module needs to be selected to report issue. Following fields need to be filled with the adequate informations: &lt;br&gt;
&lt;ol&gt;
&lt;li&gt;Summary: (a brief one liner explaining about a defect) &lt;/li&gt;
&lt;li&gt;Application Name:  &lt;/li&gt;
&lt;li&gt;Defect Priority:  &lt;/li&gt;
&lt;li&gt;Detected By: &lt;/li&gt;
&lt;li&gt;Detected Date: &lt;/li&gt;
&lt;li&gt;Bug Status: &lt;/li&gt;
&lt;li&gt;Release: &lt;/li&gt;
&lt;li&gt;Assigned To: &lt;/li&gt;
&lt;li&gt;Cause of Defect: &lt;/li&gt;
&lt;li&gt;Reproducible: &lt;/li&gt;
&lt;li&gt;Description: &lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;
Functional Testing includes the following testing types&lt;br&gt;
&lt;ol&gt;
&lt;li&gt;Positive Testing &lt;/li&gt;
&lt;li&gt;Negative Testing &lt;/li&gt;
&lt;li&gt;Validation Testing &lt;/li&gt;
&lt;li&gt;Back-End Testing &lt;/li&gt;
&lt;li&gt;Security Testing &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Functional Testing Tools include: 
&lt;ol&gt;
&lt;li&gt;Win Runner &lt;/li&gt;
&lt;li&gt;Quick Test Pro&lt;/li&gt;
&lt;li&gt;Test Director/Quality Center&lt;/li&gt;
&lt;/ol&gt;

 
&lt;p&gt;
&lt;a name= "tt2"&gt;&lt;b&gt;&lt;font color="blue"&gt; Structural Testing Technique: &lt;/font&gt;&lt;/b&gt;&lt;/a&gt;
&lt;p&gt;
Structural Testing is conducted at source code level where test data is developed based on the implementation of the product. Structural Testing technique includes 'data flow anomaly detection', 'data flow coverage assessment', and 'various level of path'. Structural Testing is applicable to Unit Testing, Integration Testing and Regression Testing. At the System Testing level, Structural Testing is not applicable due to the large size of the system to be tested. But at the module testing and integration testing, all of the structural Testing techniques are possible. So in another word, Structure Testing is also referred to as White Box testing or Clear Box testing as inner code knowledge is required to conduct this kind of testing.
&lt;p&gt;
Unit Test includes smallest code possible such as procedures, subroutine, class, method, database etc. Structural Testing technique ensures that software's statements, decisions and logics are entirely exercised by executing codes. Loop constructs are behaving as expected as per the data boundaries. 'Dead Code' is also checked at unit test level as dead code refer to as code that can not be reached for execution by any means of code paths.
&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
indeed_jobroll_format = "728x90";
indeed_jobroll_publisher = "4159526527794233";
indeed_jobroll_keywords = "qa jobs";
indeed_jobroll_location = "";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="http://jobroll.indeed.com/ads/jobroll2.js"&gt;
&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://www.indeed.com/"&gt;Jobs&lt;/a&gt; by Indeed&lt;/noscript&gt;

&lt;p&gt;
&lt;a name= "tt3"&gt; &lt;b&gt;&lt;font color="blue"&gt;Error-Oriented Testing Technique: &lt;/font&gt;&lt;/b&gt;&lt;/a&gt;
&lt;p&gt;
Error-Oriented Testing emphasizes on presence or absence of the error in the software programming process. Error-Oriented Testing Technique is applicable to all level of testing such as module, unit, regression, functional testing etc.  Error-Oriented Testing Technique uses error-tolerance &lt;br /&gt;
&lt;pre&gt; Error-based testing:&lt;/pre&gt;&lt;br /&gt;
 Error-based testing is done to ensure that certain errors have not been committed in the software process. This test begins with programming process, identifies potential errors in that process and asks how those errors are reflected as faults. It then tries to show the absence of that error. &lt;br /&gt;
&lt;pre&gt;Fault-based testing:&lt;/pre&gt;&lt;br /&gt;
Fault-based Testing emphasizes that certain prescribed faults are not included in the code. It has two terms local extent and global extent. Local extent describes that the fault has local effect on computation. Global extent tells that a fault will cause software program failure.&lt;br /&gt;
&lt;pre&gt; Probable Correctness: &lt;/pre&gt;&lt;br /&gt;
Probable Correctness is a probability that no fault exists in a tested program (By Hamlet). Each successful execution ensures that implemented function is correct. &lt;br /&gt;

&lt;p&gt; 
&lt;a name= "tt4"&gt; &lt;b&gt;&lt;font color="blue"&gt;Hybrid Approaches: &lt;/font&gt;&lt;/b&gt;&lt;/a&gt;
&lt;p&gt;
No single testing technique is enough. Hence the idea of having Hybrid Approaches have been developed combining several techniques together. Combination of functional, structural, and error-oriented techniques has been used for Hybrid Approaches incorporating best features of different methods into one new technique. Test data are selected to ensure simultaneous coverage of specification and code. An operational specification language has been designed that enables a structural measure of coverage of the specification
&lt;p&gt; 
&lt;a name= "tt5"&gt;&lt;b&gt;&lt;font color="blue"&gt; Integration Strategies: &lt;/font&gt;&lt;/b&gt;&lt;/a&gt;
&lt;p&gt;
All the individual components or modules are developed and tested and they are put together to build an application or portion of an application. We conduct testing on these components to check the functionalities of the application are working and no issues are encountered due to the integration of the modules. Test cases are design to meet this purpose that interfaces between modules are working. Usually there are three basic types of integration testing: &lt;br&gt;Top to Bottom Testing&lt;br&gt;Bottom Up Testing&lt;br&gt;Sandwich Testing.
&lt;p&gt;
&lt;b&gt;Following errors are targeted by Integration approaches: &lt;/b&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;&lt;font color="red"&gt;Range Errors: &lt;/font&gt; When the source of input falls out of range of their destination import/export range error is found. Careful boundary value testing will resolve this error.
&lt;/li&gt;
&lt;li&gt;&lt;font color="red"&gt; Type Compatibility Errors: &lt;/font&gt; User defined mismatches type will create this kind of errors. And error are detected while compiling the source code.
&lt;/li&gt;
&lt;li&gt;&lt;font color="red"&gt; Representation Error: &lt;/font&gt;When the parameters are the same type and meaning is different, we encounter this kind of error. For example, comp. A passes a Time Elapse of type real to comp. B. Comp A is assuming it is passing time in seconds, and Comp. B is assuming time has been passed in milliseconds. Hence, it creates Representation Errors.
&lt;/li&gt;
&lt;li&gt;&lt;font color="red"&gt; Parameter utilization errors: &lt;/font&gt; Some times parameters used can be corrupted due to alteration of information while the module is called. Careful testing can prevent this while compiling source code.
&lt;/li&gt;
&lt;li&gt;&lt;font color="red"&gt; Domain/computation error: &lt;/font&gt; Domain/computation errors are encountered during module testing when specific input values follows the wrong path because of the control flow faults.
&lt;/li&gt;

&lt;/ol&gt;


&lt;p&gt;
&lt;a name= "tt6"&gt;&lt;b&gt;&lt;font color="blue"&gt; Transaction Flow Technique: &lt;/font&gt;&lt;/b&gt;&lt;/a&gt;
&lt;p&gt;
Sequence of tasks is executed in the Transaction flow techniques. Such as, let us take an example of a printing task. Here, first sequence would be checking if a file exists and second would be to check if file permission is readable and so on. It is more like sequence of steps of interaction between users and systems. Very nasty bugs can be detected early at this Transition flow testing.
&lt;p&gt;
The following steps are taken to conduct Transaction Flow Test Technique: &lt;br /&gt;

&lt;ol&gt;
&lt;li&gt;Indentifying the transactions points, such as drawing data flow diagram &lt;/li&gt;&lt;br /&gt;
&lt;li&gt; Test link/decision in the transaction flow&lt;/li&gt;&lt;br /&gt;
&lt;li&gt;Test all the single, double loop in the transaction &lt;/li&gt;&lt;br /&gt;
&lt;li&gt;Test all the paths within the transaction flow &lt;/li&gt;&lt;br /&gt;
&lt;li&gt;Test that system behavior is normal &lt;/li&gt;&lt;br /&gt;
&lt;/ol&gt;
&lt;p&gt;
Transaction Flow Technique is very effective methods identifying defects at the early stage of software development.  



&lt;p&gt;
&lt;a name="tt7"&gt; &lt;b&gt;&lt;font color="blue"&gt;Stress Testing&lt;/font&gt;&lt;/b&gt;&lt;/a&gt;&lt;br&gt;
&lt;p&gt;
All of the works and hours spent on building software can go waste if the product is not tested properly. Stress testing technique is one of the significant methods to crack down the remaining bottleneck of the software product. The purpose of stress testing is to find potential errors that might harm the software program. Based on the requirement, system is put under pressure beyond its limit and resources and verifies if system can handle the extreme pressure. An example would be logging 100 simultaneously users and monitoring if system can handle it without crashing. It simply attempts to break the software. 
&lt;p&gt;
Stress testing technique emphasizes on the following errors type :&lt;br /&gt;
Potential race condition, Faults processing sequences, Errors in thresh hold and control statement, and Resource contention. Tester will identify those resources first that can be stress tested. Then, test cases are designed and executed. Usually Stress Test is done at the end of the software development. But it is good idea if it can be performed during system testing to identify bottlenecks that might prevent the application to satisfy its specification.

&lt;p&gt;
&lt;a name= "tt8"&gt;&lt;b&gt;&lt;font color="blue"&gt; Failure Analysis &lt;/font&gt;&lt;/b&gt;&lt;/a&gt;&lt;br&gt;
&lt;p&gt;
Failure analysis/root cause analysis is one of the significant techniques that attempts to collect and analyze data to indentify the cause of the failures and prevent it from happening in future. Failure Analysis is conducted during validation and verification of the development process. This is required during requirement verification as well. It is also essential to identify product recovery errors which can lead to lost data or files.
&lt;p&gt;
&lt;a name= "tt9"&gt; &lt;b&gt;&lt;font color="blue"&gt;Concurrency Analysis&lt;/font&gt;&lt;/b&gt;&lt;/a&gt;&lt;br&gt;
&lt;p&gt;
Concurrency Analysis technique is often used to examine the interaction of simultaneously executed tasks to make sure that requirement is met. It is often conducted in parallel with the other testing such as system testing. Test is designed and executed and analyzed to exploit the parallelism in the programs and ensure that requirements are met.
&lt;p&gt;
&lt;a name= "tt10"&gt; &lt;b&gt;&lt;font color="blue"&gt;Performance Analysis&lt;/font&gt;&lt;/b&gt;&lt;/a&gt;&lt;br&gt;
&lt;p&gt;
The goal of Performance Analysis technique is to ensure that software product meets its specified requirement objectives. This technique is applied during requirement validation to ensure the completeness and feasibility of the product. All the informations are gathered once program is executed, analyzed, and outlined what section of the program needs to be optimize to speed up the program's behavior. Modeling approaches such as Prototyping, simulation  are used to ensure performance analysis
&lt;p&gt;
&lt;p&gt;
&lt;table border="0" cellpadding="1" cellspacing="1" width="50%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href = "#tt1"&gt;&lt;b&gt;&amp;lt;&amp;lt;Previous&lt;/b&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;font color="blue"&gt;Page&lt;/font&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href = "#tt1"&gt;&lt;b&gt;1&lt;/b&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href = "#tt2"&gt;&lt;b&gt;2&lt;/b&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href = "#tt3"&gt;&lt;b&gt;3&lt;/b&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href = "#tt4"&gt;&lt;b&gt;4&lt;/b&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href = "#tt5"&gt;&lt;b&gt;5&lt;/b&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href = "#tt6"&gt;&lt;b&gt;6&lt;/b&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href = "#tt7"&gt;&lt;b&gt;7&lt;/b&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href = "#tt8"&gt;&lt;b&gt;8&lt;/b&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href = "#tt9"&gt;&lt;b&gt;9&lt;/b&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href = "#tt10"&gt;&lt;b&gt;10&lt;/b&gt;&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href = "#tt1"&gt;&lt;b&gt;Next&amp;gt;&amp;gt;&lt;/b&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7844341291913287808-4526003583479840437?l=javasansar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/4526003583479840437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7844341291913287808&amp;postID=4526003583479840437' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/4526003583479840437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/4526003583479840437'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/2009/01/testing-technique.html' title='Testing Technique'/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08436281743629996970'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7844341291913287808.post-3861531817555047985</id><published>2008-12-13T19:45:00.039-05:00</published><updated>2009-08-02T10:24:12.322-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Basics'/><title type='text'>Week One Tutorial</title><content type='html'>&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFFF"&gt;

&lt;tr&gt;
&lt;td bgcolor="white"&gt;
&lt;a href="#w1c1"&gt;&lt;b&gt;Java Overview&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;
&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="white"&gt;
&lt;a href="#w1c2"&gt;&lt;b&gt;Getting Started&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;
&lt;td&gt;
&lt;a href="http://javasansar.blogspot.com/2008/12/week-two-tutorial.html"&gt;&lt;b&gt;&lt;i&gt;&lt;font color ="#FF6600"&gt;Goto Week Two Tutorial&amp;#8594;&lt;/font&gt;&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;

&lt;td&gt;
&lt;a href="http://javasansar.blogspot.com/2008/12/week-three-tutorial.html"&gt;&lt;b&gt;&lt;i&gt;&lt;font color ="#FF6600"&gt;Goto Week Three Tutorial&amp;#8594;&lt;/font&gt;&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;
&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="white"&gt;
&lt;a href="#w1c3"&gt;&lt;b&gt;Naming Conventions&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="white"&gt;
&lt;a href="#w1c4"&gt;&lt;b&gt;Data Type&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="white"&gt;
&lt;a href="#w1c5"&gt;&lt;b&gt;Operators&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="white"&gt;
&lt;a href="#w1c6"&gt;&lt;b&gt;Control Statements&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="white"&gt;
&lt;a href="#w1c7"&gt;&lt;b&gt;Inputs &amp;amp; Output&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="white"&gt;
&lt;a href="#w1c8"&gt;&lt;b&gt;Arrays&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;hr&gt;


&lt;b&gt;&lt;a name="w1c1"&gt;1. Java Overview.&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
&lt;p&gt;Java Programming formally appeard in 1995 designed by Sun Microsystems. Java generally refers to a combination of three things: the Java programming language (a high-level, object-oriented programming language); the Java Virtual Machine (a high-performance virtual machine that executes bytecodes on a specific computing platform, typically abbreviated JVM); and the Java platform, a JVM running compiled Java bytecodes, usually calling on a set of standard libraries such as those provided by Java Standard Edition (SE) or Enterprise Edition (EE). 
Java is a simple programming language. Rather than saying that this is the feature of Java, we can say that this is the design aim of Java. When Java is developed, they wanted it to be simple because it has to work on electronic devices, where less memory is available. Now, the question is how Java is made simple? First of all, the difficult concepts of C and C++ have been omitted in Java. For example, the concept of pointers-which is very difficult for both learners and programmers, has been completely eliminated from Java. Next, JavaSoft (the team who developed Java is called with this name) people maintained the same syntax of C and C++ in Java, so that a programmer who knows C or C++ will find Java already familiar. 
&lt;br&gt;&lt;br&gt;
Note: Pointers have been eliminated from Java because it can crash a program easily in a case like adding two pointers, or forgetting to free memory allotted to variable and pointers can break security
Java is an object -oriented programming language. Java programs use objects and classes. What is an object? An object is anything that really exists in the world and can be distinguished from others. Everything that we see physically will come into this definition, for example, every human being, a book, a tree etc.
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Java History&lt;/b&gt;&lt;br&gt;
In 1990, Sun Microsystems Inc. has conceived a project to develop software for consumer electronic devices that could be controlled by a remote. This project was called Stealth Project but later its name was changed to Green Project.
In January of 1991, Bill Joy, James Gosling, Mike Sheradin, Patric Naughton, and several others met in Aspen, Colorado to discuss this project. Mike Sheradin was to focus on business development; Patrick Naughton was to begin work on the graphics system; and James Gosling was to identify the proper programming language for the project. Gosling thought C and C++ could be used to develop the project. But the problem he faced with them is that they were system dependent languages and hence could not be used on various processors, which the electronic devices might use. So he started developing a new language. This language was called Oak which was registered by some other company, later it was changed to Java.
Why the name Java? James Gosling and his team members were consuming a lot of tea while developing this language. 
&lt;br&gt;&lt;br&gt;
They felt that they were able to develop a better language because of the good quality tea they had consumed. So the tea also had its own role in developing this language and hence, they fixed the name for the language as Java. Thus, the symbol of Java is tea cup and saucer.
By September of 1994, Naughton and Jonathan Payne started writing WebRunner-1 Java-based Web browser, which was later renamed as HotJava. By October 1994, HotJava was stable and was demonstrated to Sun executives. HotJava was the first browser, having the capabilities of executing applets, which are programs designed to run dynamically on Internet. This time, Java's potential in the context of the World Wide Web was recognized.
Sun formally announced Java and HotJava at SunWorld conference in 1995. Soon after, Netscape Inc. announced that it would incorporate Java support in its browser Netscape Navigator. Latter, Microsoft also announced that they would support Java in their Internet Explorer Web browser, further solidifying Java's role in the World Wide Web. On January 23rd 1996, JDK 1.0 version was released. Today more than 4 million developers use Java and more than 1.75 billion devices run Java.&lt;a href="http://javasansar.blogspot.com/"&gt;javaSansar&lt;/a&gt;
&lt;br /&gt;
&lt;font color="blue"&gt;&lt;MARQUEE width="50%"&gt;Learn Java in just 5 Weeks&lt;/MARQUEE&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;b&gt;&lt;a name="w1c2"&gt;2. Getting started with JAVA.&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
You will need JavaScript enabled on your browser. We'll be compiling and running Java programs, so you'll need a Java development environment, such as the Java SDK. You can download SDK for free from Sun Microsystems website and a simple text editor, such as Notepad in Windows or vi in a UNIX environment.
This tutorial will walks you through step by step procedure and gives you tools you need to start learning Java Programming and creating your first java program. Have the following lists ready before starting to program in java.
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;a) How to Download Java SE?&lt;/b&gt;&lt;a href="http://java.sun.com/javase/downloads/index.jsp"&gt; Click Here&lt;/a&gt;&lt;br&gt;
-Make sure you grab "Java SE Development Kit (JDK)" from the above link.&lt;br&gt;
-Verify that JDK is installed in your computer. Go to DOS command line.&lt;br&gt;
-Start&gt;Run, type cmd in the 'Run window'&lt;br&gt;
-Change directory to C:\Program Files\java (default folder)&lt;br&gt;
-Type dir command. &lt;br&gt;
-Installed JDK will appear in the list such as:&lt;br&gt;
Jdk1.0.6_03&lt;br&gt;
Jre1.5.0_04&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;b&gt;b) How to set the Environment Path Variables?&lt;/b&gt;&lt;br&gt;
It is more convenient to set the path variables to run the JDK executables (javac.exe, java.exe, javadoc.exe, etc.). If you don't set the PATH variable, you need to specify the full path to the executable every time you run it. Now you have successfully installed JDK in your computer and its time to set the environment path variables. to set the PATH permanently, add the full path of the jdk1.6.0_&lt;version&gt;\bin directory to the PATH variable. 

-Click Start &gt; Control Panel &gt; System on Windows XP &lt;br&gt;
-Click Advanced &gt; Environment Variables. &lt;br&gt;
-Click New and provide name and value. &lt;br&gt;
-Name = JAVAPath&lt;br&gt;
-Value = C:\Program Files\Java\jdk1.6.0_10\bin&lt;br&gt;
The new path takes effect in each new command window you open   after    setting the PATH variable.
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;c) How to get a text Editor?&lt;/b&gt;&lt;br&gt;
Obviously, depending on your choice, you can use any word processing editors. There are many text editors available out there. Most of the OSs comes with the notepad included in the system. Now let's use a simple Notepad editor in our tutorial.

First step towards our goal is:
&lt;ul&gt;
     &lt;li&gt; writing code (creating source file".java")&lt;/li&gt;
     &lt;li&gt; compiling it into bytecode (.class file) and&lt;/li&gt;
     &lt;li&gt; running the bytecode&lt;/li&gt;
&lt;/ul&gt;
-Open a Notepad and type the following:&lt;br&gt;
&lt;table border="0" width="100%" cellpadding="2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;public class MyFirstProgram {
         public static void main(String args[]) {
                 System.out.println("My First Java Program");
          }//End of main method
     }//End of the class 
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

-Now save the file in the C drive &lt;br&gt;
-When you save the file, make sure to give the same exact filename as the class name of your program i.e. myFirstProgram.java. Please do not forget to give dot java (.java) extension after the filename.&lt;br&gt;
-Open DOS Command&lt;br&gt;
-Navigate to the folder where you had saved the program file (C:\java)&lt;br&gt;
-Type "javac MyFirstProgram.java" and Hit Enter.&lt;br&gt;
If you do not get an exception error, that means you have just compiled your source code to .class file&lt;br&gt;
-Type "java MyFirstProgram" (no extension please) and hit Enter&lt;br&gt;
If you see "My First Java Program" printed out in the command line, then congratulations. You've just written your first java program successfully.&lt;br&gt;

javac: Java Compiler converts java code into byte code&lt;br&gt;
java: Java Interpreter executes java bytecode from class file&lt;br&gt;
&lt;hr&gt;
&lt;b&gt;&lt;a name="w1c3"&gt;3. Naming Conventions in Java.&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
Naming Convention is the rules followed by java programmers while writing the names of packages, classes, methods etc. &lt;br&gt;
&lt;table border="1" cellpadding="2" cellspacing="2" bgcolor="#F0FFFF"&gt;
&lt;tr&gt;&lt;th cellpadding="8"&gt;Names&lt;/th&gt;&lt;th&gt;Case&lt;/th&gt;&lt;th&gt;Examples&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;packages&lt;/td&gt;&lt;td&gt;lowercase&lt;/td&gt;&lt;td&gt;mydomain.com&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;files&lt;/td&gt;&lt;td&gt;lowercase&lt;/td&gt;&lt;td&gt;.java&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;classes&lt;/td&gt;&lt;td&gt;CapitalizedWithInternalWordsAlsoCapitalized&lt;/td&gt;&lt;td&gt;MyClass&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;Exception class&lt;/td&gt;&lt;td&gt;ClassNameEndsWithException&lt;/td&gt;&lt;td&gt;ClassNotFoundException&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;Interface&lt;/td&gt;&lt;td&gt;InterfaceNameEndsWithIfc&lt;/td&gt;&lt;td&gt;mydomain.com&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;constants&lt;/td&gt;&lt;td&gt;UPPER_CASE_WITH_UNDERSCORES &lt;/td&gt;&lt;td&gt;DAYS_IN_WEEK&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;private/protected&lt;/td&gt;&lt;td&gt;firstWordLowerCaseButInternalWordsCapitalized&lt;/td&gt;&lt;td&gt;myVar&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;local variables&lt;/td&gt;&lt;td&gt;firstWordLowerCaseButInternalWordsCapitalized&lt;/td&gt;&lt;td&gt;myVar&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;methods&lt;/td&gt;&lt;td&gt;firstWordLowerCaseButInternalWordsCapitalized&lt;/td&gt;&lt;td&gt;eatFast&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
indeed_jobroll_format = "300x250";
indeed_jobroll_publisher = "4159526527794233";
indeed_jobroll_keywords = "java developers";
indeed_jobroll_location = "";
indeed_jobroll_channel = "java developer";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="http://jobroll.indeed.com/ads/jobroll2.js"&gt;
&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://www.indeed.com/"&gt;Jobs&lt;/a&gt; by Indeed&lt;/noscript&gt;
&lt;hr&gt;
&lt;b&gt;&lt;a name="w1c4"&gt;4. Data Type in Java.&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
Java comes with its standard data types which represents data such as integer numbers. We need variables to store the data. A variable represents a memory location which holds data. Following table represents all the data types available in java programming.
&lt;table border="1" bgcolor="#F0FFFF"&gt;
&lt;tr&gt;&lt;th cellpadding="8"&gt;Data Type&lt;/th&gt;&lt;th&gt;Memory Size &amp; Values&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;byte&lt;/td&gt;&lt;td&gt;1 bytes, signed (two's complement), Covers values from -128 to 127&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;short&lt;/td&gt;&lt;td&gt;2 signed byte (two's complement). Covers values from -32,768 to 32,767&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;int&lt;/td&gt;&lt;td&gt;4 bytes, signed (two's complement). -2,147,483,648 to 2,147,483,647&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;long&lt;/td&gt;&lt;td&gt;8 bytes signed (two's complement). Ranges from -9,223,372,036,854,775,808 to +9,223,372,036,854,775,807&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;float&lt;/td&gt;&lt;td&gt;4 bytes, IEEE 754. Covers a range from 1.40129846432481707e-45 to 3.40282346638528860e+38 (positive or negative)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;double&lt;/td&gt;&lt;td&gt;8 bytes IEEE 754. Covers a range from 4.94065645841246544e-324d to 1.79769313486231570e+308d (positive or negative)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;char&lt;/td&gt;&lt;td&gt;2 bytes, unsigned, Unicode, 0 to 65,535 &lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
Apart from above data type, java also has special data type such as String, Boolean and literals. A String represents a group of characters such as 123abc or New York. Boolean expresses only two values true and false such as boolean result=false. A literal represents a value which is stored into a variable directly in the program. For an example: char sex='F';
&lt;hr&gt;
&lt;b&gt;&lt;a name="w1c5"&gt;5. Operators in Java.&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
Operators are very important part of java programming. If a programmer needs to add two numbers, then he would use addition '+' sign. Such symbols or signs are call operators. Operators are used to manipulate data types. Operators work based on the operator precedence order, the higher the precedence will be evaluated first such as multiplication and division is evaluated first than addition or subtraction. 
&lt;table border="1" bgcolor="#F0FFFF"&gt;
&lt;tr&gt;&lt;th cellpadding="8"&gt;Operator&lt;/th&gt;&lt;th&gt;Meaning&lt;/th&gt;&lt;th&gt;Exampls&lt;/th&gt;&lt;th&gt;Result&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;+&lt;/td&gt;&lt;td&gt;Addition&lt;/td&gt;&lt;td&gt;x+y&lt;/td&gt;&lt;td&gt;15&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;-&lt;/td&gt;&lt;td&gt;Subtraction&lt;/td&gt;&lt;td&gt;x-y&lt;/td&gt;&lt;td&gt;7&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;*&lt;/td&gt;&lt;td&gt;Multiplication&lt;/td&gt;&lt;td&gt;x*y&lt;/td&gt;&lt;td&gt;49&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;/&lt;/td&gt;&lt;td&gt;Division&lt;/td&gt;&lt;td&gt;x/y&lt;/td&gt;&lt;td&gt;2.5&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;%&lt;/td&gt;&lt;td&gt;Modulus&lt;/td&gt;&lt;td&gt;x%y&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

Java Operators fall into different categories such as follows:&lt;br&gt;
&lt;table border="1" bgcolor="#F0FFFF"&gt;
&lt;tr&gt;&lt;th cellpadding="8"&gt;Operator Type&lt;/th&gt;&lt;th&gt;Symbols&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;Assignment Operator&lt;/td&gt;&lt;td&gt;=&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;Arithmetic Operator&lt;/td&gt;&lt;td&gt;+, -, *, /, ++, --, %&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;Relation Operator&lt;/td&gt;&lt;td&gt;&amp;lt;, &amp;gt;, &amp;lt;=, &amp;gt;=, ==, !=&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;Logical Operator&lt;/td&gt;&lt;td&gt;&amp;&amp;, ||, &amp;, |, !, ^&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;Bitwise Operator&lt;/td&gt;&lt;td&gt;&amp;, |, ^, &amp;gt; &amp;gt;, &amp;gt; &amp;gt; &amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;Compound Asssignment Operator&lt;/td&gt;&lt;td&gt;+=, -=, *=, /=, %=&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;Conditional Operator&lt;/td&gt;&lt;td&gt;?:&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;hr&gt;
&lt;b&gt;&lt;a name="w1c6"&gt;6. Control Statements in Java.&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
In Java programming, Sequential statements and Control statement are very popular. Sequential statements are executed one by one whereas Control Statements executed randomly and repeatedly. The following statement is what we call sequential statements. 
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;
   System.out.println("My Java Program");
   a=b+c;
   System.out.println(a);
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

Today the following control statements are available in Java programming;
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;
   if …else statement
   do …while loop
   while loop
   for loop
   for-each loop
   switch statement
   break statement
   continue statement
   return statement
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;b&gt;If…Else Statement&lt;/b&gt;&lt;br&gt;
If …else statement is used to perform if given condition is true or false. For example let's take a look into following snippet. 
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;
public class MyClassOne{
    public static void main(String args[]){
            int num=3;
            if(num==0) //condition1
             {
                System.out.println("This is 0"); //statement1
             }
           else if(num&gt;0) //condition2
             {
                 System.out.println("The correct number is: "+num); //statement2
             }
          else
             {
                 System.out.println("You entered wrong number");
             }
          }
      }
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
Here if condition1 is true then statement1 will be executed and if condition1 is not true then condition2 is tested. If condition2 is true then statement2 is executed.
&lt;br&gt;
&lt;b&gt;Do…While Loop&lt;/b&gt;&lt;br&gt;
If we need to repeatedly execute a group of statements, then we use do…while loop. If the condition is not true, the repetition will be stoped. Let's say we want to write a program to print numbers from 1 to 10. Here is the snippet.
&lt;table border="0" cellpadding="2" cellspacing="0" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
   public class MyProgram{
       public static void main(String args[]){
      int a;
      a=1; //beginning number is 1
         do{
         System.out.println(a);
         a++;
         }while(a&lt;=10);
      }
   }
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

Output of the above snippet will be numbers displaying 1 to 10.&lt;br&gt;

&lt;b&gt;While Loop&lt;/b&gt;&lt;br /&gt;
while loop works just like do…while loop. The only difference is that 'do…while' loop executes statement first and condition is tested later
&lt;table border="0" cellpadding="2" cellspacing="0" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
   public class MyProgram{
       public static void main(String args[]){
          Int a;
          a=1; //beginning number is 1
             while(a&lt;=10){
            System.out.println(a);
            a++;
            }
      }
   }
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;b&gt;For Loop&lt;/b&gt;&lt;br&gt;
for loop works just like 'while loop' or 'do…while' loop but &lt;b&gt;for&lt;/b&gt; loop repeats for the specified number of time and while loop repeats as long as certain condition is true.
&lt;table border="0" cellpadding="2" cellspacing="0" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
    public class MyProgram{
      public static void main(String args[]){
           for(int a=1; a&lt;=10; x++);
           System.out.println(x);  
       }
   }
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;b&gt;For-Each Loop&lt;/b&gt;&lt;br /&gt;
'for-each' loop is designed to handle the elements of a collection. Collection represents a group of elements. For example java.util package can be considered as a collection. 'for-each' loop repeatedly executes a group of statements for each element of the collection. It executes as many times as there are number of elements in the collection.
&lt;br&gt;
&lt;b&gt;Switch Statement&lt;/b&gt;&lt;br /&gt;
When there are several options and we have to choose only one options from the available ones, we can use &lt;b&gt;switch&lt;/b&gt; statement.
&lt;table border="0" cellpadding="2" cellspacing="0" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
   public class MyProgram{
       public static void main(String args[]){
      char color = 'g'; //color is set to 'g'
         switch(color)
         {
         case 'r': System.out.println("Red");
         break;
         case 'g': System.out.println("Green");
         break;
         case 'b': System.out.println("Blue");
         break;
          case 'w': System.out.println("White");
         break;
         default: System.out.println("No Color"); 
         }
     }
   }
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;b&gt;Return Statement&lt;/b&gt;&lt;br /&gt;
'return' statement is used in the method. A method is executed when called from another method. The first method that is executed in a Java program by JVM is main() method and hence if we want to execute any other method we should call it from main().
'return' statement is used in a method to come out of it to the main() method. Suppose if we want to call a method by the name of myMethod() from the main method. If return is used inside myMethod(), we can also return some value to the main() method.
return 1; //returns 1 to calling method main()&lt;br /&gt;
return x; //returns x value to calling method main()&lt;br /&gt;
return -5; //returns -5&lt;br /&gt;
We will write a program that will return a value from a method&lt;br /&gt;
&lt;table border="0" cellpadding="2" cellspacing="0" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
   public class MyProgram{
       public static void main(String args[]){
          //call myMethod() and catch the result into sum.
          //since myMethod() is static, we can call int using classname.methodname()
          int sum = MyProgram.myMethod(10);
          //display the result now
          System.out.println("Result: "+sum);
      }
      //this method caluculates square value and returns it to main()
      static int myMethod(int num){
      return num*num;//return square value to main method
      }
   }
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
indeed_jobroll_format = "728x90";
indeed_jobroll_publisher = "4159526527794233";
indeed_jobroll_keywords = "java developer";
indeed_jobroll_location = "";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="http://jobroll.indeed.com/ads/jobroll2.js"&gt;
&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://www.indeed.com/"&gt;Jobs&lt;/a&gt; by Indeed&lt;/noscript&gt;
&lt;p&gt;
&lt;hr&gt;
&lt;b&gt;&lt;a name="w1c7"&gt;7. Inputs &amp;amp; Output in Java.&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
Input and Output both are often data but only difference is Input represent data given to a program and output represents data displayed as a result of a prgram execution. Let us take following example:
&lt;pre&gt;int a=10;
   int b=12;
   int c=a+b;
   System.out.println(c);
   &lt;/pre&gt;
In the above code snippet, what we see is inputs given are only 10 and 12. when you execute it, it will display only the sum of a+b.
What if we want to accept these numbers from keyboard and a stream is required to accept input from keyboard. There are two type
of streams input stream and output stream. stream carries data from one place to another. All streams are represented by classes in
"java.io" package. System class is available in java.lang package and System class has following fields:
&lt;br&gt;
a) System.in: This represents InputStream object which by default represents standard input device i.e. keyboard&lt;br&gt;
b) System.out: This represents PrintStream object, which by default represents standard output device, i.e. monitor&lt;br&gt;
c) System.err: This field also represents PrintStream object, which by default represents monitor and is used to display error message.
Now, its time to enter input from keyboard and display output in the monitor. Let us see the following code snippet:
&lt;table border="0" cellpadding="2" cellspacing="0" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
import java.io.*;
public class Accept{
    public static void main(String arg[]) throws IOException
    {
       //create a BufferedReader object to accept data from keyboard
       BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
       //Ask for char and read it
       System.out.print("Enter a character: ");
       char ch = (char)br.read();

       //display the character
       System.out.println("You have entered: " +ch);
    }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;b&gt;&lt;a name="w1c8"&gt;8. Arrays in Java.&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
An array represents group of elements of same data type. It can store a group of elements such that we can store 
a group of int values in the array. What we need to understand is that using arrays will simplify the 
programming by replacing a lot of statements by just one or two statements. There are two types of arrays:
&lt;p&gt;&lt;b&gt;a) Single Dimensional Arrays (1D Array)&lt;/b&gt;&lt;br /&gt;
Single dimensional array represents a single row or column of elements. For instance grades obtained by a student in 5 different
subjects. To represent one dimensional array, we use single squar braket"[]". There is two ways to create one dimentional array
int grades[] = {55, 65, 75, 85, 95}; //declare grades[] and initialize with 5 elements
or
&lt;pre&gt;
int grades[] = new int[5];
  grades[0]=55;
  grades[0]=65;
  grades[0]=75;
  grades[0]=85;
  grades[0]=95;
&lt;/pre&gt;
Let us create a code snippet for one dimensional array using first method
&lt;table border="0" cellpadding="2" cellspacing="0" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
   public class MyArray
   {
       public static void main(String args[])
      {
           int grades[] = {55, 65, 75, 85, 95};
          for(int i=0; i&lt;5; i++)
          {
               System.out.println(grades[i]);
          }
      }
   }    
&lt;/pre&gt; 
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
    
&lt;b&gt;b) Multi Dimensional Arrays (2D, 3D etc. Arrays)&lt;/b&gt;&lt;br /&gt;
Multi Dimensional Arrays represents 2D, 3D,...arrays which are combinations of several arrays. For instance, a two 
dimensional array is a combination of two or more 1D arrays whereas 3D arrays are combination of two or more dimensional arrays.
Let us write a code snippet for grades obtained by a student previously in 5 different subjects. Now we will have 3
students and 5 different courses for each in two dimensional arrays.&lt;br /&gt;
&lt;table border="0" cellpadding="2" cellspacing="0" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
 public class MyArrayOneD
 {
     public static void main(String args[])
    {
         int grades[] []= {{55, 65, 75, 85, 95}, {56, 66, 76, 86, 96}, {57, 67, 77, 87, 97}};
         for(int i=0; i&lt;3; i++)//rows
        {
             for(int j=0; j&lt;5; j++)//columns
            {
                 System.out.print(grades[i][j]+"\t");
            }
                 System.out.println();//next line
        }
     }
  }
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

Ok now let us have snippet with second method but giving you the same output as in preceding instance.&lt;br /&gt;
&lt;table border="0" cellpadding="2" cellspacing="0" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;public class MyArrayOneD{
         public static void main(String args[]){
        int grades[] [];
       grades= new int[3][5];
       grades[0][0]=55;
       grades[0][1]=65;
       grades[0][2]=75;
       grades[0][3]=85;
       grades[0][4]=95;
       grades[1][0]=56;
       grades[1][1]=66;
       grades[1][2]=76;
       grades[1][3]=86;
       grades[1][4]=96;
       grades[2][0]=57;
       grades[2][1]=67;
       grades[2][2]=77;
       grades[2][3]=87;
       grades[2][4]=97;

        for(int i=0; i&lt;3; i++)//rows
       {
            for(int j=0; j&lt;5; j++)//columns
           {
                System.out.print(grades[i][j]+"\t");
           }
                System.out.println();//next line
       }
    }
   }&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;hr&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7844341291913287808-3861531817555047985?l=javasansar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/3861531817555047985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7844341291913287808&amp;postID=3861531817555047985' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/3861531817555047985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/3861531817555047985'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/2008/12/week-one-tutorial.html' title='Week One Tutorial'/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08436281743629996970'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7844341291913287808.post-2862793493057470042</id><published>2008-12-13T19:41:00.014-05:00</published><updated>2009-07-31T23:28:40.912-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Basics'/><title type='text'>Week One Quiz</title><content type='html'>&lt;p&gt;
&lt;span style="color:purple;"&gt;&lt;marquee width="100%"&gt;Learning java in just 5 weeks...&lt;/marquee&gt;&lt;/span&gt;
&lt;hr&gt;
&lt;font color="blue"&gt;&lt;b&gt;Please answer the following questions to proceed to week two tutorial&lt;/b&gt;&lt;/font&gt;
&lt;p&gt;
&lt;b&gt;Q.1: What is the reason that pointer was eliminated from JAVA?&lt;/b&gt;

&lt;/p&gt;&lt;form&gt;
&lt;input name="vehicle" value="Bike" type="checkbox"&gt;a) If forgotten to free the memory allotted to a variable it may crash.&lt;br /&gt;

&lt;input name="vehicle" value="Car" type="checkbox"&gt;b) Using pointers was a potential threat to security as pointer break security.&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;c) Pointers are used to built program such as computer viruses and hacking program.&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;d) All of the above.&lt;br /&gt;

&lt;/form&gt;
&lt;a href="#w1qa1"&gt;Check the correct answer&lt;/a&gt;

&lt;p&gt;
&lt;b&gt;Q.2: What is the right method to print the contents to display in monitor?&lt;/b&gt;&lt;br /&gt;

&lt;form&gt;
&lt;input name="vehicle" value="Bike" type="checkbox"&gt;a) print ("My First Java Program");&lt;br /&gt;

&lt;input name="vehicle" value="Car" type="checkbox"&gt;b) printstream obj.print("My First Java Program");&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;c) System.out.println("My First Java Program");&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;d) None of the above.&lt;br /&gt;

&lt;/form&gt;
&lt;a href="#w1qa2"&gt;Check the correct answer&lt;/a&gt;

&lt;p&gt;
&lt;b&gt;Q.3: What is the main difference between print() and println()?&lt;/b&gt;&lt;br /&gt;

&lt;form&gt;
&lt;input name="vehicle" value="Bike" type="checkbox"&gt;a) Both are not used in Java programming.&lt;br /&gt;

&lt;input name="vehicle" value="Car" type="checkbox"&gt;b) Both are used to print text but print () method prints text and retains cursor in the same line.&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;c) Both are used to print text but println () method prints text and kicks the cursor to the next line.&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;d) Both a &amp;amp; b are correct.&lt;br /&gt;

&lt;/form&gt;
&lt;a href="#w1qa3"&gt;Check the correct answer&lt;/a&gt;

&lt;p&gt;
&lt;b&gt;Q.4: Constants represent fixed values which should be written in the following naming convention?&lt;/b&gt;&lt;br /&gt;

&lt;form&gt;
&lt;input name="vehicle" value="Bike" type="checkbox"&gt;a) Constants should be written by using all capital letters&lt;br /&gt;

&lt;input name="vehicle" value="Car" type="checkbox"&gt;b) The first word starts with a small letter and second word onwards start with a capital letter.&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;c) The first word and other consecutive words all start with capital letter.&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;d) All keywords should be written by using all small letter.&lt;br /&gt;

&lt;/form&gt;
&lt;a href="#w1qa4"&gt;Check the correct answer&lt;/a&gt;

&lt;p&gt;
&lt;b&gt;Q.5: what does 0.01 number represent in java data type category?&lt;/b&gt;&lt;br /&gt;

&lt;form&gt;
&lt;input name="vehicle" value="Bike" type="checkbox"&gt;a) short&lt;br /&gt;

&lt;input name="vehicle" value="Car" type="checkbox"&gt;b) int and float&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;c) double and float&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;d) double&lt;br /&gt;

&lt;/form&gt;
&lt;a href="#w1qa5"&gt;Check the correct answer&lt;/a&gt;

&lt;p&gt;
&lt;b&gt;Q.6: The following code snippet falls into what operators category?&lt;/b&gt;&lt;br /&gt;

&lt;b&gt;System.out.println("x&amp;gt;y : "+(x&amp;gt;y));&lt;/b&gt;

&lt;form&gt;
&lt;input name="vehicle" value="Bike" type="checkbox"&gt;a) Arithmetic Operator&lt;br /&gt;

&lt;input name="vehicle" value="Car" type="checkbox"&gt;b) Relational Operator&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;c) Logical Operator&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;d) Bitwise Operator&lt;br /&gt;

&lt;/form&gt;
&lt;a href="#w1qa6"&gt;Check the correct answer&lt;/a&gt;

&lt;p&gt;
&lt;b&gt;Q.7: Look at the following code snippet and find out the right answers?&lt;/b&gt;&lt;br /&gt;

&lt;table width="100%" bgcolor="#ffffcc" border="0" cellpadding="2" cellspacing="2"&gt;
&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
  public class MyProgram{
      public static void main(String args[]){
         int x;
         x=1; //beginning number is 1
         do{
         System.out.println(x);
         ++x;
         }while(x&lt;=10);       }    } &lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;


&lt;form&gt;
&lt;input name="vehicle" value="Bike" type="checkbox"&gt;a) The first number will display 1 as value of x is already 1.&lt;br /&gt;

&lt;input name="vehicle" value="Car" type="checkbox"&gt;b) x++ will increment the value of x by 1 hence the value of x becomes 2.&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;c) As long as x value does not exceed 10, the loop repeats and number displays from 1 to 10.&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;d) None of the above.&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;e) a, b, and c all are correct.&lt;br /&gt;

&lt;/form&gt;
&lt;a href="#w1qa7"&gt;Check the correct answer&lt;/a&gt;

&lt;p&gt;
&lt;b&gt;Q.8 Find out incorrect answer from the following list?&lt;/b&gt;&lt;br /&gt;

&lt;form&gt;
&lt;input name="vehicle" value="Bike" type="checkbox"&gt;a) System.exit(0)does not exist in Java&lt;br /&gt;

&lt;input name="vehicle" value="Car" type="checkbox"&gt;b)return statement is used inside a method to come out of it.&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;c) System.exit(0)is used in any method to come out of the program.&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;d) System.exit(0) terminates the program normally whereas&lt;br /&gt;

System.exit(1) terminates the program because of the some program error encountered.&lt;br /&gt;

&lt;/form&gt;
&lt;a href="#w1qa8"&gt;Check the correct answer&lt;/a&gt;

&lt;p&gt;
&lt;b&gt;Q.9 Arrays are stored on what memory?&lt;/b&gt;&lt;br /&gt;

&lt;form&gt;
&lt;input name="vehicle" value="Bike" type="checkbox"&gt;a) Arrays are stored in Static Memory.&lt;br /&gt;

&lt;input name="vehicle" value="Car" type="checkbox"&gt;b)Static Memory is used to store arrys as well as variable, object etc. in Java.&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;c) Arrays are stored in Dynamic memory by JVM.&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;d) Arrays are stored in Dynamic Memory and variable or object are stored in Static Memory.&lt;br /&gt;

&lt;/form&gt;
&lt;a href="#w1qa9"&gt;Check the correct answer&lt;/a&gt;

&lt;p&gt;
&lt;b&gt;Q.10 Write a code that puts 45 into row 2 column 3 ?&lt;/b&gt;&lt;br /&gt;

&lt;table bgcolor="white" border="1"&gt;
&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;------&lt;/td&gt;&lt;td&gt;Column 0&lt;/td&gt;&lt;td&gt;Column 1&lt;/td&gt;&lt;td&gt;Column 2&lt;/td&gt;&lt;td&gt;Column 3&lt;/td&gt;&lt;td&gt;Column 4&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Row 0&lt;/td&gt;&lt;td&gt;55&lt;/td&gt;&lt;td&gt;65&lt;/td&gt;&lt;td&gt;75&lt;/td&gt;&lt;td&gt;85&lt;/td&gt;&lt;td&gt;95&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Row 1&lt;/td&gt;&lt;td&gt;56&lt;/td&gt;&lt;td&gt;66&lt;/td&gt;&lt;td&gt;76&lt;/td&gt;&lt;td&gt;86&lt;/td&gt;&lt;td&gt;96&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Row 2&lt;/td&gt;&lt;td&gt;57&lt;/td&gt;&lt;td&gt;67&lt;/td&gt;&lt;td&gt;77&lt;/td&gt;&lt;td&gt;87&lt;/td&gt;&lt;td&gt;97&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

 grades[0][0], grades[0][1], grades[0][2], grades[0][3], grades[0][4];&lt;br /&gt;

 grades[1][0], grades[1][1], grades[1][2], grades[1][3], grades[1][4];&lt;br /&gt;

 grades[2][0], grades[2][1], grades[2][2], grades[2][3], grades[2][4];&lt;br /&gt;

&lt;form&gt;
&lt;input name="vehicle" value="Bike" type="checkbox"&gt;a) grades[3][2]=45;&lt;br /&gt;

&lt;input name="vehicle" value="Car" type="checkbox"&gt;b) grades[2][3]=45;&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;c) grades[3][1]=45;&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;d) grades[0][2]=45;&lt;br /&gt;

&lt;/form&gt;
&lt;a href="#w1qa10"&gt;Check the correct answer&lt;/a&gt;

&lt;p&gt;&lt;p&gt;

&lt;b&gt;Answers of the Week One tutorial questions&lt;/b&gt;
&lt;p&gt;
&lt;hr&gt;&lt;hr&gt;
&lt;a name="w1qa1"&gt;&lt;font color="blue"&gt;&lt;b&gt;Q.1. Correct answer is d.&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;p&gt;
&lt;hr&gt;&lt;hr&gt;
&lt;a name="w1qa2"&gt;&lt;font color="blue"&gt;&lt;b&gt;Q.2. Correct answer is c.&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;p&gt;
&lt;hr&gt;&lt;hr&gt;
&lt;a name="w1qa3"&gt;&lt;font color="blue"&gt;&lt;b&gt;Q.3. Correct answer is d.&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;p&gt;
&lt;hr&gt;&lt;hr&gt;
&lt;a name="w1qa4"&gt;&lt;font color="blue"&gt;&lt;b&gt;Q.4. Correct answer is a.&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;p&gt;
&lt;hr&gt;&lt;hr&gt;
&lt;a name="w1qa5"&gt;&lt;font color="blue"&gt;&lt;b&gt;Q.5. Correct answer is d.&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;p&gt;
&lt;hr&gt;&lt;hr&gt;
&lt;a name="w1qa6"&gt;&lt;font color="blue"&gt;&lt;b&gt;Q.6. Correct answer is b.&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;p&gt;
&lt;hr&gt;&lt;hr&gt;
&lt;a name="w1qa7"&gt;&lt;font color="blue"&gt;&lt;b&gt;Q.7. Correct answer is e.&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;p&gt;
&lt;hr&gt;&lt;hr&gt;
&lt;a name="w1qa8"&gt;&lt;font color="blue"&gt;&lt;b&gt;Q.8. Correct answer is a.&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;p&gt;
&lt;hr&gt;&lt;hr&gt;
&lt;a name="w1qa9"&gt;&lt;font color="blue"&gt;&lt;b&gt;Q.9. Correct answer is c.&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;p&gt;
&lt;hr&gt;&lt;hr&gt;
&lt;a name="w1qa10"&gt;&lt;font color="blue"&gt;&lt;b&gt;Q.10. Correct answer is b.&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;p&gt;
&lt;hr&gt;&lt;hr&gt;
&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
indeed_jobroll_format = "728x90";
indeed_jobroll_publisher = "4159526527794233";
indeed_jobroll_keywords = "java developer";
indeed_jobroll_location = "";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="http://jobroll.indeed.com/ads/jobroll2.js"&gt;
&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://www.indeed.com/"&gt;Jobs&lt;/a&gt; by Indeed&lt;/noscript&gt;
&lt;p&gt;
&lt;p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7844341291913287808-2862793493057470042?l=javasansar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/2862793493057470042/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7844341291913287808&amp;postID=2862793493057470042' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/2862793493057470042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/2862793493057470042'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/2008/12/week-one-quiz.html' title='Week One Quiz'/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08436281743629996970'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7844341291913287808.post-8516381760123269521</id><published>2008-12-13T19:32:00.013-05:00</published><updated>2009-08-01T00:16:36.732-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Basics'/><title type='text'>Week Two Tutorial</title><content type='html'>&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFFF"&gt;

&lt;tr&gt;&lt;td bgcolor="#FFFFFF"&gt;
&lt;a href="#w2c1"&gt;&lt;b&gt;Strings in Java&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="#FFFFFF"&gt;
&lt;a href="#w2c2"&gt;&lt;b&gt;StringBuffer &amp;amp; StringBuilder&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;
&lt;td&gt;
&lt;a href="http://javasansar.blogspot.com/2008/12/week-one-tutorial.html"&gt;&lt;b&gt;&lt;i&gt;&lt;font color ="#FF6600"&gt;&amp;#8592; Back Week One Tutorial&lt;/font&gt;&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;
&lt;/td&gt;

&lt;td&gt;
&lt;a href="http://javasansar.blogspot.com/2008/12/week-three-tutorial.html"&gt;&lt;b&gt;&lt;i&gt;&lt;font color ="#FF6600"&gt;Goto Week Three Tutorial&amp;#8594;&lt;/font&gt;&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td bgcolor="#FFFFFF"&gt;
&lt;a href="#w2c3"&gt;&lt;b&gt;OOPS in Java&lt;/b&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="#FFFFFF"&gt;
&lt;a href="#w2c4"&gt;&lt;b&gt;Classes &amp;amp; Objects&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="#FFFFFF"&gt;
&lt;a href="#w2c5"&gt;&lt;b&gt;Methods in Java&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="#FFFFFF"&gt;
&lt;a href="#w2c6"&gt;&lt;b&gt;Inheritance in Java&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;table border="0"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;b&gt;&lt;a name="w2c1"&gt;&lt;font color="blue"&gt;Strings in Java&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;
&lt;p&gt;
A group of characters are called 'Strings'. For example, in a bank, there are credit card numbers, names, and addresses etc. which all are strings. String is an object of String class from the java.lang package. 
There are three ways to create strings in Java Programming:
We can assign a group of characters to a string type variable. Here JVM creates an object and stores string "David" into that object.
&lt;b&gt;&lt;pre&gt;String name="David";&lt;/pre&gt;&lt;/b&gt;
We can use 'new' operator to create an object to String class and store String 'David' into that object as follows:
&lt;b&gt;&lt;pre&gt;String name= new String("David");&lt;/pre&gt;&lt;/b&gt;
Third way of creating strings is converting characters arrays into strings as follows:
&lt;b&gt;&lt;pre&gt;char ch[]={'D', 'a', 'v', 'i', 'd'}&lt;/pre&gt;&lt;/b&gt;
&lt;b&gt;&lt;pre&gt;String name= new String(ch);&lt;/pre&gt;&lt;/b&gt; 
Now the String object ch contains the string 'David'
Java comes with some standard class Methods. Such as follows:
&lt;pre&gt;String concat(String s)&lt;/pre&gt;
&lt;pre&gt;int length();&lt;/pre&gt;
&lt;pre&gt;char charAt(int i)&lt;/pre&gt;
&lt;pre&gt;boolean equals(String s)&lt;/pre&gt;
&lt;pre&gt;int indexOf(String s)&lt;/pre&gt;
Let us have a code snippet which covers few of the above method including how to create strings.
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt; 
&lt;pre&gt;public class MyString{
          Public static void main(String args[]){
          String n1="David"; 
          String n2= new String("MacCain");
          System.out.println("My First Name is:"+n1);//display first string
          System.out.println("My Last Name is: "+n2);//display second string
    
          System.out.println("Length of first name is:" +n1.length());
          System.out.println("My full name is:" +n1.concat(n2));//concatenate two string
      }
  }&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
We have been able to create two string objects, measure the length of characters and we were able to concatenate two strings in one line in the example above. Result of the above code will look like this:&lt;br /&gt;
My First Name is: David&lt;br /&gt;
My Last Name is: MacCain&lt;br /&gt;
Length of first name: 5&lt;br /&gt;
My full name is: David MacCain&lt;br /&gt;

Let us do some String Comparison here. If we want to compare two strings, we will not be able to use relational operators like &amp;lt;, &amp;gt;, == etc. We can use method like compareTo(), equals() to compare two strings. Here is an instance of code to expose the string comparison. &lt;br&gt;
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt; 
&lt;pre&gt;public class MyString{
         Public static void main(String args[]){
         String n1="David"; 
         String n2= new String("David");
         if(n1==n2){
         System.out.println("Both are same");
         }
         else{
         System.out.println("Both are not same");
         }
     }
   }&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
When you run above code, can you guess what would be the output? Output will be: Both are not same. Because we can not use equal sign '==' to compare two strings. If we use a compare method equals() replacing '==' sign, it might solve our problem. Let us replace&lt;b&gt; if(n1==n2)&lt;/b&gt; with the &lt;b&gt;if(n1.equals(n2))&lt;/b&gt; and run the code. Yes this time we get the output: Both are same.
&lt;p&gt;
&lt;b&gt;&lt;a name="w2c2"&gt;&lt;font color="blue"&gt;StringBuffer and StringBuilder in Java&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;
&lt;p&gt;
StringBuffer class is used to represent character that can be modified. It means StringBuffer class objects are mutable unlike Strings that we studied in previous chapter. Mostly StringBuffer is used for concatenation or manipulation of the strings. A StringBuffer implements the mutable sequence of the characters. We can create StringBuffer objects in two ways.
&lt;br /&gt;
&lt;b&gt;By using 'new' operator and passing the string to the object&lt;/b&gt; such as:
&lt;pre&gt;StirngBuffer strb = new StringBuffer("My Java");&lt;/pre&gt; and
&lt;b&gt;By allotting memory to the StringBuffer object using 'new' operator and later storing it into it&lt;/b&gt; such as:
&lt;pre&gt;StirngBuffer strb = new StringBuffer();&lt;/pre&gt;
Here we are creating a StringBuffer empty object but not passing any string to it. StringBuffer will be created with 16 characters with default values.&lt;br&gt;
&lt;pre&gt;StringBuffer strb = new StringBuffer(30);&lt;/pre&gt;&lt;br&gt;
What above code explains is that StringBuffer is created with 30 characters capacity. Now, is it possible to store more than 30 characters? Yes because StringBuffer has mutability feature, it can be modified. We can use append(), or insert() method to do it.
&lt;p&gt;
Let us have a code snippet to reflect preceding chapters. 
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
import java.io.*;
public class MyStringBuffer{
    public static void main(String args[]) throws IOException
    {
       StringBuffer strb= new StringBuffer();//creates empty stringbuffer object
      BufferedReader br= new BufferedReader(new InputStreamReader(System.in)); //input from keyboard

      System.out.print("What is you First Name: ");
      String fn = br.readLine();

      System.out.print("What is your middle name:");
      String mn = br.readLine();

      System.out.print("What is your last name:");
      String ln = br.readLine();
      //append first name and lastname
      strb.append(fn);
      strb.append(ln);
      //display only first name and last name upto this point
      //System.out.println("My name is: " + strb);

      //lets insert middle name
      int n = fn.length(); //n represent no. of characters
      strb.insert(n, mn);//insert middle name after n characters
      System.out.println("My full name is:"+ strb);//display full name now 
   }
} &lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
We have tried to append first name and last name and we were able to print out the results displaying first and last name in the monitor. Then, we realized that we'd missed the middle name. How do we append middle name, then? By using insert() method, we can append middle name as in above example code.
&lt;p&gt;
&lt;b&gt;StringBuilder Class. &lt;/b&gt;&lt;br&gt;
We have had StringBuilder Class only after JDK1.5 which contains same sort of features as StringBuffer Class does. StringBuilder Class is also mutable and modifiable as StringBuffer.&lt;br&gt;
&lt;pre&gt;StringBuilder strb = new StringBuilder ("David");&lt;/pre&gt;
&lt;pre&gt;StringBuilder strb = new StringBuilder ();&lt;/pre&gt;
&lt;pre&gt;StringBuilder strb = new StringBuilder (30);&lt;/pre&gt;&lt;br&gt;
Only difference between these two classes are StringBuffer is synchronized by default while StringBuilder is not. 
&lt;p&gt;
&lt;font color="silver"&gt;&lt;MARQUEE width="50%"&gt;Learn Java&lt;/MARQUEE&gt;&lt;/font&gt;
&lt;p&gt;
&lt;b&gt;&lt;a name="w2c3"&gt;&lt;font color="blue"&gt;OOPs in Java&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;
&lt;p&gt;
Programmers have firmly followed Procedural oriented approach for several decades and there is sudden shift in the software industry for new approach, called OOPs (Object Oriented Programming). Fortran, Pascal, C etc. languages were procedural because these language use procedural or functions to perform a task. Languages like C++, Java are called Object Oriented Programming.
&lt;p&gt;
In procedural method, programmers write set of functions to achieve one task, and whenever he wants to perform new task, then he would be writing a new set functions hence there will be no reusability. If programmers can write the new modules with the help existing old modules, that would be more easy and quick. Due to these reason, a new approach of object oriented programming emerged in the computer software market.
&lt;p&gt;
&lt;b&gt;Features of Object Oriented Programming&lt;/b&gt;
&lt;p&gt;
&lt;b&gt;&lt;font color="red"&gt;Class &amp;amp; Object in Java&lt;/font&gt;&lt;/b&gt;&lt;br /&gt; Infact, whole concept of OOPs is derived from the single notion called object. An object could be anything that exists in the world and can be distinguished from others such that a person, a ball, or a dog etc. All the existing objects have their properties and they can perform some actions such as walking, rolling, barking etc. Let us take an example as an object 'David' person. David is an object and David exists physically and he's got properties like name, sex, color and David can perform actions such as talking, eating etc.  Let us put it in the code snippet &lt;br&gt;
&lt;pre&gt;
String name
Char sex;
int age;
&lt;/pre&gt;
&lt;br&gt;
So, above properties can be similar to other objects such as Mohan who have the same characters (properties) as David. Now what we can think of is they both fall into one class called 'Person' and share the same properties. Now we can say person do not exists but David and Mohan do exist. Another example can be an Animal class and a dog, a tiger, a lion all objects from class Animal.
Let us draw a code snippet for creating a class called 'Animal'. 
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
public class Animal
{
    //properties of an Animal class &amp; variables
    String name;
    int size;
    //Action done by Animal class &amp; method
    void eat()
    {  }
    void sleep()
    {  }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
Now a class model has been built with two variables (name, size) and two methods eat(), sleep(). Let us create an object out of above class Animal. 
&lt;pre&gt; Animal Dave = new Animal();&lt;/pre&gt;

&lt;p&gt;
&lt;b&gt;&lt;font color="red"&gt;Encapsulation in Java: &lt;/font&gt;&lt;/b&gt;&lt;br /&gt; Encapsulation (Hiding Information) is one of the important features of OOPs concepts. Booch says: "Encapsulation is the process of hiding all of the
details of an object that do not contribute to its essential characteristics". Data (variables), Code (methods) in the class are binded together. Variables and methods are called 'members' of the class. If variables are declared by using java keyword 'private', this indicates that variables are only accessible within a class not outside of the class. If a method for a class is declared by using java keyword 'public', it means it is accessible from inside and out of the class. To use those private variables, only way is to go through method and outsiders will not know what is declared in the variables. Outsiders can only use and get results. Hence Encapsulation is the protective mechanism for the members of a class that helps protect sensitive data and code of the software programs. 
&lt;p&gt;
We will declare variables as 'private'. 'private' is called access specifier which makes the members of a class not to be accessible outside the Animal Class. To access these variables we use methods which generally declared as public. Let us have a code snippet which reflects encapsulation in java. Here we build a class 'Animal' and declare its variable as private.&lt;p&gt;
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
public class Animal
  {
     //properties of an Animal class &amp;amp; variables
    private String name;
    private int size;
    //Action done by Animal class &amp;amp; method
    public void talk()
    {
     System.out.println("I am a:" + name);  
     System.out.println("My size is: "+ size);
    }
  }&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
Only talk() method can access to those private variables and by calling talk() method using Animal class object, we can make Animal talk for us.


&lt;p&gt;
&lt;b&gt;&lt;font color="red"&gt;Abstraction in Java&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;
One of the most significant features of Java is 'Abstraction'. It is a technique of choosing common features of objects and methods. There might be too much data in the class and which a user do not require all of them. So using abstraction technique, we can hide unnecessary data and retrieve only the essentials data. Let us take an example of an accountant in a bank. An accountant can view/update its customer informations such as customer name, account number, balance etc. but he/she may not be able to view/update bank's annual profit, or loss amount which is only be available to bank's managers. So these unnecessary data for an accountant are abstracted from him.&lt;br&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
public class Bank
    {
        //properties of a Bank class &amp; variables
       private String name;
       private int acct;
       private double balance;
       private double profit;
       private double loss;

       public void viewAccountant()
       {
           System.out.println("Customer Name:" + name);  
          System.out.println("Customer Account Number: "+ acct);
          System.out.println("Customer Account Balance: "+ balance);

       }
    }
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
In the above code snippet we have been able to abstract unnecessary data and made it available only necessary data to an accountant. Obviously he can not access to bank's annual profit and loss data.
&lt;p&gt;
&lt;b&gt;&lt;font color="red"&gt;Inheritance in Java&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;
We inherit some of the physical characteristics from our parent. Some thing like that in Java programming, new class can be created by inheriting from an existing class. Newly created class is called derived class or sub-class and original class is called base class or super class. Let us have a code snippet to understand Inheritance in more details.&lt;br&gt;
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
 public class A
   {
       String name;
      int acct;
      public void method1()
      {  }
   }
 public class B extends A
         {
         double salary;
     }
      public void method2()
     {  }
    }&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
We can derive all the qualities of the members of class A to members of class B as well as we are able to define new variable for class B. Java keyword 'extends' is used to inherit Class A's characteristics to Class B. if we create an object from class B, it inherits all the members of Class A as well as of class B. 
Inheritance is a significant feature of java programming as it makes easy to manage code, conveniently we can create another class from existing class.

&lt;p&gt;
&lt;b&gt;&lt;font color="red"&gt;Polymorphism in Java&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;
'Poly' meaning 'many' and 'Morphos' meaning 'forms', 'Many Forms', comes from Greek language which describes an ability to generate different many forms. Moreover, it is a technique to redefine methods for derived classes. Such as given a super class &lt;i&gt;shape&lt;/i&gt; polymorphism allow redefining different area methods for any number of derived classes, such as circle, rectangle, and triangles. So programmer can use same method call to perform different operations.
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
public class AnimalTest
    {
        public static void main(String args[])
           {
               Animal animal = new Animal( "tiger");
              animal.talk( );
              Animal animal = new Animal( "Lion");
              animal.talk( );
              Animal animal = new Animal( "Elephant");
              animal.talk( );

          }
    }&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
In Polymorphism, a single variable can be used with different objects of related classes. We can use variable with dot (.) notation with the method() to invoke the method. Such as:&lt;br&gt;
&lt;pre&gt; variable.method()&lt;/pre&gt;mentioned in the above example. 

&lt;p&gt;
&lt;b&gt;&lt;a name="w2c4"&gt;&lt;font color="blue"&gt;Classes &amp;amp; Objects in Java&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;
&lt;p&gt;
We discussed about classes and object little bit in previous chapter. Now we will discuss more about them. An object is the instance of the class as an object is created/instantiated from a class. That is why class is called a model for objects. All the variables and methods created in the class can be inherited to the instance of the class. 
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
class Animal
{
   //instance variables
   String name;
   int size;
   //actions or methods
   void talk()
   {
       System.out.println("Animal has names");
      System.out.println("Animal has size");
   }
}&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
We observe above that java keyword 'class' is used to create a class following with the class name. We declare instance variable and methods for the class. Since the method has void java keyword, it means no result is returned and it does not take any data from us also. Now we will create an object out of the above class.&lt;br&gt;
&lt;pre&gt;Animal animal1 = new Animal();&lt;/pre&gt;&lt;br&gt;
Animal is the class and animal1 is object name. so 'animal1' is reference of Animal object. 'new' operator is used to create object. When object is created, it is stored in 'Heap' memory. Once object is stored, JVM creates a unique reference number called &lt;pre&gt;hash code number&lt;/pre&gt; for the object (animal1) below. Let us create a class 'Animal' and an object 'Lion' to an Animal class. and we will make it hash code display as well.
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre&gt;
class Animal
{
   //instance variables
   String name;
   int size;
   //actions or methods
   void talk()
    {
       System.out.println("Animal has:" + name);
      System.out.println("Animal has:" + size");
    }
} 
class DemoClass
{
  public static void main(String args[])
    {
     Animal animal1 = new Animal();
     animal1.talk();
     //finding hash code of the object
     System.out.println("Hash Code is: " +animal1.hashCode());
    }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
Output of the above code snippet would be as follows: &lt;br&gt;
&lt;pre&gt;Animal has: null (we got null value because we did not initialize instance variables)&lt;/pre&gt;
&lt;pre&gt;Animal has:0 (we got null value because we did not initialize instance variables )&lt;/pre&gt;
&lt;pre&gt;Hash Code is: 25669322&lt;/pre&gt;
&lt;p&gt;
Using reference variables, we can refer to the instance variables and methods such as: &lt;br&gt;
&lt;pre&gt; animal1.name;&lt;/pre&gt;
&lt;pre&gt;animal1.talk(); &lt;/pre&gt;
&lt;p&gt;&lt;b&gt;How to Initialize Instance variables in Java&lt;/b&gt;
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre&gt;
public class DemoInitialize
{
    public static void main(String args[])
    {
       Animal animal1 = new Animal(); //create Animal class object
      animal1.size = 200; //initialize variables using object reference (animal1)
      animal1.talk();
    }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
&lt;b&gt;&lt;font color="blue"&gt;Access Specifiers&lt;/font&gt;&lt;/b&gt;&lt;br&gt;
Let us see how data can be overwritten if access Specifiers is not defined. We will have following code snippet: &lt;br&gt;
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre&gt;
class Animal
{
   String name = "Lion"; //instance variables
   int size = 150; //instance variables
   void makeNoise() {
      System.out.println("It is a :" + name);
      System.out.println("It weighs :" + size);
   }
} 
class DemoSpecifier
{
   public static void main(String args[])
   {
      Animal animal1 = new Animal();
     animal1.name = "Tiger";
     animal1.size = 200;
     animal1.makeNoise(); //calling animal makeNoise() method
   }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
As we clearly see that we did not initialize Animal class with 'private keyword', as a result DemoSpecifier class can access these instance variables and overwrite the value. To protect from overwriting or accessing data from outsider, we use java keyword 'private'. Here is how we can declare instance variables by using 'private' key. &lt;br&gt;
&lt;pre&gt;
private String name = "Lion";
private in size = 150;
&lt;/pre&gt;&lt;br&gt;
Access Specifier is the keyword that specifies how to access to the variables and methods of the class. There are four types of access specifiers in Java.&lt;br&gt;
&lt;b&gt;public: &lt;/b&gt; public access specifier cab be used from inside and outside of the class. &lt;br&gt;
&lt;b&gt;private: &lt;/b&gt; private access specifier is only accessible within same class by the methods but not accessible from outside the class from other programs.&lt;br&gt;
&lt;b&gt;protected: &lt;/b&gt; protected members of a class is accessible from inside and outside of the class but only within the same directory.&lt;br&gt;
&lt;b&gt;default: &lt;/b&gt; If no access specifier is defined, then Java will provide a default specifier which is accessible inside and outside of the class but within the same directory.&lt;br&gt;
&lt;p&gt;
&lt;b&gt;&lt;font color="blue"&gt;Constructor: &lt;/font&gt;&lt;/b&gt; Constructor is like method in java which is used to initialize instance variables. This is third possible ways of initializing instance variables. The only goal of constructor is to initialize instance variables. &lt;br&gt;
&lt;pre&gt;
Constructor's name should be similar to Class's name
Constructor's name should end with opening &amp; closing braces&lt;/pre&gt; such as:
&lt;pre&gt;
Animal( )
{   
}
&lt;/pre&gt;
Constructor may have variables in it which is called constructor's parameters. Constructor's parameters are used to receive data from outside into the constructor. Constructor does not return value and do not use 'void'. During the creation of object, if nothing is passed to the object, the default constructor is called executed. If some values are passed to the object, then parameterized constructor is called. A Constructor is called once per object. Such as if an object is created, and constructor is called. If we create second constructor, again constructor is called. Constructor is called concurrently when an object is created. Here is a simple code snippet for constructor.&lt;br /&gt;
&lt;pre&gt;Animal(String s, int k)
{
}
 &lt;/pre&gt;
&lt;pre&gt;
Animal tiger = new Animal();//default constructor is called
Animal tiger = new Animal("Tiger", 150);
&lt;/pre&gt; //Parameterized constructor will receive "Tiger" and size =150 
&lt;p&gt;
Let us have code snippet with constructor.&lt;br&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre&gt;
public class Animal {
    private String name;//instance variables
    private int size; //instance variables
    //default constructor
    Animal(){
    name = "Tiger";
      size = 150;
    }
    void makeNoise() //actions or methods
    {
       System.out.println("It is a :" + name);
      System.out.println("It weighs :" + size);
    }
}
public class DemoAnimal 
{
    public static void main(String args[])
    {
       Animal tiger = new Animal();//create a Animal object = tiger
      tiger.makeNoise();//calling makeNoise()method.
   
      Animal lion = new Animal();//creating another object = lion
      lion.makeNoise();//calling makeNoise() method.
    }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;
Output would be: &lt;br /&gt;

It is a :Tiger&lt;br /&gt;
It weighs :150&lt;br /&gt;
It is a :Tiger&lt;br /&gt;
It weighs :150&lt;br /&gt;

As we noticed above that both the objects tiger and lion have same output Tiger and 150 respectively. We will resolve this problem by using parameterized constructor which takes data from outside and initialize instance variables with that data.
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
public class Animal 
{
    private String name;//instance variables
    private int size; //instance variables
 
    Animal()//default constructor
    {
       name = "Tiger";
        size = 150;
    }

    Animal(String s, int k)//parameterize constructor
    {
       name = s;
        size = k;
    }
    void makeNoise() //actions or methods
    {
        System.out.println("It is a :" + name);
       System.out.println("It weighs :" + size);
    }
}
public class DemoAnimal 
{
   public static void main(String args[])
   {
        Animal tiger = new Animal();//default constructor is called.
       tiger.makeNoise();//calling makeNoise()method.
   
       Animal lion = new Animal("Lion", 180);//parameterized constructor is called
       lion.makeNoise();//calling makeNoise() method.
   }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;
Output would be:
&lt;pre&gt;
It is a :Tiger
It weighs :150
It is a :Lion
It weighs :180
&lt;/pre&gt;
&lt;p&gt;

So, what we understand from above code that we have parameterized constructor String  s; and int k; and these parameter receive data from outside as from DemoAnimal class such as:&lt;br /&gt;
&lt;pre&gt;Animal lion = new Animal("Lion", 180);&lt;/pre&gt;. Now 'Lion' is copied into parameter s, and 180 pound is copied to parameter k and from there, these values are copied to original instance variables: name, and size. If we do not pass any values while creating a new object, then default constructor is called which is: &lt;pre&gt;Animal tiger = new Animal();&lt;/pre&gt;
&lt;p&gt;
&lt;b&gt;&lt;a name="w2c5"&gt;&lt;font color="blue"&gt;Methods in Java&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;
&lt;p&gt;
Method performs an action in Java which is a set of statements. Action is i.e. calculation, processing data etc. Method name begins with lower case i.e. sqrt() method which calculates square root value. Method contains method name, parameters, method return data type, and method body. This should look as follows.&lt;br /&gt;
&lt;pre&gt;returndatatype methodName(parm1, parm2,…)&lt;/pre&gt;
&lt;pre&gt;int sqrt(int num)&lt;/pre&gt;
When Return data type is 'void', it does not return any value and do not accept data from outside and void method comes with the pair of empty braces '()'and method never returns more than one value such as: &lt;pre&gt;return x, y; &lt;/pre&gt; is invalid statement &lt;br /&gt;
&lt;pre&gt;void methodName()&lt;/pre&gt;
Method body looks as follows: &lt;br /&gt;
&lt;pre&gt;{
Statements;
}&lt;/pre&gt; 
&lt;pre&gt; 
{
int i=a+b;
System.out.println("Total sum is:" +i);
}
&lt;/pre&gt;
If we want to return value then we will have statement look as follows: &lt;br /&gt;
&lt;pre&gt;{
int i = a+b;
return i;
}&lt;/pre&gt;
Let us create a code snippet that explains methods in detail.
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
public class Calc1 
{
    private double num1, num2;//instance variables
    Calc1(double a, double b)//parameterized constructor
    {
        num1 = a;
         num2 = b;
    }
    double sum() //actions or methods
    {
        double tot = num1+num2;
       return tot;
    }
}
public class DemoCalc1 
{
    public static void main(String args[])
    {
        Calc1 c = new Calc1(12, 12.6);//new object is created and pass values to constructor
       double x = c.sum();//calling sum()method and storing total of num1+num2 into x  
    }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
In the above example, sum() method returns the total sum and store the sum into x. and above method is called instance method as it is acting on the instance variables. Method that is not acting on the instance variables is called static method and can not access to instance variable but if variable is declared as 'static', then static method can access to static variables. Static variable is also called 'class variable' and static method is also called 'class method'. &lt;p&gt;
Similarly, local variable or parameters declared inside the method can not be accessed outside the methods such as: 
&lt;pre&gt;
   //instance variable 
   private int x;
   void testMethod(int x):
   {
   x=x;
   }
&lt;/pre&gt; 
In the above code, the local variable is x and only accessible within methods. Now notice that we can see above that the instance variable and local variable are conflicting as both of them are holding the same variable. How do we deal in this kind of situation? Java keyword &lt;pre&gt;'this'&lt;/pre&gt; is used to handle this problem. 'this' keyword refers to the object of the classes where it has been used. Members of the class, instance variable, constructors, methods are referenced by 'this'. 
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
public class Test
{
    private x;//instance variables
    Test()//default constructor
    {
       this(10) //calling present class's default para constructor and pass value 10
      this.sum(); //call present class's method
    }

    Test(int x)//parameterized constructor
    {
       this.x = x; //present class's instance variable
    }
    void sum() //actions or methods
    {
       System.out.println("Sum is: " +x);
     }
}
public class DemoThis 
{ 
    public static void main(String args[])
    {
       Test T = new Test();//new object is created and pass values to constructor 
    }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;
OUTPUT will be: &lt;br /&gt;
Sum is: 10&lt;br /&gt;
An object 'T' is created. Default constructor Test is executed passing value 10 to the instance variable x. Hence, present class's this.x=x; instance variable is initialized and executed giving the result = 10.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt; Setter &amp;amp; Getter Methods&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
Methods that work on the instance variables are called Instance Methods. Instance methods are called from the object using &lt;pre&gt;objectName.methodName()&lt;/pre&gt; and  they can access instance variable as well as static variables. There are two types of Instance methods: &lt;br /&gt;
a) Getter or Accessor Method&lt;br /&gt;
b) Setter or Mutator Method&lt;br /&gt;
Getter or Accessor Method can only access or read instance variable whereas Setter or Mutator method can access and modify instance variable.&lt;br /&gt;
Let us write a code snippet to reflect setter and getter methods
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
public class TestSetterGetter 
{
     private String name;//instance variables
    private char sex;

    void setName(String name)//Setter method to store data
    {
       this.name = name; 
    }
    void setSex(char sex)//Setter method
    {
       this.sex = sex; 
    }
    String getName() //Getter methods to access or read only
    {
       return name; 
    }
    char getSex() //Getter methods to access or read only
    {
       return sex; 
    }
 }
}
public class DemoThis
    {
     public static void main(String args[])
    {
         TestSetterGetter sg= new TestSetterGetter();//new object is created 
        sg.setName("David"); //store data
        sg.setSex('M'); //storing data

        System.out.println("Name:" +sg.getName()); //access data from object
        System.out.println("Gender:" +sg.getSex());
    }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;
OUTPUT will be: &lt;br /&gt;
Name: David&lt;br /&gt;
Gender: M
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt; How to pass primitive data to Methods?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
Primitive data types such as byte, int, short, long etc can store only single value, and they can be passed to methods by values. And only a copy of those data will be passed. Which means any changes taken place inside the method will not impact to the values outside the methods.&lt;p&gt;
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
public class TestPassValue
{
    int x; //instance variables
    void sum(int x)
    {
       this.x=x+1;
    
}
public class DemoThis
{
    public static void main(String args[])
    {
       int x =12;//primitive data
      TestPassValue pv= new TestPassValue();//new object is created 
      pv.sum(x); //call sum method and pass primitive data
      System.out.println("Sum is:" + x); //display data
    }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;
OUTPUT will be: &lt;br /&gt;
Sum is: 12&lt;br /&gt;

&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt; How to pass objects to Methods? &lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
The Class's object can also be passed to methods and return objects from the methods. Reference of the class is declared as parameter to pass object to method. As an example, let us say: &lt;br /&gt;
&lt;pre&gt;
Person theMethod(Person obj1)
{
 statements;
 return obj1;
}
&lt;/pre&gt;
Here theMethod() takes Person class object and Person class is declared in parameter of the method and method returns obj1. Similarly we can pass an array to methods and return arrays from the methods. Let us see how it works: &lt;br /&gt;
&lt;pre&gt;
String[] myMethod(String arr[ ])
&lt;/pre&gt;
In the above code snippet, single dimensional array of String type 'arr' is passed to method 'myMethod.
&lt;p&gt;

&lt;b&gt;&lt;a name="w2c6"&gt;&lt;font color="blue"&gt;Inheritance in Java&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;
&lt;p&gt;
What is Inheritance in Java? Inheritance simply means to inherit the characteristics from the original class. New classes/objects can be created by inheriting few or all the members of the original class allowing the newly created class to perform exactly what the base class can perform. So Inheritance relationship is considered as transitive. 'extends' java keyword or clause is used to inherit characteristics from base class or super class to subclass or derived class.
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
public class Animal 
{
    String name;//instance variables
    int size; //
 
    void setName(String name)//store data
    {
       this.name = name;
    
    void setSize(int size) //actions or methods
    {
      this.size = size;
    }
    String getName(){
       return name;
    }
    int getSize(){
       return size;
    }
}
public class Tiger extends Animal 
{
  int weight;//variable for only Tiger class
  void setWeight(int weight){
     this.weight = weight;
  }
  int getWeight(){
    return weight; 
  }
}

public class TestAnimal{
   public static void main(String args[]){
       Tiger t = new Tiger();
       t.setName("Tiger");
       t.setSize(20);
       t.setWeight(200);
       System.out.println("Name:" + t.getName());
       System.out.println("Size:" + t.getSize());
       System.out.println("Weight:" + t.getWeight());
    } 
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
Super class members are always available for subclass because subclass contains a copy of super class. So the advantage of Inheritance is saving lot of space and easy to develop hence allowing to grow the productivity and efficiency. Programmer can reuse the super class's characteristics without rewriting the whole code. Java keyword 'super' is used to access to super class. If we create an object to super class, we will only be able to access super class members but not be able to access subclass object. In contrary, if an object is created to subclass, both super class members and subclass members can access to it. Super can be used to refer to super class variables as &lt;pre&gt;super.variable&lt;/pre&gt;, super class method as &lt;pre&gt;super.method()&lt;/pre&gt;, and super class constructor as &lt;pre&gt;super(values)&lt;/pre&gt;
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding= "2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
public class SuperClassOne 
{
    int j = 10; //super class variables
    void display()//super class method
    {
       System.out.println("Sum is:" + j);
    }
}
public class SuperClassTwo extends SuperClassOne{
    int j = 15; 
    void display() 
    {
       System.out.println("Sum is:" +j);
      super.display();//using super to call super method
      System.out.println("Sum is:" + super.j); //to call super variable
    }
}
public class TestSuperClass {
    public static void main(String args[]){
       //creating subclass object
      SuperClassTwo sct = new SuperClassTwo();
      sct.display();
    }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;font color="blue"&gt;what is 'Protected Specifier'?&lt;/font&gt;
&lt;p&gt;When private members of the super class are restricted to sub classes. When we want to access private super class member from subclass, we can use java keyword &lt;pre&gt;'protected'&lt;/pre&gt; (specifier). So protected is used in the super class to make members available directly to its sub classes.   
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
public class Shape 
{
    protected double x;//protected specifier variable
    Shape(double x) //parameterized constructor
    {
       this.x=x;
    }
}
public class Square extends Shape{
    Square(double x)//calling super class Shape and send i value
    {
        super(x);
    }
    void area()
    {
        System.out.println("Square Area:" +(x*x));
    }
}
public class ShapeDemo 
{
    public static void main(String args[])
    {
    Square sq = new Square(3.5);//displaying square area
    sq.area();
    }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;
&lt;pre&gt;There are two types of Inheritance: &lt;/pre&gt;Single and Multiple Inheritance. Simply put, one super class and many sub classes is single Inheritance where as multiple super classes and one or more sub classes is Multiple Inheritance. The concept of Multiple Inheritance is true with C++ but in Java, no more &lt;font color="green"&gt;Multiple Inheritance&lt;/font&gt; is accepted or allowed. Multiple Inheritance creates confusions amongst programmers. To accommodate Multiple Inheritance, programmers prefer using &lt;font color="red"&gt;Interface&lt;/font&gt; such as:
&lt;pre&gt;
Class TestClass implements interfaceOne, interfaceTwo,…
&lt;/pre&gt;
Now, TestClass can have all the members of interfaceOne, and interfaceTwo inherited to it.
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7844341291913287808-8516381760123269521?l=javasansar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/8516381760123269521/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7844341291913287808&amp;postID=8516381760123269521' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/8516381760123269521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/8516381760123269521'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/2008/12/week-two-tutorial.html' title='Week Two Tutorial'/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08436281743629996970'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7844341291913287808.post-8541639967386952812</id><published>2008-12-13T19:29:00.008-05:00</published><updated>2009-07-31T23:57:03.075-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Basics'/><title type='text'>Week Two Quiz</title><content type='html'>&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="ffffff"&gt;

&lt;tr&gt;&lt;td bgcolor="#FFFFFF"&gt;
&lt;a href="#w2c1"&gt;&lt;b&gt;Strings in Java&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="#FFFFFF"&gt;
&lt;a href="#w2c2"&gt;&lt;b&gt;StringBuffer &amp;amp; StringBuilder&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;&lt;/tr&gt;

&lt;tr&gt;
&lt;td bgcolor="#FFFFFF"&gt;
&lt;a href="#w2c3"&gt;&lt;b&gt;OOPS in Java&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;
&lt;td&gt;
&lt;a href="http://javasansar.blogspot.com/2008/12/week-one-tutorial.html"&gt;&lt;b&gt;&lt;i&gt;&lt;font color ="#FF6600"&gt;&amp;#8592;Back Week One Tutorial&lt;/font&gt;&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;

&lt;td&gt;
&lt;a href="http://javasansar.blogspot.com/2008/12/week-three-tutorial.html"&gt;&lt;b&gt;&lt;i&gt;&lt;font color ="#FF6600"&gt;Goto Week Three Tutorial&amp;#8594;&lt;/font&gt;&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;

&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="#FFFFFF"&gt;
&lt;a href="#w2c4"&gt;&lt;b&gt;Classes &amp;amp; Objects&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="#FFFFFF"&gt;
&lt;a href="#w2c5"&gt;&lt;b&gt;Methods in Java&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="#FFFFFF"&gt;
&lt;a href="#w2c6"&gt;&lt;b&gt;Inheritance in Java&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;table border="0"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;b&gt;&lt;a name="w2c1"&gt;&lt;font color="blue"&gt;Strings in Java&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;
&lt;p&gt;
A group of characters are called 'Strings'. For example, in a bank, there are credit card numbers, names, and addresses etc. which all are strings. String is an object of String class from the java.lang package. 
There are three ways to create strings in Java Programming:
We can assign a group of characters to a string type variable. Here JVM creates an object and stores string "David" into that object.
&lt;b&gt;&lt;pre&gt;String name="David";&lt;/pre&gt;&lt;/b&gt;
We can use 'new' operator to create an object to String class and store String 'David' into that object as follows:
&lt;b&gt;&lt;pre&gt;String name= new String("David");&lt;/pre&gt;&lt;/b&gt;
Third way of creating strings is converting characters arrays into strings as follows:
&lt;b&gt;&lt;pre&gt;char ch[]={'D', 'a', 'v', 'i', 'd'}&lt;/pre&gt;&lt;/b&gt;
&lt;b&gt;&lt;pre&gt;String name= new String(ch);&lt;/pre&gt;&lt;/b&gt; 
Now the String object ch contains the string 'David'
Java comes with some standard class Methods. Such as follows:
&lt;pre&gt;String concat(String s)&lt;/pre&gt;
&lt;pre&gt;int length();&lt;/pre&gt;
&lt;pre&gt;char charAt(int i)&lt;/pre&gt;
&lt;pre&gt;boolean equals(String s)&lt;/pre&gt;
&lt;pre&gt;int indexOf(String s)&lt;/pre&gt;
Let us have a code snippet which covers few of the above method including how to create strings.
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt; 
&lt;pre&gt;public class MyString{
          Public static void main(String args[]){
          String n1="David"; 
          String n2= new String("MacCain");
          System.out.println("My First Name is:"+n1);//display first string
          System.out.println("My Last Name is: "+n2);//display second string
    
          System.out.println("Length of first name is:" +n1.length());
          System.out.println("My full name is:" +n1.concat(n2));//concatenate two string
      }
  }&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
We have been able to create two string objects, measure the length of characters and we were able to concatenate two strings in one line in the example above. Result of the above code will look like this:&lt;br /&gt;
My First Name is: David&lt;br /&gt;
My Last Name is: MacCain&lt;br /&gt;
Length of first name: 5&lt;br /&gt;
My full name is: David MacCain&lt;br /&gt;

Let us do some String Comparison here. If we want to compare two strings, we will not be able to use relational operators like &amp;lt;, &amp;gt;, == etc. We can use method like compareTo(), equals() to compare two strings. Here is an instance of code to expose the string comparison. &lt;br&gt;
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt; 
&lt;pre&gt;public class MyString{
         Public static void main(String args[]){
         String n1="David"; 
         String n2= new String("David");
         if(n1==n2){
         System.out.println("Both are same");
         }
         else{
         System.out.println("Both are not same");
         }
     }
   }&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
When you run above code, can you guess what would be the output? Output will be: Both are not same. Because we can not use equal sign '==' to compare two strings. If we use a compare method equals() replacing '==' sign, it might solve our problem. Let us replace&lt;b&gt; if(n1==n2)&lt;/b&gt; with the &lt;b&gt;if(n1.equals(n2))&lt;/b&gt; and run the code. Yes this time we get the output: Both are same.
&lt;p&gt;
&lt;b&gt;&lt;a name="w2c2"&gt;&lt;font color="blue"&gt;StringBuffer and StringBuilder in Java&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;
&lt;p&gt;
StringBuffer class is used to represent character that can be modified. It means StringBuffer class objects are mutable unlike Strings that we studied in previous chapter. Mostly StringBuffer is used for concatenation or manipulation of the strings. A StringBuffer implements the mutable sequence of the characters. We can create StringBuffer objects in two ways.
&lt;br /&gt;
&lt;b&gt;By using 'new' operator and passing the string to the object&lt;/b&gt; such as:
&lt;pre&gt;StirngBuffer strb = new StringBuffer("My Java");&lt;/pre&gt; and
&lt;b&gt;By allotting memory to the StringBuffer object using 'new' operator and later storing it into it&lt;/b&gt; such as:
&lt;pre&gt;StirngBuffer strb = new StringBuffer();&lt;/pre&gt;
Here we are creating a StringBuffer empty object but not passing any string to it. StringBuffer will be created with 16 characters with default values.&lt;br&gt;
&lt;pre&gt;StringBuffer strb = new StringBuffer(30);&lt;/pre&gt;&lt;br&gt;
What above code explains is that StringBuffer is created with 30 characters capacity. Now, is it possible to store more than 30 characters? Yes because StringBuffer has mutability feature, it can be modified. We can use append(), or insert() method to do it.
&lt;p&gt;
Let us have a code snippet to reflect preceding chapters. 
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
import java.io.*;
public class MyStringBuffer{
    public static void main(String args[]) throws IOException
    {
       StringBuffer strb= new StringBuffer();//creates empty stringbuffer object
      BufferedReader br= new BufferedReader(new InputStreamReader(System.in)); //input from keyboard

      System.out.print("What is you First Name: ");
      String fn = br.readLine();

      System.out.print("What is your middle name:");
      String mn = br.readLine();

      System.out.print("What is your last name:");
      String ln = br.readLine();
      //append first name and lastname
      strb.append(fn);
      strb.append(ln);
      //display only first name and last name upto this point
      //System.out.println("My name is: " + strb);

      //lets insert middle name
      int n = fn.length(); //n represent no. of characters
      strb.insert(n, mn);//insert middle name after n characters
      System.out.println("My full name is:"+ strb);//display full name now 
   }
} &lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
We have tried to append first name and last name and we were able to print out the results displaying first and last name in the monitor. Then, we realized that we'd missed the middle name. How do we append middle name, then? By using insert() method, we can append middle name as in above example code.
&lt;p&gt;
&lt;b&gt;StringBuilder Class. &lt;/b&gt;&lt;br&gt;
We have had StringBuilder Class only after JDK1.5 which contains same sort of features as StringBuffer Class does. StringBuilder Class is also mutable and modifiable as StringBuffer.&lt;br&gt;
&lt;pre&gt;StringBuilder strb = new StringBuilder ("David");&lt;/pre&gt;
&lt;pre&gt;StringBuilder strb = new StringBuilder ();&lt;/pre&gt;
&lt;pre&gt;StringBuilder strb = new StringBuilder (30);&lt;/pre&gt;&lt;br&gt;
Only difference between these two classes are StringBuffer is synchronized by default while StringBuilder is not. 
&lt;p&gt;
&lt;font color="silver"&gt;&lt;MARQUEE width="50%"&gt;Learn Java&lt;/MARQUEE&gt;&lt;/font&gt;
&lt;p&gt;
&lt;b&gt;&lt;a name="w2c3"&gt;&lt;font color="blue"&gt;OOPs in Java&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;
&lt;p&gt;
Programmers have firmly followed Procedural oriented approach for several decades and there is sudden shift in the software industry for new approach, called OOPs (Object Oriented Programming). Fortran, Pascal, C etc. languages were procedural because these language use procedural or functions to perform a task. Languages like C++, Java are called Object Oriented Programming.
&lt;p&gt;
In procedural method, programmers write set of functions to achieve one task, and whenever he wants to perform new task, then he would be writing a new set functions hence there will be no reusability. If programmers can write the new modules with the help existing old modules, that would be more easy and quick. Due to these reason, a new approach of object oriented programming emerged in the computer software market.
&lt;p&gt;
&lt;b&gt;Features of Object Oriented Programming&lt;/b&gt;
&lt;p&gt;
&lt;b&gt;&lt;font color="red"&gt;Class &amp;amp; Object in Java&lt;/font&gt;&lt;/b&gt;&lt;br /&gt; Infact, whole concept of OOPs is derived from the single notion called object. An object could be anything that exists in the world and can be distinguished from others such that a person, a ball, or a dog etc. All the existing objects have their properties and they can perform some actions such as walking, rolling, barking etc. Let us take an example as an object 'David' person. David is an object and David exists physically and he's got properties like name, sex, color and David can perform actions such as talking, eating etc.  Let us put it in the code snippet &lt;br&gt;
&lt;pre&gt;
String name
Char sex;
int age;
&lt;/pre&gt;
&lt;br&gt;
So, above properties can be similar to other objects such as Mohan who have the same characters (properties) as David. Now what we can think of is they both fall into one class called 'Person' and share the same properties. Now we can say person do not exists but David and Mohan do exist. Another example can be an Animal class and a dog, a tiger, a lion all objects from class Animal.
Let us draw a code snippet for creating a class called 'Animal'. 
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
public class Animal
{
    //properties of an Animal class &amp; variables
    String name;
    int size;
    //Action done by Animal class &amp; method
    void eat()
    {  }
    void sleep()
    {  }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
Now a class model has been built with two variables (name, size) and two methods eat(), sleep(). Let us create an object out of above class Animal. 
&lt;pre&gt; Animal Dave = new Animal();&lt;/pre&gt;

&lt;p&gt;
&lt;b&gt;&lt;font color="red"&gt;Encapsulation in Java: &lt;/font&gt;&lt;/b&gt;&lt;br /&gt; Encapsulation (Hiding Information) is one of the important features of OOPs concepts. Booch says: "Encapsulation is the process of hiding all of the
details of an object that do not contribute to its essential characteristics". Data (variables), Code (methods) in the class are binded together. Variables and methods are called 'members' of the class. If variables are declared by using java keyword 'private', this indicates that variables are only accessible within a class not outside of the class. If a method for a class is declared by using java keyword 'public', it means it is accessible from inside and out of the class. To use those private variables, only way is to go through method and outsiders will not know what is declared in the variables. Outsiders can only use and get results. Hence Encapsulation is the protective mechanism for the members of a class that helps protect sensitive data and code of the software programs. 
&lt;p&gt;
We will declare variables as 'private'. 'private' is called access specifier which makes the members of a class not to be accessible outside the Animal Class. To access these variables we use methods which generally declared as public. Let us have a code snippet which reflects encapsulation in java. Here we build a class 'Animal' and declare its variable as private.&lt;p&gt;
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
public class Animal
  {
     //properties of an Animal class &amp;amp; variables
    private String name;
    private int size;
    //Action done by Animal class &amp;amp; method
    public void talk()
    {
     System.out.println("I am a:" + name);  
     System.out.println("My size is: "+ size);
    }
  }&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
Only talk() method can access to those private variables and by calling talk() method using Animal class object, we can make Animal talk for us.


&lt;p&gt;
&lt;b&gt;&lt;font color="red"&gt;Abstraction in Java&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;
One of the most significant features of Java is 'Abstraction'. It is a technique of choosing common features of objects and methods. There might be too much data in the class and which a user do not require all of them. So using abstraction technique, we can hide unnecessary data and retrieve only the essentials data. Let us take an example of an accountant in a bank. An accountant can view/update its customer informations such as customer name, account number, balance etc. but he/she may not be able to view/update bank's annual profit, or loss amount which is only be available to bank's managers. So these unnecessary data for an accountant are abstracted from him.&lt;br&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
public class Bank
    {
        //properties of a Bank class &amp; variables
       private String name;
       private int acct;
       private double balance;
       private double profit;
       private double loss;

       public void viewAccountant()
       {
           System.out.println("Customer Name:" + name);  
          System.out.println("Customer Account Number: "+ acct);
          System.out.println("Customer Account Balance: "+ balance);

       }
    }
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
In the above code snippet we have been able to abstract unnecessary data and made it available only necessary data to an accountant. Obviously he can not access to bank's annual profit and loss data.
&lt;p&gt;
&lt;b&gt;&lt;font color="red"&gt;Inheritance in Java&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;
We inherit some of the physical characteristics from our parent. Some thing like that in Java programming, new class can be created by inheriting from an existing class. Newly created class is called derived class or sub-class and original class is called base class or super class. Let us have a code snippet to understand Inheritance in more details.&lt;br&gt;
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
 public class A
   {
       String name;
      int acct;
      public void method1()
      {  }
   }
 public class B extends A
         {
         double salary;
     }
      public void method2()
     {  }
    }&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
We can derive all the qualities of the members of class A to members of class B as well as we are able to define new variable for class B. Java keyword 'extends' is used to inherit Class A's characteristics to Class B. if we create an object from class B, it inherits all the members of Class A as well as of class B. 
Inheritance is a significant feature of java programming as it makes easy to manage code, conveniently we can create another class from existing class.

&lt;p&gt;
&lt;b&gt;&lt;font color="red"&gt;Polymorphism in Java&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;
'Poly' meaning 'many' and 'Morphos' meaning 'forms', 'Many Forms', comes from Greek language which describes an ability to generate different many forms. Moreover, it is a technique to redefine methods for derived classes. Such as given a super class &lt;i&gt;shape&lt;/i&gt; polymorphism allow redefining different area methods for any number of derived classes, such as circle, rectangle, and triangles. So programmer can use same method call to perform different operations.
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
public class AnimalTest
    {
        public static void main(String args[])
           {
               Animal animal = new Animal( "tiger");
              animal.talk( );
              Animal animal = new Animal( "Lion");
              animal.talk( );
              Animal animal = new Animal( "Elephant");
              animal.talk( );

          }
    }&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
In Polymorphism, a single variable can be used with different objects of related classes. We can use variable with dot (.) notation with the method() to invoke the method. Such as:&lt;br&gt;
&lt;pre&gt; variable.method()&lt;/pre&gt;mentioned in the above example. 

&lt;p&gt;
&lt;b&gt;&lt;a name="w2c4"&gt;&lt;font color="blue"&gt;Classes &amp;amp; Objects in Java&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;
&lt;p&gt;
We discussed about classes and object little bit in previous chapter. Now we will discuss more about them. An object is the instance of the class as an object is created/instantiated from a class. That is why class is called a model for objects. All the variables and methods created in the class can be inherited to the instance of the class. 
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
class Animal
{
   //instance variables
   String name;
   int size;
   //actions or methods
   void talk()
   {
       System.out.println("Animal has names");
      System.out.println("Animal has size");
   }
}&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
We observe above that java keyword 'class' is used to create a class following with the class name. We declare instance variable and methods for the class. Since the method has void java keyword, it means no result is returned and it does not take any data from us also. Now we will create an object out of the above class.&lt;br&gt;
&lt;pre&gt;Animal animal1 = new Animal();&lt;/pre&gt;&lt;br&gt;
Animal is the class and animal1 is object name. so 'animal1' is reference of Animal object. 'new' operator is used to create object. When object is created, it is stored in 'Heap' memory. Once object is stored, JVM creates a unique reference number called &lt;pre&gt;hash code number&lt;/pre&gt; for the object (animal1) below. Let us create a class 'Animal' and an object 'Lion' to an Animal class. and we will make it hash code display as well.
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre&gt;
class Animal
{
   //instance variables
   String name;
   int size;
   //actions or methods
   void talk()
    {
       System.out.println("Animal has:" + name);
      System.out.println("Animal has:" + size");
    }
} 
class DemoClass
{
  public static void main(String args[])
    {
     Animal animal1 = new Animal();
     animal1.talk();
     //finding hash code of the object
     System.out.println("Hash Code is: " +animal1.hashCode());
    }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
Output of the above code snippet would be as follows: &lt;br&gt;
&lt;pre&gt;Animal has: null (we got null value because we did not initialize instance variables)&lt;/pre&gt;
&lt;pre&gt;Animal has:0 (we got null value because we did not initialize instance variables )&lt;/pre&gt;
&lt;pre&gt;Hash Code is: 25669322&lt;/pre&gt;
&lt;p&gt;
Using reference variables, we can refer to the instance variables and methods such as: &lt;br&gt;
&lt;pre&gt; animal1.name;&lt;/pre&gt;
&lt;pre&gt;animal1.talk(); &lt;/pre&gt;
&lt;p&gt;&lt;b&gt;How to Initialize Instance variables in Java&lt;/b&gt;
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre&gt;
public class DemoInitialize
{
    public static void main(String args[])
    {
       Animal animal1 = new Animal(); //create Animal class object
      animal1.size = 200; //initialize variables using object reference (animal1)
      animal1.talk();
    }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
&lt;b&gt;&lt;font color="blue"&gt;Access Specifiers&lt;/font&gt;&lt;/b&gt;&lt;br&gt;
Let us see how data can be overwritten if access Specifiers is not defined. We will have following code snippet: &lt;br&gt;
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre&gt;
class Animal
{
   String name = "Lion"; //instance variables
   int size = 150; //instance variables
   void makeNoise() {
      System.out.println("It is a :" + name);
      System.out.println("It weighs :" + size);
   }
} 
class DemoSpecifier
{
   public static void main(String args[])
   {
      Animal animal1 = new Animal();
     animal1.name = "Tiger";
     animal1.size = 200;
     animal1.makeNoise(); //calling animal makeNoise() method
   }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
As we clearly see that we did not initialize Animal class with 'private keyword', as a result DemoSpecifier class can access these instance variables and overwrite the value. To protect from overwriting or accessing data from outsider, we use java keyword 'private'. Here is how we can declare instance variables by using 'private' key. &lt;br&gt;
&lt;pre&gt;
private String name = "Lion";
private in size = 150;
&lt;/pre&gt;&lt;br&gt;
Access Specifier is the keyword that specifies how to access to the variables and methods of the class. There are four types of access specifiers in Java.&lt;br&gt;
&lt;b&gt;public: &lt;/b&gt; public access specifier cab be used from inside and outside of the class. &lt;br&gt;
&lt;b&gt;private: &lt;/b&gt; private access specifier is only accessible within same class by the methods but not accessible from outside the class from other programs.&lt;br&gt;
&lt;b&gt;protected: &lt;/b&gt; protected members of a class is accessible from inside and outside of the class but only within the same directory.&lt;br&gt;
&lt;b&gt;default: &lt;/b&gt; If no access specifier is defined, then Java will provide a default specifier which is accessible inside and outside of the class but within the same directory.&lt;br&gt;
&lt;p&gt;
&lt;b&gt;&lt;font color="blue"&gt;Constructor: &lt;/font&gt;&lt;/b&gt; Constructor is like method in java which is used to initialize instance variables. This is third possible ways of initializing instance variables. The only goal of constructor is to initialize instance variables. &lt;br&gt;
&lt;pre&gt;
Constructor's name should be similar to Class's name
Constructor's name should end with opening &amp; closing braces&lt;/pre&gt; such as:
&lt;pre&gt;
Animal( )
{   
}
&lt;/pre&gt;
Constructor may have variables in it which is called constructor's parameters. Constructor's parameters are used to receive data from outside into the constructor. Constructor does not return value and do not use 'void'. During the creation of object, if nothing is passed to the object, the default constructor is called executed. If some values are passed to the object, then parameterized constructor is called. A Constructor is called once per object. Such as if an object is created, and constructor is called. If we create second constructor, again constructor is called. Constructor is called concurrently when an object is created. Here is a simple code snippet for constructor.&lt;br /&gt;
&lt;pre&gt;Animal(String s, int k)
{
}
 &lt;/pre&gt;
&lt;pre&gt;
Animal tiger = new Animal();//default constructor is called
Animal tiger = new Animal("Tiger", 150);
&lt;/pre&gt; //Parameterized constructor will receive "Tiger" and size =150 
&lt;p&gt;
Let us have code snippet with constructor.&lt;br&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre&gt;
public class Animal {
    private String name;//instance variables
    private int size; //instance variables
    //default constructor
    Animal(){
    name = "Tiger";
      size = 150;
    }
    void makeNoise() //actions or methods
    {
       System.out.println("It is a :" + name);
      System.out.println("It weighs :" + size);
    }
}
public class DemoAnimal 
{
    public static void main(String args[])
    {
       Animal tiger = new Animal();//create a Animal object = tiger
      tiger.makeNoise();//calling makeNoise()method.
   
      Animal lion = new Animal();//creating another object = lion
      lion.makeNoise();//calling makeNoise() method.
    }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;
Output would be: &lt;br /&gt;

It is a :Tiger&lt;br /&gt;
It weighs :150&lt;br /&gt;
It is a :Tiger&lt;br /&gt;
It weighs :150&lt;br /&gt;

As we noticed above that both the objects tiger and lion have same output Tiger and 150 respectively. We will resolve this problem by using parameterized constructor which takes data from outside and initialize instance variables with that data.
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
public class Animal 
{
    private String name;//instance variables
    private int size; //instance variables
 
    Animal()//default constructor
    {
       name = "Tiger";
        size = 150;
    }

    Animal(String s, int k)//parameterize constructor
    {
       name = s;
        size = k;
    }
    void makeNoise() //actions or methods
    {
        System.out.println("It is a :" + name);
       System.out.println("It weighs :" + size);
    }
}
public class DemoAnimal 
{
   public static void main(String args[])
   {
        Animal tiger = new Animal();//default constructor is called.
       tiger.makeNoise();//calling makeNoise()method.
   
       Animal lion = new Animal("Lion", 180);//parameterized constructor is called
       lion.makeNoise();//calling makeNoise() method.
   }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;
Output would be:
&lt;pre&gt;
It is a :Tiger
It weighs :150
It is a :Lion
It weighs :180
&lt;/pre&gt;
&lt;p&gt;

So, what we understand from above code that we have parameterized constructor String  s; and int k; and these parameter receive data from outside as from DemoAnimal class such as:&lt;br /&gt;
&lt;pre&gt;Animal lion = new Animal("Lion", 180);&lt;/pre&gt;. Now 'Lion' is copied into parameter s, and 180 pound is copied to parameter k and from there, these values are copied to original instance variables: name, and size. If we do not pass any values while creating a new object, then default constructor is called which is: &lt;pre&gt;Animal tiger = new Animal();&lt;/pre&gt;
&lt;p&gt;
&lt;b&gt;&lt;a name="w2c5"&gt;&lt;font color="blue"&gt;Methods in Java&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;
&lt;p&gt;
Method performs an action in Java which is a set of statements. Action is i.e. calculation, processing data etc. Method name begins with lower case i.e. sqrt() method which calculates square root value. Method contains method name, parameters, method return data type, and method body. This should look as follows.&lt;br /&gt;
&lt;pre&gt;returndatatype methodName(parm1, parm2,…)&lt;/pre&gt;
&lt;pre&gt;int sqrt(int num)&lt;/pre&gt;
When Return data type is 'void', it does not return any value and do not accept data from outside and void method comes with the pair of empty braces '()'and method never returns more than one value such as: &lt;pre&gt;return x, y; &lt;/pre&gt; is invalid statement &lt;br /&gt;
&lt;pre&gt;void methodName()&lt;/pre&gt;
Method body looks as follows: &lt;br /&gt;
&lt;pre&gt;{
Statements;
}&lt;/pre&gt; 
&lt;pre&gt; 
{
int i=a+b;
System.out.println("Total sum is:" +i);
}
&lt;/pre&gt;
If we want to return value then we will have statement look as follows: &lt;br /&gt;
&lt;pre&gt;{
int i = a+b;
return i;
}&lt;/pre&gt;
Let us create a code snippet that explains methods in detail.
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
public class Calc1 
{
    private double num1, num2;//instance variables
    Calc1(double a, double b)//parameterized constructor
    {
        num1 = a;
         num2 = b;
    }
    double sum() //actions or methods
    {
        double tot = num1+num2;
       return tot;
    }
}
public class DemoCalc1 
{
    public static void main(String args[])
    {
        Calc1 c = new Calc1(12, 12.6);//new object is created and pass values to constructor
       double x = c.sum();//calling sum()method and storing total of num1+num2 into x  
    }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
In the above example, sum() method returns the total sum and store the sum into x. and above method is called instance method as it is acting on the instance variables. Method that is not acting on the instance variables is called static method and can not access to instance variable but if variable is declared as 'static', then static method can access to static variables. Static variable is also called 'class variable' and static method is also called 'class method'. &lt;p&gt;
Similarly, local variable or parameters declared inside the method can not be accessed outside the methods such as: 
&lt;pre&gt;
   //instance variable 
   private int x;
   void testMethod(int x):
   {
   x=x;
   }
&lt;/pre&gt; 
In the above code, the local variable is x and only accessible within methods. Now notice that we can see above that the instance variable and local variable are conflicting as both of them are holding the same variable. How do we deal in this kind of situation? Java keyword &lt;pre&gt;'this'&lt;/pre&gt; is used to handle this problem. 'this' keyword refers to the object of the classes where it has been used. Members of the class, instance variable, constructors, methods are referenced by 'this'. 
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
public class Test
{
    private x;//instance variables
    Test()//default constructor
    {
       this(10) //calling present class's default para constructor and pass value 10
      this.sum(); //call present class's method
    }

    Test(int x)//parameterized constructor
    {
       this.x = x; //present class's instance variable
    }
    void sum() //actions or methods
    {
       System.out.println("Sum is: " +x);
     }
}
public class DemoThis 
{ 
    public static void main(String args[])
    {
       Test T = new Test();//new object is created and pass values to constructor 
    }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;
OUTPUT will be: &lt;br /&gt;
Sum is: 10&lt;br /&gt;
An object 'T' is created. Default constructor Test is executed passing value 10 to the instance variable x. Hence, present class's this.x=x; instance variable is initialized and executed giving the result = 10.
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt; Setter &amp;amp; Getter Methods&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
Methods that work on the instance variables are called Instance Methods. Instance methods are called from the object using &lt;pre&gt;objectName.methodName()&lt;/pre&gt; and  they can access instance variable as well as static variables. There are two types of Instance methods: &lt;br /&gt;
a) Getter or Accessor Method&lt;br /&gt;
b) Setter or Mutator Method&lt;br /&gt;
Getter or Accessor Method can only access or read instance variable whereas Setter or Mutator method can access and modify instance variable.&lt;br /&gt;
Let us write a code snippet to reflect setter and getter methods
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
public class TestSetterGetter 
{
     private String name;//instance variables
    private char sex;

    void setName(String name)//Setter method to store data
    {
       this.name = name; 
    }
    void setSex(char sex)//Setter method
    {
       this.sex = sex; 
    }
    String getName() //Getter methods to access or read only
    {
       return name; 
    }
    char getSex() //Getter methods to access or read only
    {
       return sex; 
    }
 }
}
public class DemoThis
    {
     public static void main(String args[])
    {
         TestSetterGetter sg= new TestSetterGetter();//new object is created 
        sg.setName("David"); //store data
        sg.setSex('M'); //storing data

        System.out.println("Name:" +sg.getName()); //access data from object
        System.out.println("Gender:" +sg.getSex());
    }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;
OUTPUT will be: &lt;br /&gt;
Name: David&lt;br /&gt;
Gender: M
&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt; How to pass primitive data to Methods?&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
Primitive data types such as byte, int, short, long etc can store only single value, and they can be passed to methods by values. And only a copy of those data will be passed. Which means any changes taken place inside the method will not impact to the values outside the methods.&lt;p&gt;
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
public class TestPassValue
{
    int x; //instance variables
    void sum(int x)
    {
       this.x=x+1;
    
}
public class DemoThis
{
    public static void main(String args[])
    {
       int x =12;//primitive data
      TestPassValue pv= new TestPassValue();//new object is created 
      pv.sum(x); //call sum method and pass primitive data
      System.out.println("Sum is:" + x); //display data
    }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;
OUTPUT will be: &lt;br /&gt;
Sum is: 12&lt;br /&gt;

&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt; How to pass objects to Methods? &lt;/b&gt;&lt;/font&gt;&lt;br /&gt;
The Class's object can also be passed to methods and return objects from the methods. Reference of the class is declared as parameter to pass object to method. As an example, let us say: &lt;br /&gt;
&lt;pre&gt;
Person theMethod(Person obj1)
{
 statements;
 return obj1;
}
&lt;/pre&gt;
Here theMethod() takes Person class object and Person class is declared in parameter of the method and method returns obj1. Similarly we can pass an array to methods and return arrays from the methods. Let us see how it works: &lt;br /&gt;
&lt;pre&gt;
String[] myMethod(String arr[ ])
&lt;/pre&gt;
In the above code snippet, single dimensional array of String type 'arr' is passed to method 'myMethod.
&lt;p&gt;

&lt;b&gt;&lt;a name="w2c6"&gt;&lt;font color="blue"&gt;Inheritance in Java&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;
&lt;p&gt;
What is Inheritance in Java? Inheritance simply means to inherit the characteristics from the original class. New classes/objects can be created by inheriting few or all the members of the original class allowing the newly created class to perform exactly what the base class can perform. So Inheritance relationship is considered as transitive. 'extends' java keyword or clause is used to inherit characteristics from base class or super class to subclass or derived class.
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
public class Animal 
{
    String name;//instance variables
    int size; //
 
    void setName(String name)//store data
    {
       this.name = name;
    
    void setSize(int size) //actions or methods
    {
      this.size = size;
    }
    String getName(){
       return name;
    }
    int getSize(){
       return size;
    }
}
public class Tiger extends Animal 
{
  int weight;//variable for only Tiger class
  void setWeight(int weight){
     this.weight = weight;
  }
  int getWeight(){
    return weight; 
  }
}

public class TestAnimal{
   public static void main(String args[]){
       Tiger t = new Tiger();
       t.setName("Tiger");
       t.setSize(20);
       t.setWeight(200);
       System.out.println("Name:" + t.getName());
       System.out.println("Size:" + t.getSize());
       System.out.println("Weight:" + t.getWeight());
    } 
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
Super class members are always available for subclass because subclass contains a copy of super class. So the advantage of Inheritance is saving lot of space and easy to develop hence allowing to grow the productivity and efficiency. Programmer can reuse the super class's characteristics without rewriting the whole code. Java keyword 'super' is used to access to super class. If we create an object to super class, we will only be able to access super class members but not be able to access subclass object. In contrary, if an object is created to subclass, both super class members and subclass members can access to it. Super can be used to refer to super class variables as &lt;pre&gt;super.variable&lt;/pre&gt;, super class method as &lt;pre&gt;super.method()&lt;/pre&gt;, and super class constructor as &lt;pre&gt;super(values)&lt;/pre&gt;
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding= "2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
public class SuperClassOne 
{
    int j = 10; //super class variables
    void display()//super class method
    {
       System.out.println("Sum is:" + j);
    }
}
public class SuperClassTwo extends SuperClassOne{
    int j = 15; 
    void display() 
    {
       System.out.println("Sum is:" +j);
      super.display();//using super to call super method
      System.out.println("Sum is:" + super.j); //to call super variable
    }
}
public class TestSuperClass {
    public static void main(String args[]){
       //creating subclass object
      SuperClassTwo sct = new SuperClassTwo();
      sct.display();
    }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;font color="blue"&gt;what is 'Protected Specifier'?&lt;/font&gt;
&lt;p&gt;When private members of the super class are restricted to sub classes. When we want to access private super class member from subclass, we can use java keyword &lt;pre&gt;'protected'&lt;/pre&gt; (specifier). So protected is used in the super class to make members available directly to its sub classes.   
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
public class Shape 
{
    protected double x;//protected specifier variable
    Shape(double x) //parameterized constructor
    {
       this.x=x;
    }
}
public class Square extends Shape{
    Square(double x)//calling super class Shape and send i value
    {
        super(x);
    }
    void area()
    {
        System.out.println("Square Area:" +(x*x));
    }
}
public class ShapeDemo 
{
    public static void main(String args[])
    {
    Square sq = new Square(3.5);//displaying square area
    sq.area();
    }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;
&lt;pre&gt;There are two types of Inheritance: &lt;/pre&gt;Single and Multiple Inheritance. Simply put, one super class and many sub classes is single Inheritance where as multiple super classes and one or more sub classes is Multiple Inheritance. The concept of Multiple Inheritance is true with C++ but in Java, no more &lt;font color="green"&gt;Multiple Inheritance&lt;/font&gt; is accepted or allowed. Multiple Inheritance creates confusions amongst programmers. To accommodate Multiple Inheritance, programmers prefer using &lt;font color="red"&gt;Interface&lt;/font&gt; such as:
&lt;pre&gt;
Class TestClass implements interfaceOne, interfaceTwo,…
&lt;/pre&gt;
Now, TestClass can have all the members of interfaceOne, and interfaceTwo inherited to it.
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7844341291913287808-8541639967386952812?l=javasansar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/8541639967386952812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7844341291913287808&amp;postID=8541639967386952812' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/8541639967386952812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/8541639967386952812'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/2008/12/week-two-quiz.html' title='Week Two Quiz'/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08436281743629996970'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7844341291913287808.post-2262800423417524367</id><published>2008-12-13T19:27:00.010-05:00</published><updated>2009-08-01T00:17:09.461-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Basics'/><title type='text'>Week Three Tutorial</title><content type='html'>&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="FFFFFF"&gt;

&lt;tr&gt;&lt;td bgcolor="#FFFFFF"&gt;
&lt;a href="#w3c1"&gt;&lt;b&gt;Polymorphism&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="#FFFFFF"&gt;
&lt;a href="#w3c2"&gt;&lt;b&gt;Type Casting&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;
&lt;td&gt;
&lt;a href="http://javasansar.blogspot.com/2008/12/week-two-tutorial.html"&gt;&lt;b&gt;&lt;i&gt;&lt;font color ="#FF6600"&gt;&amp;#8592; Back Week Two Tutorial&lt;/font&gt;&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;
&lt;/td&gt;

&lt;td&gt;
&lt;a href="http://javasansar.blogspot.com/2008/12/week-four-tutorial.html"&gt;&lt;b&gt;&lt;i&gt;&lt;font color ="#FF6600"&gt;Goto Week Four Tutorial&amp;#8594;&lt;/font&gt;&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;
&lt;/td&gt;

&lt;/tr&gt;
&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="#FFFFFF"&gt;
&lt;a href="#w3c3"&gt;&lt;b&gt;Abstract Classes&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="#FFFFFF"&gt;
&lt;a href="#w3c4"&gt;&lt;b&gt;Interfaces &lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="#FFFFFF"&gt;
&lt;a href="#w3c5"&gt;&lt;b&gt;Packages&lt;/b&gt;&lt;/a&gt; 
&lt;/td &gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="#FFFFFF"&gt;
&lt;a href="#w3c6"&gt;&lt;b&gt;Exceptional Handling&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;
&lt;b&gt;&lt;a name="w3c1"&gt;&lt;font color="blue"&gt;Polymorphism in Java&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;
&lt;p&gt;
'Poly' meaning many and morph or morphos meaning forms or shapes, many forms or &lt;font color="navy "&gt;Polymorphism&lt;/font&gt; comes from Greek word. So, Polymorphism is an aspect of having different forms and ability to perform multiple tasks. In Java Programming, same method or an object or variable can perform different tasks making programming efficient and flexible. When we talk about Polymorphism, we talk about two most popular types: a) overriding b) overloading. Dynamic method binding is also part of it.  Let's take an example: We have Calculation to be make of x=0.2/5 and data type is I/D (Int/Double). The java compiler will make calculation based on what is larger ratio data type (D) and converts and result would be double. If we don't want to be converted to larger ratio data type, we can use a method called a &lt;b&gt;Cast Operator&lt;/b&gt;. Here is an example.
&lt;pre&gt;
Double a = 10.2D;
Int x = (int) a;
&lt;/pre&gt;
Because we have specified a variable as Int type in the second line, it will not convert to double rather it will convert into INT data type. What we've seen here is 'a' exists in two data type forms, one as double and another as Int. This is also called data type conversion. Conversion is an explicit change in the data type which is specified by the cast operator. When we call methods, we may use same method names but function may be different.&lt;br /&gt;

&lt;b&gt;&lt;font color= "navy"&gt;&lt;a name="DP"&gt;Dynamic Polymorphism&lt;/a&gt;&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;
When polymorphism is performed at runtime, it is called Dynamic Polymorphism. Java compiler does not know what method is called at the compilation time. Only Java Virtual Machine (JVM) knows which method should be run at runtime. This is also called &lt;i&gt;Dynamic Binding&lt;/i&gt; or &lt;i&gt;Runtime Polymorphism&lt;/i&gt;. We will write a sample program called 'MyPoly' for Dynamic Polymorphism.
&lt;p&gt;
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
public class MyPoly 
{
    void add(int a, int b)
    {
     System.out.println("Sum of Two Num" + (a+b));
    }
   void add(int a, int b, int c)
    {
    System.out.println("Sum of Three Num" +(a+b+c));
    }
} 
public class DemoPoly 
{
    public static void main(String arg[])
    {
        MyPoly mp = new MyPoly(); //Creating MyPoly object
        mp.add(10, 20); //this method call goes to first method
       mp.add(10, 20, 30); //calling second method
    }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
In the above code snippet, we have two identical method names 'add'. Even though they have same names they perform different tasks based on their bodies as first method attempts to add two numbers whereas second number attempts to add three numbers. Now, these methods are executed at runtime as object is created at runtime and methods comes after the creation of the object. JVM picks the method based on the signatures of the methods. &lt;a name ="ms"&gt;Methods Signatures&lt;/a&gt; are method name and the parameters. &lt;br /&gt;
a) Difference in number i.e in the following example, if we call add(10, 12), it will pick up first method as it got two int data type.&lt;br /&gt;
void add(int x, int y) // will be called first&lt;br /&gt;
void add(int x, int y, int z) called second&lt;br /&gt;
&lt;br /&gt;
b) Difference in data type i.e. if we call a method add(3d, 10d), it will call second method &lt;br /&gt;
void add(int x, float b) &lt;br /&gt;
void add(double x, double y) &lt;br /&gt;
&lt;br /&gt;
c) difference in order (sequence) i.e. if we call add(3.9, 10), JVM will executes second method first &lt;br /&gt;
void add(int x, float b) &lt;br /&gt;
void add(float x, int b) &lt;br /&gt;
These are the key reasons that triggers which method is called first
&lt;p&gt;
&lt;b&gt;&lt;font color= "navy"&gt;&lt;i&gt;Method Overloading&lt;/i&gt;&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;
Two methods having the same names in a class but having different &lt;a href="#ms"&gt;Method Signatures&lt;/a&gt; is called Method Overloading. Method Overloading recognizes methods separately by looking at the difference in the method signatures such as difference in no. of parameters or data types of the parameter or in sequence parameters. So, &lt;a href="#DP"&gt;Dynamic Polymorphism &lt;/a&gt; is an example of Method Overloading. If programmer wants to have two same methods names and same method signatures within a same class, it is not possible. But what is possible is that we need two have two separate classes to have this kind of scenarios such that a super class and subclass can have two same method names with the same method signatures.

&lt;p&gt;
&lt;b&gt;&lt;font color= "navy"&gt;&lt;i&gt;Method Overriding&lt;/i&gt;&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;
Two methods having same method names and with the same method signatures but in different classes as in Super Class and Sub Class, is called Method Overriding. So when a method in a subclass has the same method names and type signatures as in its super class, the subclass is said to &lt;b&gt;override&lt;/b&gt; that method. 
&lt;pre&gt;
void sum(int a)  //in super class
void sum(int a) //in sub class
&lt;/pre&gt;

&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
//super class
public class A 
{
    void sum(int a)
    {
    System.out.println("Addition value is: "+(a+a));
    }
}
//sub class
public class B extends A{
    void sum(int a)
    {
    System.out.println("The square of x is: "+ Math.sqrt(a));
    }
}
public class ABDemo {
    public static void main(String arg[])
    {
     B b = new B();
    b.sum(100);
    }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;br /&gt;
Output result &lt;br /&gt;
The square of x is: 5 &lt;br /&gt;

So Super Class method is overridden by the sub class method as JVM calls only subclass method if its overridden to super user method. Let's see following chart to see detailed differences between Method Overloading &amp;amp; Method Overriding. &lt;br /&gt;
&lt;p&gt;
&lt;table border="1" cellpadding="2" cellspacing="2" bgcolor="#F0FFFF"&gt;
&lt;tr&gt;&lt;th&gt;Method Overloading&lt;/th&gt;&lt;th&gt;Method Overriding&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Having two or more same method names but with different method signatures&lt;/td&gt;&lt;td&gt;Having two or more same method names and same method signatures &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Method Overloading done in the same class&lt;/td&gt;&lt;td&gt;Method Overriding is done in super class and sub class&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Method Overloading is done for Code Refinement&lt;/td&gt;&lt;td&gt;Method Overriding is done for Code Change/replacement&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Method Overloading is to extend already existing feature&lt;/td&gt;&lt;td&gt;Method Overriding is to present different implementation or body&lt;/td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Method return type can be same or different&lt;/td&gt;&lt;td&gt;Method return type should be same &lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;


&lt;p&gt;
&lt;b&gt;&lt;font color= "navy"&gt;Static Polymorphism&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;
Static Polymorphism, also called Compile time polymorphism, is performed at compilation time. Java Compiler knows what methods to call and compile and bind together. What we used in Dynamic Polymorphism is &lt;i&gt;Instance Methods&lt;/i&gt;. We can also use Static Methods to implement method overloading and method overriding of dynamic polymorphism. Static Method as well as Private and final methods are example of Static Methods. They are called static because they maintain only a single copy in memory that will be available and shared by all the object of a class. Static Method is also called class method as Static method is used by class rather than objects of the class. 
Let us see following code snippet. &lt;br /&gt;
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
//super class
public class A {
   static void sum(int a)
    {
        System.out.println("Addition value is: "+(a+a));
    }
}
//sub class
public class B extends A{
   static void sum(int a)
   {
        System.out.println("the square of x is: "+ Math.sqrt(a));
   }
}
public class ABDemo {
 public static void main(String arg[])
     {
     A a = new B();
     a.sum(100);
     }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;br /&gt;
Output result &lt;br /&gt;
Addition value is: 200 &lt;br /&gt;
In the above sample code snippet, super class method is called. We created super class reference to sub class object, as &lt;i&gt;A a = new B();&lt;/i&gt;. Here 'a' is super class reference variable and using this variable, we called sum() method as a.sum(100);. If we use sub class reference as &lt;i&gt;B b = new B();&lt;/i&gt;
&lt;p&gt;
Private methods are also used while programming in Java. Private methods are not accessible outside the class. It can be used only within a class. It is not even available for sub class. Private method can be used in Method Overloading. 
&lt;p&gt;
Final Methods can also be used to program as it is declared as &lt;i&gt;final&lt;/i&gt; specifier. Final method cannot be overridden like Private Method. So Method Overloading can only be used for final methods. Programmers believe that using 'final' method will enhance in the coding. Let us see a code snippet and find out. &lt;br /&gt;
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
//super class
public class A {
    final void sum1()
    {
        System.out.println("Hello There.");
    }
}
//sub class
public class B {
    void sum2()
    {
       A.sum1();  //calling method 'sum1'
    }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;br /&gt;
Here, what JVM does is copies the whole thing of Method 'sum1' to method 'sum2'. Copying code like this what we called is &lt;i&gt;Inline Operation&lt;/i&gt;. The purpose the final method is that first thing is performance will be better and secondly, other programmers cannot override this method. So, overall &lt;i&gt;private method&lt;/i&gt; and &lt;i&gt;final method&lt;/i&gt; are the same. They both behave the same as they both cannot be overridden, both are used in method overloading. Both cannot be accessible by other programmers.
&lt;p&gt;
&lt;i&gt;final&lt;/i&gt; can also be used to declare class as &lt;i&gt;final class.&lt;/i&gt; Final class prevents inheritance which means sub class cannot built out of final class. For example:
&lt;pre&gt;
final class X  //final class X is declared
class Y extends X  //invalid statements
&lt;/pre&gt;
final is used to declare constant value such as &lt;pre&gt; final int PI = 3.14159;&lt;/pre&gt;  //variable PI is constant 

&lt;p&gt;
&lt;b&gt;&lt;a name="w3c2"&gt;&lt;font color="blue"&gt;Type Casting in Java&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;
&lt;p&gt;
When we convert one kind of data type to another data type, this is what we call &lt;i&gt;Type Casting&lt;/i&gt; in Java. Java compiler always looks for uniformity when we assign a value to a variable. If data type is not the same, it will be converted to become the same on the both sides of. We use &lt;i&gt;Cast Operator&lt;/i&gt; for converting. Primitive data type hold single value whereas Reference data type, also called Advance data type,  can hold two or more values. Primitive data type can be converted into another primitive data type by using casting. But Primitive data type cannot be converted into referenced data type by using casting. We need to use class wrapper for this function.
&lt;p&gt;
Primitive data type are of two types. Higher data types and Lower data types. Higher type holds more memory than Lower type which holds lesser memory. Let us look at the following chart beginning with the lower data type to higher data type.
&lt;pre&gt;
Byte'Short'Char'Int'Long'Double'Float
Int x = 100;
Float sal = (float) x;   //now it converts int to float as 100.0.
&lt;/pre&gt;
We can change from lower to higher and vice versa. We converted int type x into float x. When we convert from lower to higher, it is safe as there will not be loss of any data. And even though we forget to mention casting, Java compiler automatically does this job for us, this is also called &lt;i&gt;Implicit casting&lt;/i&gt;. Such as if we type &lt;pre&gt;
Int x =100;
Float sal = x;&lt;/pre&gt;
Java compiler does conversion for us in this case. 
&lt;p&gt;
Higher data type can also be converted into lower data type as in the following examples: &lt;pre&gt;
double x = 100.078;
int sal = (int) x;   // converted into int value (100) 
&lt;/pre&gt;
As we discussed earlier converting from lower data type into higher is safe where as converting data from higher to lower is risky as we see in the above example that while converting from double to int data type, we have lost precision (.078) chopping to only 100 values. Converting data type from Higher to lower is called &lt;i&gt;Explicit Casting&lt;/i&gt;
&lt;p&gt;
Referenced Data Type can also be converted. We can take a class, which is a referenced data type, to convert into another class type but these classes should fall into same category, meaning some relationship as in super class and sub class. Such that we can convert Tiger class to Cat class.

&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;
package org.javaSansar.tutorial;
public class UpCastA 
{
    void display1()
    {
       System.out.println("This is super class");
    }
}
public class UpCastB extends UpCastA
{
    void display2()
    {
       System.out.println("This is sub class");
    }
}
public class UpCastTest 
{
    public static void main(String arg[])
      {
        UpCastA a = (UpCastA)new UpCastB();//a is referring to subclass reference here.
       a.display1(); 
     }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;br /&gt;
Output result &lt;br /&gt;
This is super class&lt;br /&gt;


&lt;p&gt;
&lt;b&gt;&lt;a name="w3c3"&gt;&lt;font color="blue"&gt;Abstract Classes in Java&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;
&lt;p&gt;
Abstract Class contains one or more abstract methods. An abstract class cannot be instantiated. If we create this code: AbsClassA a =  new AbsClassA();, this will generate a compile error.
A concrete class extends all the abstract methods. If we write only a method NOT method body i.e. add();, it becomes an abstract method and the class this method belongs to also becomes an abstract class. Abstract methods are called by sub classes/objects. The purpose of this is to create a super method/class and call them and avoid time and memories. Now, we can create a sub class and call the abstract class/method and give the body according to its need. So abstract methods are declared when two or more subclasses are needed similar role in different ways via different implementation.
Abstract method is a method that does not have body whereas an Abstract Class is a class that contains these incomplete abstract methods.
Let us take a look following code snippet code to be clearer on this. 
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt; 
&lt;pre&gt;
package org.javaSansar.tutorial;
public abstract class MyAbstractClass  //abstract class declared with abstract keyword
{
    abstract void calculate(int x);//abstract method
}
public class SubClassA extends MyAbstractClass{
    void calculate(int x)
    {
       System.out.println("Addition= "+ (x+x));
    }
}
public class SubClassB {
    void calculate(int x)
    {
       System.out.println("Multiplication= "+ (x*x));
    }
}
public class SubClassC {
    void calculate(int x)
    {
       System.out.println("Subtraction= "+ (x-x));
    }
}
public class AbstractClassTest {
    public static void main(String args[])
    {
     //creating three objects
    SubClassA a = new SubClassA();
    SubClassB b = new SubClassB();
    SubClassC c = new SubClassC();
    //calling methods
    a.calculate(5); //Addition
    b.calculate(10); //Multiplication
    c.calculate(15);//Subtraction
    }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;
The output is:&lt;pre&gt;
Addition= 10
Multiplication= 100
Subtraction= 0
&lt;/pre&gt;

&lt;p&gt;
&lt;b&gt;&lt;a name="w3c4"&gt;&lt;font color="blue"&gt;Interfaces in Java&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;
&lt;p&gt;
An Interface is sort of contract which defines a standard way of specifying the behavior of classes. Methods that come into an Interface are all abstract and obviously these methods don't have body in them. A sub class or concrete class is needed to implement Interfaces. Interface is a kind of class that contains only abstract methods as opposed to abstract class that may contain abstract method and concrete method. Only method prototypes are written in Interfaces. Object cannot be created out of Interfaces. So, we have to create separate classes where we can implement all the methods of the interfaces. We call these, implementation classes. Interface is important because it is used as an encapsulation, such that to reveal the functionalities of an object without revealing its implementation. Implementation can change without affecting the caller of the interfaces.
&lt;p&gt;
An example of an interface is a credit card. You have got a visa or master card. You can make purchases by swiping it in USA (dollar) or in England (pound) or in Canada (Canadian dollar). No matter what currencies have been used, it makes possible to make transaction and does all the currency conversion for you. So a credit card can be good example of an Interface or contract which fulfills the need of purchases/transactions regardless of locations or currencies. An Interface in Java sort of works as multiple inheritances. So a class can implement multiple interfaces but it can extend only one class. Interfaces have no direct relationship to any particular class. They are independently defined.

&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt; 
&lt;pre&gt;
public interface CreditCardInterface
{
  void purchaseDollar();//buy in dollar
  void purchasePound(); //Buy in pound 
}
public class BankA implements CreditCardInterface
{
    public void purchaseDollar()
    {
        System.out.println("Buy in dollor");//
    }
    public void purchasePound()
    {
        System.out.println("Buy in pound");
    } 
}
public class BankB implements CreditCardInterface 
{
    public void purchaseDollar()
    {
        System.out.println("Buy in dollor.");//
    }
    public void purchasePound()
    {
        System.out.println("Buy in pound.");
    }
}
public class InterfaceTest {
    public static void main(String arg[])
     {
     //More logics/statement can be used to adjust the buying
     //power of each currency, such as if location is USA, call purchaseDollar() method.
     BankA a = new BankA();
     a.purchaseDollar();
     BankB b = new BankB();
     b.purchasePound();
     }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
Multiple Inheritance advantage can be achieved by using interfaces such as in below code
&lt;pre&gt;
interface A
{
     double x = 10;
     void method1();
}
interface B
{
     double x =15;
     void method2();
}
class TestClass implements A, B
{
     //statement/logics
} 
&lt;/pre&gt;
&lt;p&gt;
&lt;b&gt;&lt;a name="w3c5"&gt;&lt;font color="blue"&gt;Packages in Java&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;
&lt;p&gt;
In Java, we can organize group of classes and interface in one place for efficiency and flexibilities. These files are organized in one directory or folder called a package.
Java contains lot of built in classes organized in packages. &lt;b&gt;java.io.*;&lt;/b&gt; is one of the example of package in java which contains number of very useful classes within this package. &lt;br /&gt;
In the above example, 'java' is a directory and 'io' is sub directory within it. '.*' brings all the available classes and sub classes and interface of the package. Similar other classes within java folder are java.lang, java.awt. In java, there are already available classes to be used making it easy and saving time for users and put together in one folder. These sort of packages/classes are called Built-In-Classes/packages. And the one user creates are called User-Defined-Packages/classes. 'java.io', 'java.lang', 'java.awt', 'java.util' are built-in-classes for example.
&lt;p&gt;
To import packages from java, we have to use following import commands.&lt;br /&gt;
&lt;pre&gt;
import java.io.*;
import java.awt.event.*;
&lt;/pre&gt;
&lt;p&gt;
Java programmer can create user defined packages and these can be imported just like Built-in-packages. We will discuss how to create a package and use them in the following tutorials.
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt; 
&lt;pre&gt;
package pack.nettools; //creating a package  and storing MyClass class in it.
public class MyClass
{ 
    void nameDisplay()
    {
       System.out.println("My Name Is David MacCain);
    }  
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
Now, we can compile above code using following command:&lt;br /&gt;
&lt;pre&gt;
C:\&gt; javac -d . MyClass.java
&lt;/pre&gt;
 '-d' creates a package called 'pack' and sub package called 'nettools' and places MyClass.class file in it.&lt;br /&gt;
'.' dot  tells compiler that package should be created in the current directory&lt;br /&gt;
Now, if we want to use MyClass class, we tag this class with a membership operator(.) as 
&lt;pre&gt;pack.nettools.MyClass&lt;/pre&gt;
Let us import above package class in another program: 
&lt;p&gt;
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt; 
&lt;pre&gt;
import pack.nettools.MyClass; //importing a package  for another class.
public class MyClassDemo
{
     Public static void main(String args[])
        {
            MyClass mc=new MyClass(); 
           mc.nameDispaly();
       }
  
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;

&lt;b&gt;&lt;a name="w3c6"&gt;&lt;font color="blue"&gt;Exceptional Handling in Java&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;
&lt;p&gt;
Usually there are two types of error in java we mostly face&lt;br /&gt;
&lt;b&gt;A) Compile-time errors:&lt;/b&gt;
Compile error occurs when there are some syntax errors. Such that missing semicolon (;), missing parenthesis'()', etc.  
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt; 
&lt;pre&gt;

public class CompError 
{
    public static void main(String args[])
       {
          System.out.println("My Compile Errors")
      }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt; 
&lt;pre&gt;
Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
 Syntax error, insert ";" to complete BlockStatements&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;


&lt;b&gt;B) Run-time errors:&lt;/b&gt;
&lt;p&gt;
When there is some system error such that out of memory, then run-time errors will occur.
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt; 
&lt;pre&gt;

public class CompError {
    public static void main()
       {
       System.out.println("My Run-Time Errors");
      }
}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt; 
&lt;pre&gt;
Exception in thread "main" java.lang.Error: java.lang.NoSuchMethodError: main
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;

&lt;b&gt;C) Logical Error: &lt;/b&gt;
&lt;p&gt;
Logical errors occur when programmer or designers use wrong logic to programming. This sort of errors some time are undetectable which causes defect or bugs in the application/systems.
&lt;p&gt;
&lt;b&gt;D) Exception Error: &lt;/b&gt;
&lt;p&gt;
Exceptions errors are generated in the run-time errors. If error occurs in compile-time by java compiler, they are sometime also called 'checked exception' but they occur only in few times. And if these errors are detected in run-time by JVM, they are sometime referred to 'unchecked exception'. How to handle Exception? Let us talk about it in below tutorial.&lt;p&gt;
&lt;pre&gt;public static void main(String args[]) throws IOException&lt;/pre&gt;
'IOException' is an example of checked exception. What above code does is throws out exception from main() method without handling it. We are not handling but throwing or bypassing exception here. To handle Exception by writing &lt;b&gt;try&lt;/b&gt; block. It looks as follows:
&lt;pre&gt;
try{
 statement;
     }
&lt;/pre&gt;
What above Exception handling code does is that even if some exception occurs, the program will not be terminated or corrupted. But JVM stores all the exception details in stack/log and bypasses it and move to &lt;b&gt;catch&lt;/b&gt; block. catch block looks as follows:&lt;br /&gt;
&lt;pre&gt;
catch (Exceptionclass ref)
 {
  statements;
 }
&lt;/pre&gt;
'ref' indicates reference which helps to generate exception stack. By using &lt;pre&gt;System.out.println(ref);&lt;/pre&gt;, detail exceptions can be generated.
&lt;p&gt;
Finally, a programmer should clean up by using following command:
&lt;pre&gt;
finally{
 statements;
 }
&lt;/pre&gt;
'finally' block will clean up all the unnecessary files and running threads. This is required to include in the snippet code. So, try, catch, finally blocks is what we used to handle &lt;b&gt;Exception Handling.&lt;/b&gt;Let us write a code snippet to understand Exception Handling.

&lt;table border="0" width="100%" cellpadding="2" cellspacing= "2" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt; 
&lt;pre&gt;
public class ExceptionClass 
{
 public static void main(String args[])
     {
     try
     {
       //opening the files
      double n = args.length;
      System.out.println("n= "+ n);
      double x = 100/n;
      System.out.println("x= "+ x);
     }
     catch(ArithmeticException ae)
     {
       //displaying exception stack details
      System.out.println(ae);
      //User message
      System.out.println("Please enter value i.e. 5 to avoid errors.");
     }
     finally
     {
       //cleaning of files and threads
      System.out.println("Cleaning up files/threads.");
     }
 }

}
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;

Exception can be of two types. Built-in exception and User-defined exception. Some of the Built-in-exceptions are: ArithmeticException, ArryIndexOutOfBoundsException, FileNotFoundException, NoSuchFieldException, IOException etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7844341291913287808-2262800423417524367?l=javasansar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/2262800423417524367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7844341291913287808&amp;postID=2262800423417524367' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/2262800423417524367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/2262800423417524367'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/2008/12/week-three-tutorial.html' title='Week Three Tutorial'/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08436281743629996970'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7844341291913287808.post-6236218954497830567</id><published>2008-12-13T19:27:00.008-05:00</published><updated>2009-07-31T23:37:55.497-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Basics'/><title type='text'>Week Three Quiz</title><content type='html'>&lt;p&gt;
&lt;span style="color:purple;"&gt;&lt;marquee width="100%"&gt;Learning java in just 5 weeks...&lt;/marquee&gt;&lt;/span&gt;
&lt;hr&gt;
&lt;font color="blue"&gt;&lt;b&gt;Please answer the following questions to proceed to week two tutorial&lt;/b&gt;&lt;/font&gt;
&lt;p&gt;
&lt;b&gt;Q.1 What is Polymorphism in JAVA?&lt;/b&gt;

&lt;/p&gt;&lt;form&gt;
&lt;input name="vehicle" value="Bike" type="checkbox"&gt;a) Same method performing different actions.&lt;br /&gt;

&lt;input name="vehicle" value="Car" type="checkbox"&gt;b) Overriding &amp; Overloading is part of Polymorphism.&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;c) An ability to inherit members of the class.&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;d) a &amp;amp; b .&lt;br /&gt;

&lt;/form&gt;
&lt;a href="#w3qa1"&gt;Check the correct answer&lt;/a&gt;

&lt;p&gt;
&lt;b&gt;Q.2 What is Method Signature in JAVA?&lt;/b&gt;

&lt;/p&gt;&lt;form&gt;
&lt;input name="vehicle" value="Bike" type="checkbox"&gt;a) Members of the super class family.&lt;br /&gt;

&lt;input name="vehicle" value="Car" type="checkbox"&gt;b) Method name and method parameters.&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;c) Sign the patent right of method in Java.&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;d) Method signature consists of constructors.&lt;br /&gt;

&lt;/form&gt;
&lt;a href="#w3qa2"&gt;Check the correct answer&lt;/a&gt;

&lt;p&gt;
&lt;b&gt;Q.3 What is Method Overloading ?&lt;/b&gt;

&lt;/p&gt;&lt;form&gt;
&lt;input name="vehicle" value="Bike" type="checkbox"&gt;a) Having two or more identical method names but different method signatures.&lt;br /&gt;

&lt;input name="vehicle" value="Car" type="checkbox"&gt;b) Having two or more identical method names and identical method signatures.&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;c) Having identical method parameter within a Sub Class.&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;d) None of the above.&lt;br /&gt;

&lt;/form&gt;
&lt;a href="#w3qa3"&gt;Check the correct answer&lt;/a&gt;

&lt;p&gt;
&lt;b&gt;Q.4 What is the differences between Implicit &amp;amp; Explicit Casting?&lt;/b&gt;

&lt;/p&gt;&lt;form&gt;
&lt;input name="vehicle" value="Bike" type="checkbox"&gt;a) Automatic data casting done by compiler is &lt;i&gt;Implicit Casting&lt;/i&gt; .&lt;br /&gt;

&lt;input name="vehicle" value="Car" type="checkbox"&gt;b) &lt;i&gt;Implicit Casting&lt;/i&gt; is done by programmers.&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;c) Converting Higher data to lower data type is &lt;i&gt;Explicit Casting&lt;/i&gt;.&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;d) Explicit Casting is done automatically by java compiler.&lt;br /&gt;

&lt;/form&gt;
&lt;a href="#w3qa4"&gt;Check the correct answer&lt;/a&gt;

&lt;p&gt;
&lt;b&gt;Q. 5 Differentiate between Generalization &amp;amp; Specialization?&lt;/b&gt;

&lt;/p&gt;&lt;form&gt;
&lt;input name="vehicle" value="Bike" type="checkbox"&gt;a) Sub class is promoted to a super class hence it becomes general.&lt;br /&gt;

&lt;input name="vehicle" value="Car" type="checkbox"&gt;b) Generalization is more like widening or up-casting&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;c) Specialization is demoted to narrow down to sub class.&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;d) All of the above.&lt;br /&gt;

&lt;/form&gt;
&lt;a href="#w3qa5"&gt;Check the correct answer&lt;/a&gt;

&lt;p&gt;
&lt;b&gt;Q. 6 What does this method returns ?&lt;/b&gt;
&lt;font color="blue"&gt;getClass()&lt;/font&gt;
&lt;/p&gt;&lt;form&gt;
&lt;input name="vehicle" value="Bike" type="checkbox"&gt;a) Compares the references of two objects of a class.&lt;br /&gt;

&lt;input name="vehicle" value="Car" type="checkbox"&gt;b) Returns an object that contains the name of the class to which it belongs to.&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;c) Returns a string representation of an object to the same class&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;d) This method returns the hash code number of an object.&lt;br /&gt;

&lt;/form&gt;
&lt;a href="#w3qa6"&gt;Check the correct answer&lt;/a&gt;

&lt;p&gt;
&lt;b&gt;Q. 7 What is Abstract Class and Abstract Methods represent?&lt;/b&gt;

&lt;/p&gt;&lt;form&gt;
&lt;input name="vehicle" value="Bike" type="checkbox"&gt;a) An abstract Class &amp;amp; an abstract method do not contain body&lt;br /&gt;

&lt;input name="vehicle" value="Car" type="checkbox"&gt;b) An Abstract method only contains method header not body.&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;c) Abstract class and abstract method is declared by 'abstract' key word before them.&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;d) All of the above.&lt;br /&gt;

&lt;/form&gt;
&lt;a href="#w3qa7"&gt;Check the correct answer&lt;/a&gt;

&lt;p&gt;
&lt;b&gt;Q. 8 What is an Interface? &lt;/b&gt;

&lt;/p&gt;&lt;form&gt;
&lt;input name="vehicle" value="Bike" type="checkbox"&gt;a) An Interface contains concrete methods &lt;br /&gt;

&lt;input name="vehicle" value="Car" type="checkbox"&gt;b) An Interface is similar to classes and objects&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;c) An interface is a sort of contract and they are public and abstract by default&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;d) An Interface is a contract that connects across the different systems.&lt;br /&gt;

&lt;/form&gt;
&lt;a href="#w3qa8"&gt;Check the correct answer&lt;/a&gt;

&lt;p&gt;
&lt;b&gt;Q. 9 What does following java package represents? &lt;/b&gt;&lt;br /&gt;
&lt;font color="red"&gt;import java.io&lt;/font&gt;

&lt;/p&gt;&lt;form&gt;
&lt;input name="vehicle" value="Bike" type="checkbox"&gt;a) This package contains Hashtable, vector, and arrays. &lt;br /&gt;

&lt;input name="vehicle" value="Car" type="checkbox"&gt;b) This is an Interface of classes and objects&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;c) This package contains java stream&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;d) This package helps create Graphical User Interface GUI.&lt;br /&gt;

&lt;/form&gt;
&lt;a href="#w3qa9"&gt;Check the correct answer&lt;/a&gt;

&lt;p&gt;
&lt;b&gt;Q. 10 What is the difference between Exception and Errors? &lt;/b&gt;&lt;br /&gt;

&lt;/p&gt;&lt;form&gt;
&lt;input name="vehicle" value="Bike" type="checkbox"&gt;a) An Exception can be handled but not Errors by programmer. &lt;br /&gt;

&lt;input name="vehicle" value="Car" type="checkbox"&gt;b) An Errors can be handled but an Exception cannot be handled&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;c) They both falls under Error class in java.lang package&lt;br /&gt;

&lt;input name="vehicle" value="Airplane" type="checkbox"&gt;d) All of the above.&lt;br /&gt;

&lt;/form&gt;
&lt;a href="#w3qa10"&gt;Check the correct answer&lt;/a&gt;

&lt;p&gt;
.........................................................................
&lt;p&gt;


&lt;p&gt;
&lt;font color="blue"&gt;&lt;b&gt;Answers of the Tutorial Three&lt;/b&gt;&lt;/font&gt;
&lt;p&gt;
&lt;hr&gt;&lt;hr&gt;
&lt;a name="w3qa1"&gt;&lt;font color="blue"&gt;&lt;b&gt;Q.1 Correct answer is D.&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;p&gt;
&lt;hr&gt;&lt;hr&gt;
&lt;a name="w3qa2"&gt;&lt;font color="blue"&gt;&lt;b&gt;Q.2 Correct answer is B.&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;p&gt;
&lt;hr&gt;&lt;hr&gt;
&lt;a name="w3qa3"&gt;&lt;font color="blue"&gt;&lt;b&gt;Q.3 Correct answer is A.&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;p&gt;
&lt;hr&gt;&lt;hr&gt;
&lt;a name="w3qa4"&gt;&lt;font color="blue"&gt;&lt;b&gt;Q.4 Correct answer is A &amp;amp; C.&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;p&gt;
&lt;hr&gt;&lt;hr&gt;
&lt;a name="w3qa5"&gt;&lt;font color="blue"&gt;&lt;b&gt;Q.5 Correct answer is D.&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;p&gt;
&lt;hr&gt;&lt;hr&gt;
&lt;a name="w3qa6"&gt;&lt;font color="blue"&gt;&lt;b&gt;Q.6 Correct answer is B.&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;p&gt;
&lt;hr&gt;&lt;hr&gt;
&lt;a name="w3qa7"&gt;&lt;font color="blue"&gt;&lt;b&gt;Q.7 Correct answer is D.&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;p&gt;
&lt;hr&gt;&lt;hr&gt;
&lt;a name="w3qa8"&gt;&lt;font color="blue"&gt;&lt;b&gt;Q.8 Correct answer is C.&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;p&gt;
&lt;hr&gt;&lt;hr&gt;
&lt;a name="w3qa9"&gt;&lt;font color="blue"&gt;&lt;b&gt;Q.9 Correct answer is C.&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;p&gt;
&lt;hr&gt;&lt;hr&gt;
&lt;a name="w3qa10"&gt;&lt;font color="blue"&gt;&lt;b&gt;Q.10 Correct answer is A.&lt;/b&gt;&lt;/font&gt;&lt;/a&gt;&lt;p&gt;
&lt;hr&gt;&lt;hr&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7844341291913287808-6236218954497830567?l=javasansar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/6236218954497830567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7844341291913287808&amp;postID=6236218954497830567' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/6236218954497830567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/6236218954497830567'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/2008/12/week-three-quiz.html' title='Week Three Quiz'/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08436281743629996970'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7844341291913287808.post-2458063160540026950</id><published>2008-12-13T19:23:00.002-05:00</published><updated>2009-07-31T23:38:11.212-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Basics'/><title type='text'>Week Four Tutorial</title><content type='html'>&lt;p&gt;
&lt;p&gt;
&lt;font color="red"&gt;&lt;MARQUEE width="50%"&gt;Week Four Tutorial is under construction...&lt;/MARQUEE&gt;&lt;/font&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7844341291913287808-2458063160540026950?l=javasansar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/2458063160540026950/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7844341291913287808&amp;postID=2458063160540026950' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/2458063160540026950'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/2458063160540026950'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/2008/12/week-four-tutorial.html' title='Week Four Tutorial'/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08436281743629996970'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7844341291913287808.post-8103261020075402671</id><published>2008-12-13T19:22:00.001-05:00</published><updated>2009-07-31T23:38:25.689-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Basics'/><title type='text'>Week Four Quiz</title><content type='html'>&lt;p&gt;
&lt;p&gt;
&lt;font color="red"&gt;&lt;MARQUEE width="50%"&gt;Week Four Quiz is coming soon...&lt;/MARQUEE&gt;&lt;/font&gt;
&lt;p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7844341291913287808-8103261020075402671?l=javasansar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/8103261020075402671/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7844341291913287808&amp;postID=8103261020075402671' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/8103261020075402671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/8103261020075402671'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/2008/12/week-four-quiz.html' title='Week Four Quiz'/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08436281743629996970'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7844341291913287808.post-1498953103424832433</id><published>2008-12-13T19:21:00.001-05:00</published><updated>2009-07-31T23:38:41.313-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Basics'/><title type='text'>Week Five Tutorial</title><content type='html'>&lt;p&gt;
&lt;p&gt;
&lt;font color="red"&gt;&lt;MARQUEE width="50%"&gt;Week Five Tutorial is under construction...&lt;/MARQUEE&gt;&lt;/font&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7844341291913287808-1498953103424832433?l=javasansar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/1498953103424832433/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7844341291913287808&amp;postID=1498953103424832433' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/1498953103424832433'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/1498953103424832433'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/2008/12/week-five-tutorial.html' title='Week Five Tutorial'/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08436281743629996970'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7844341291913287808.post-5932430306483268135</id><published>2008-12-13T19:20:00.012-05:00</published><updated>2009-07-31T23:38:54.578-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Basics'/><title type='text'>Week Five Quiz</title><content type='html'>&lt;p&gt;
&lt;p&gt;
&lt;font color="red"&gt;&lt;MARQUEE width="100%"&gt;Week Five Tutorial is under construction...&lt;/MARQUEE&gt;&lt;/font&gt;

&lt;p&gt;
&lt;p&gt;
&lt;font color="red"&gt;&lt;MARQUEE width="50%"&gt;Week Five Tutorial is under construction...&lt;/MARQUEE&gt;&lt;/font&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7844341291913287808-5932430306483268135?l=javasansar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/5932430306483268135/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7844341291913287808&amp;postID=5932430306483268135' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/5932430306483268135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/5932430306483268135'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/2008/12/week-five-quiz.html' title='Week Five Quiz'/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08436281743629996970'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7844341291913287808.post-583667132084474501</id><published>2008-12-13T19:18:00.015-05:00</published><updated>2009-08-10T21:10:09.959-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Basics'/><title type='text'>Java Interview Questions</title><content type='html'>&lt;p&gt;
&lt;a href="#jiq1"&gt;Q.01. What is the difference between a function and method?.&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq2"&gt;Q.02 How to allocate memory in java programming?.&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq3"&gt;Q.03 Which algorithm is used by garbage collector?&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq4"&gt;Q.04 How do you call garbage collector?&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq5"&gt;Q.05 What is Unicode System?&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq6"&gt;Q.06 What are control statements?&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq7"&gt;Q.07 Which loop is more efficient "do…while" or "while" loop?&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq8"&gt;Q.08 Can you Call the main() method of a class from another class?&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq9"&gt;Q.09 What is object reference?&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq10"&gt;Q.10 Explain about 'String Constant Pool'?&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq11"&gt;Q.11 What is the difference between StringBuffer and StringBuilder classes?&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq12"&gt;Q.12 What is the difference between Class and Object?&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq13"&gt;Q.13 What is Hash Code Number in Java?&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq14"&gt;Q.14 What is the difference between default constructor and parameterized constructor?&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq15"&gt;Q.15 What is the difference between Constructor and Methods?&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq16"&gt;Q.16 What is Instance Method?&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq17"&gt;Q.17 What is the difference between instance variable and class variables (static variables)?&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq18"&gt;Q.18 What is Static Block?&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq19"&gt;Q.19 What is Inheritance and what are the advantages of using it?&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq20"&gt;Q.20 What is the reason that&lt;font color="purple"&gt;&lt;b&gt; Multiple Inheritance&lt;/b&gt;&lt;/font&gt; is not accepted in Java?&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq21"&gt;&lt;font color="blue"&gt;Q.21 What is &lt;font color="navy"&gt;Coercion&lt;/font&gt; in Java? &lt;/font&gt;&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq22"&gt;&lt;font color="blue"&gt;Q.22 Can Private Method be overriden in Java? &lt;/font&gt;&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq23"&gt;&lt;font color="blue"&gt;Q. 23 Difference between Privitive Data Type &amp;amp; Reference Data Type? &lt;/font&gt;&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq24"&gt;&lt;font color="blue"&gt;Q.24 What is Generalization and Specialization in Java? &lt;/font&gt;&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq25"&gt;&lt;font color="blue"&gt;Q.25 What is the Object Class in Java? &lt;/font&gt;&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq26"&gt;&lt;font color="blue"&gt;Q.26 What is an Abstract Class? &lt;/font&gt;&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq27"&gt;&lt;font color="blue"&gt;Q.27 What is an Interface in Java? &lt;/font&gt;&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq28"&gt;&lt;font color="blue"&gt;Q.28 How do you call 'garbage collector' in Java? &lt;/font&gt;&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq29"&gt;&lt;font color="blue"&gt;Q.29 What is JAR Files? &lt;/font&gt;&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq30"&gt;&lt;font color="blue"&gt;Q.30 What is Throwable? &lt;/font&gt;&lt;/a&gt;
&lt;p&gt;
&lt;a href="#jiq31"&gt;&lt;font color="blue"&gt;Q.31 What is the difference between a 'throw' and 'throws'? &lt;/font&gt;&lt;/a&gt;
&lt;p&gt;

&lt;hr&gt;

&lt;b&gt;&lt;a name="jiq1"&gt;&lt;font color="blue"&gt;Q.01. What is the difference between a function and method?.&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
Answer: A method is a function. Java do not have functions instead Java uses method. Function is written inside out of the class in C++ but in Java it should be written only inside the class.

&lt;p&gt;
&lt;b&gt;&lt;a name="jiq2"&gt;&lt;font color="blue"&gt;Q.02 How to allocate memory in java programming?.&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
Answer: Class loader subsystem of JVM will allocate necessary memory. JVM also deallocates memory when it is not used.

&lt;p&gt;
&lt;b&gt;&lt;a name="jiq3"&gt;&lt;font color="blue"&gt;Q.03 Which algorithm is used by garbage collector?&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
Answer: The most commonly used is mark and sweep.

&lt;p&gt;
&lt;b&gt;&lt;a name="jiq4"&gt;&lt;font color="blue"&gt;Q.04 How do you call garbage collector?&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
Answer: Garbage collector is called by using "gc ()"

&lt;p&gt;
&lt;b&gt;&lt;a name="jiq5"&gt;&lt;font color="blue"&gt;Q.05 What is Unicode System?&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
Answer: Unicode System is an encoding standard that gives an unique number for every character no matter what the program, platform and language is. Unicode uses 2 bytes to represent a single character.

&lt;p&gt;
&lt;b&gt;&lt;a name="jiq6"&gt;&lt;font color="blue"&gt;Q.06 What are control statements?&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
Answer: Control statements are executed randomly and repeatedly hence providing better control to the programmer on the flow of execution.

&lt;p&gt;
&lt;b&gt;&lt;a name="jiq7"&gt;&lt;font color="blue"&gt;Q.07 Which loop is more efficient "do…while" or "while" loop?&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
Answer: In while loop condition is tested first and statement is executed second but in contrary, in do…while loop, statements are executed first and condition is tested later. Thus programmers don't have full control from the starting. Hence while loop is better efficient.

&lt;p&gt;
&lt;b&gt;&lt;a name="jiq8"&gt;&lt;font color="blue"&gt;Q.08 Can you Call the main() method of a class from another class?&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
Answer: Certainly yes. We can call the main() method of a class from another class using Classname.main(). At the time of calling the main() method, we should pass a string type array to it.

&lt;p&gt;
&lt;b&gt;&lt;a name="jiq9"&gt;&lt;font color="blue"&gt;Q.09 What is object reference?&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
Answer: Object reference is a unique hexadecimal number representing the memory address of the object. &lt;br /&gt;

&lt;p&gt;
&lt;b&gt;&lt;a name="jiq10"&gt;&lt;font color="blue"&gt;Q.10 Explain about 'String Constant Pool'?&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
Answer: It is a separate block of memory where string objects are stored by JVM. If string object is created directly (String n1="David";), using assignment operator, it is stored in String Constant Pool.

&lt;p&gt;
&lt;b&gt;&lt;a name="jiq11"&gt;&lt;font color="blue"&gt;Q.11 What is the difference between StringBuffer and StringBuilder classes?&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
Answer: StringBuffer class is synchronized and StringBuilder is NOT. When the programmer wants to use several threads, he should use StringBuffer as it gives reliable outputs. If only one thread is used, StringBuilder is preferred, it can improve execution time.

&lt;p&gt;
&lt;b&gt;&lt;a name="jiq12"&gt;&lt;font color="blue"&gt;Q.12 What is the difference between Class and Object?&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
Answer: A class is a model or blue print for creating objects and does not exists physically. An object is any thing that exists physically and both the class and objects contain variables and methods.

&lt;p&gt;
&lt;b&gt;&lt;a name="jiq13"&gt;&lt;font color="blue"&gt;Q.13 What is Hash Code Number in Java?&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
Answer: Hash Code number is a unique number generated for an object in JVM. Hash Code number is also referred to as 'Reference number' which is created based on the location of the object in memory. And it is unique for all the objects apart from String objects.

&lt;p&gt;
&lt;b&gt;&lt;a name="jiq14"&gt;&lt;font color="blue"&gt;Q.14 What is the difference between default constructor and parameterized constructor?&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
Answer: Default constructor is useful to initialize all objects with same data and does not have any parameters declared and when the data is not passed while creating an object, default constructor is called.&lt;br /&gt;
Parameterized constructor is used to initialize each object with different data and constructor will have one or more parameters and when data is passed while creating an object, parameterized constructor is called.

&lt;p&gt;
&lt;b&gt;&lt;a name="jiq15"&gt;&lt;font color="blue"&gt;Q.15 What is the difference between Constructor and Methods?&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
Answer: A constructor is used to initialize the instance variable of a class. Constructor must have same name as class name. Constructor is called and executed concurrently at the time of object creation. &lt;br /&gt;
A method is used to perform an action or processing data. Method name and constructor's name should be different as method's name begins with lowercase while constructor's name begins with the uppercase. A method is called after creating an object and can be called several times on the object. And a method is executed only when we call it.

&lt;p&gt;
&lt;b&gt;&lt;a name="jiq16"&gt;&lt;font color="blue"&gt;Q.16 What is Instance Method?&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
Answer: Instance method acts on the instance variables of the class. If an object is used to call method such as obj.sum(), obj has direct connection with the class and its instance variables.

&lt;p&gt;
&lt;b&gt;&lt;a name="jiq17"&gt;&lt;font color="blue"&gt;Q.17 What is the difference between instance variable and class variables (static variables)?&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
Answer: Each object can have separate copy of instance variables but each object can not have separate copy of class variables. Single copy is shared amongst the objects. Instance variable are stored in Heap memory while class variables are stored within method.

&lt;p&gt;
&lt;b&gt;&lt;a name="jiq18"&gt;&lt;font color="blue"&gt;Q.18 What is Static Block?&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
Answer: Static Block is declared with the java keyword 'static'. JVM executes static block first and then others. Here is the static block look like:
&lt;table border="0" cellpading="0" cellspacing="0" width="100%" bgcolor="#ffffcc"&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre&gt;
 public class TestStaticBlock
 {
  Static {
   System.out.println("I am Static Block");
   }
 public static void main(String arg[]) {
  System.out.println("I am main method");
 }
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;br /&gt;
Here is the OUTPUT:&lt;br /&gt;
I am Static Block:&lt;br /&gt;
I am main method:

&lt;p&gt;
&lt;b&gt;&lt;a name="jiq19"&gt;&lt;font color="blue"&gt;Q.19 What is Inheritance and what are the advantages of using it?&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
Answer: Members of super class is inherited to derived class is called Inheritance. Programmers can reuse super class code without rewriting it for sub class. It helps programmers do work quicker and easy hence saves time and increases productivity.

&lt;p&gt;
&lt;b&gt;&lt;a name="jiq20"&gt;&lt;font color="blue"&gt;Q.20 What is the reason that&lt;font color="purple"&gt;&lt;b&gt; Multiple Inheritance&lt;/b&gt;&lt;/font&gt; is not accepted in Java?&lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
Answer: Multiple Inheritance leads a confusion, and Single Inheritance can provide Multiple Inheritance job by using single inheritance multiple time. Interface also provides the same job as Multiple Inheritance in Java.
&lt;p&gt;
&lt;b&gt;&lt;a name="jiq21"&gt;&lt;font color="blue"&gt;Q.21 What is &lt;font color="navy"&gt;Coercion&lt;/font&gt; in Java? &lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
Answer: Coercion is a way of coercing up two piece of data into one identical type. It's an automatic conversion between two or more data types done by the compiler. Here is an example. &lt;pre&gt;
Cal  Data Type  Results
X=2.0/3  D/I (Double/Int) D
&lt;/pre&gt; 
&lt;p&gt;
&lt;b&gt;&lt;a name="jiq22"&gt;&lt;font color="blue"&gt;Q.22 Can Private Method be overriden in Java? &lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
Answer: Private Methods can not be overriden because they  can not be used in sub classes. methods are not accessible outside the class. It is not available for sub class too. Private method can be used in Method Overloading.
&lt;p&gt;
&lt;b&gt;&lt;a name="jiq23"&gt;&lt;font color="blue"&gt;Q. 23 Difference between Privitive Data Type &amp;amp; Reference Data Type? &lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
Answer: Primitive data type hold single value whereas Reference data type, also called Advance data type, can hold two or more values. Primitive data type can be converted into another primitive data type by using casting. But Primitive data type cannot be converted into referenced data type by using casting. We need to use class wrapper for this function. 
&lt;p&gt;
&lt;b&gt;&lt;a name="jiq24"&gt;&lt;font color="blue"&gt;Q.24 What is Generalization and Specialization in Java? &lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
Answer:  Generalization needs upward casting. Generalization is a concept where a sub class is promoted to a super class. Specialization follows downward casting and It is quite the opposite of generalization as it demote/downgraded to a sub classes.
&lt;p&gt;
&lt;b&gt;&lt;a name="jiq25"&gt;&lt;font color="blue"&gt;Q.25 What is the Object Class in Java? &lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
Answer:  We can find Object class in java.lang package in java which refers to the super class of all the classes available in java. So, each class has impact of that object class. Object class outlines the methods for comparing objects, and converting objects to a string etc. 
&lt;p&gt;
&lt;b&gt;&lt;a name="jiq26"&gt;&lt;font color="blue"&gt;Q.26 What is an Abstract Class? &lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
Answer:  An Abstract class is a class that contains abstract methods as well as concrete methods and instance variables. An abstract class is declared with 'abstract' java keyword. So is with abstract methods. Abstract methods can only have method header but NOT the body. Sub classes will have method body and will call the abstract methods. Objects cannot be created for abstract class. Only sub classes can have objects. But a reference can be created from abstract class which is used to refer to objects of its subclasses. 
&lt;p&gt;
&lt;b&gt;&lt;a name="jiq27"&gt;&lt;font color="blue"&gt;Q.27 What is an Interface in Java? &lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
Answer:  An Interface is a specification of method prototypes and these methods are public and abstract by default. They are public due to the fact that they needed to be available publicly to the third vendor parties to provide implementations. This is why they are abstract as their implementation is left for the third parties. We can not create objects from Interface so we needed implementation classes to implement methods of the interfaces. Java keyword 'Implement' is used to use interface from implementation classes
&lt;p&gt;
&lt;b&gt;&lt;a name="jiq28"&gt;&lt;font color="blue"&gt;Q.28 How do you call 'garbage collector' in Java? &lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
Answer:  Garbage Collector is one of the best tool in java used to delete unused and unnecessary variables and unreferenced objects from memory. We can use &lt;b&gt;gc()&lt;/b&gt; method to perform this task. For example:&lt;br /&gt;
System.gc();
&lt;p&gt;
&lt;b&gt;&lt;a name="jiq29"&gt;&lt;font color="blue"&gt;Q.29 What is JAR Files? &lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
Answer:  A JAR (java archive) file contains compressed version of .class files, directories, images. '.jar' file is compressed in .zip or tar file. Number of .class files and other related files are grouped and put together in the .jar file. We can create a jar file by using the following command.&lt;br /&gt;
&lt;pre&gt;
=&gt;To create a JAR file:
C:\&gt;jar cf jarfilename inputfiles
C:\&gt;jar cf pack.nettools.jar pack.nettools
=&gt;To view a JAR file:
jar tf jarfilename
i.e. jar tf pack.nettools.jar
=&gt;To extract a JAR file:
jar xf pack.nettools.jar

&lt;/pre&gt;
&lt;p&gt;
&lt;b&gt;&lt;a name="jiq30"&gt;&lt;font color="blue"&gt;Q.30 What is Throwable? &lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
Answer:  Throwable is a class in java that comes under java.lang package. Throwable class is a super class which handles all the exception errors. Under Throwable, we have two sub classes: Error class and Exception class. Error class handles all the errors whereas Exception class handles Runtime and other errors.
&lt;p&gt;
&lt;b&gt;&lt;a name="jiq31"&gt;&lt;font color="blue"&gt;Q.31 What is the difference between a 'throw' and 'throws'? &lt;/font&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
Answer:  Actually they both are quite oppositely behaves as throw clause is used to throw an exception to handle the exception whereas 'throws' clause is used when programmers don't want to handle the exception and throw it out of the method.

&lt;p&gt;
&lt;script type="text/javascript"&gt;&lt;!--
indeed_jobroll_format = "300x250";
indeed_jobroll_publisher = "4159526527794233";
indeed_jobroll_keywords = "java developers";
indeed_jobroll_location = "";
indeed_jobroll_channel = "java developer";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="http://jobroll.indeed.com/ads/jobroll2.js"&gt;
&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://www.indeed.com/"&gt;Jobs&lt;/a&gt; by Indeed&lt;/noscript&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7844341291913287808-583667132084474501?l=javasansar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/583667132084474501/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7844341291913287808&amp;postID=583667132084474501' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/583667132084474501'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/583667132084474501'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/2008/12/java-interview-questions.html' title='Java Interview Questions'/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08436281743629996970'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7844341291913287808.post-1994050629751730828</id><published>2008-12-13T18:34:00.003-05:00</published><updated>2009-08-25T19:18:21.382-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Advanced'/><title type='text'>Java J2EE</title><content type='html'>&lt;table border="0" cellpadding="2" cellspacing="2" bgcolor="white" align="left"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href="http://1.bp.blogspot.com/_NoEeV7yoSLs/SVuHps69ptI/AAAAAAAAAAM/EGFE3mQxK3Q/s1600-h/java_logo_1.jpeg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img id="BLOGGER_PHOTO_ID_5285967738152265426" border="0" style="margin: width: 10px; height: 20px;" alt="" src="http://1.bp.blogspot.com/_NoEeV7yoSLs/SVuHps69ptI/AAAAAAAAAAM/EGFE3mQxK3Q/s200/java_logo_1.jpeg"/&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;
Java is platform independent, secure, reliable, and robust language which gives developers complete independence from hardware, network, and operating system issues when developing any commercial application. Java is based on Object-Oriented Programming methodology which allows the same program to be executed on multiple operating systems.
Java as a language has evolved from C++. Although the Java programming language is usually associated with the World Wide Web, its origin predates the Web. Java began life as the programming language named Oak.
&lt;br&gt;
&lt;p&gt;
Java was developed by James Gosling and his co-workers at Sun Microsystems in the early 1990s. In 1991, James Gosling began extending the C++ compiler to make it more platform independent. He realized that this approach would not be sufficient and so he developed a new interpreter. This interpreter was named Oak.
In January of 1991 James Gosling, Bill Joy, Mike Sheradin, Patric Naughton, and several others met in Aspen, Colorado to discuss this project. Mike Sheradin was to focus on business development; Patrick Naughton was to begin work on the graphics system; and James Gosling was to identify the proper programming language for the project. Gosling thought C and C++ could be used to develop the project. But the problem he faced with them is that they were system dependent languages and hence could not be used on various processors, which the electronic devices might use. So he started developing a new language. This language was called Oak which was registered by some other company, later it was changed to Java. Following table showcases the various versions of java developed over times.
&lt;p&gt;
&lt;table border="1" cellpadding="2" cellspacing="2" bgcolor="FFFFCC"&gt;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;Version&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Code Name&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;JDK 1.0&lt;/td&gt;&lt;td&gt;Released on January 23, 1996&lt;/td&gt;&lt;td&gt;---&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; JDK 1.1&lt;/td&gt;&lt;td&gt; Released on February 19, 1997&lt;/td&gt;&lt;td&gt;--- &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; J2SE 1.2&lt;/td&gt;&lt;td&gt; Released on December 8, 1998&lt;/td&gt;&lt;td&gt;Playground&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; J2SE 1.3&lt;/td&gt;&lt;td&gt; Released on January 8, 2000&lt;/td&gt;&lt;td&gt;Kestrel&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; J2SE 1.4&lt;/td&gt;&lt;td&gt;Released on February 6, 2002&lt;/td&gt;&lt;td&gt;Merlin&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; J2SE 5.0&lt;/td&gt;&lt;td&gt; Released on September 30, 2004. This release was originally numbered 1.5&lt;/td&gt;&lt;td&gt;Tiger- &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; Java SE 6&lt;/td&gt;&lt;td&gt; A beta version was released on February 15, 2006&lt;/td&gt;&lt;td&gt;Playground&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;br&gt;
Java platform consists of a Java Virtual Machine and implementations of standard libraries. Sun Microsystems refers to their implementation of the Java platform as the Java Runtime Environment (JRE). There are three version of Java to develop applications.&lt;br&gt;&lt;br&gt;
&lt;b&gt;a) Java Micro Edition (J2ME)&lt;/b&gt;&lt;br&gt;
&lt;b&gt;b) Java Standard Edition (J2SE)&lt;/b&gt;&lt;br&gt;
&lt;b&gt;c) Java Enterprise Edition (J2EE)&lt;/b&gt;&lt;br&gt;
&lt;hr&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7844341291913287808-1994050629751730828?l=javasansar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/1994050629751730828/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7844341291913287808&amp;postID=1994050629751730828' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/1994050629751730828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/1994050629751730828'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/2008/12/java-j2ee.html' title='Java J2EE'/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08436281743629996970'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_NoEeV7yoSLs/SVuHps69ptI/AAAAAAAAAAM/EGFE3mQxK3Q/s72-c/java_logo_1.jpeg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7844341291913287808.post-4253948825747545783</id><published>2008-12-13T18:32:00.005-05:00</published><updated>2009-08-22T16:35:26.141-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Advanced'/><title type='text'>Java Servlets</title><content type='html'>&lt;b&gt;&lt;font size="6" color="red"&gt;About Java Servlets&lt;/font&gt;&lt;/b&gt;
&lt;p&gt;
Java Servlets is a server side technology to build internet based comercial applications developed by Sun Microsystems. Servlets are 

platform independent java technology that run on set of standard interfaces and JVM (Java Virtual Machine). Servlets are built, written in 

java. Regardless of Servlets written in java, their clients may have written in any languages. Java Servlets provide an object-oriented and 

extensible middle tier for web server based, distributed java applications. Java Servlets is a technology that can access all of the java APIs 

such as JDBC, JNDI, RMI, EJB so on. &lt;br /&gt;
Web Server itself is not able to dynamically create web page content by pulling data from database. Web Server needs help of Java 

Servlets to get access to the data table, make accessible for users via internet to the client's browsers. Java Servlets is tied up with &lt;font 

color="red"&gt;HTTP&lt;/font&gt;, and commonly referred to &lt;font color="red"&gt;HTTP Servlet&lt;/font&gt;. Servlets is small portion of java code 

which is executed at the web Server in response to an HTTP request from a client's Browsers.  Servlets can be used as a plug-in for 

instance a search engine or semi-customized applications such as web-based banking systems.
&lt;p&gt;
Java Servlet's work is mostly done behind the scene and not visible to the users. Servlets are run within a Web Server's namespace. Only 

the results of Servlet's processing such as data from database table which is converted to suit into the html form, are visible to the users 

via Graphical User Interface (GUI).
Java Servlet's life-cycle (created &amp;amp; destroyed) is managed by Servlet Engine (Servlet Container). Servlet Container provies the 

runtime environment where servlets are executed. Java Servlet is supported by many popular web servers such as Appache, IIS, Netscape 

so on. Servlets run on server side whereas Applets run only on the Client side java enbled browser.  
&lt;p&gt;
&lt;b&gt;&lt;font size="6" color="red"&gt;Java Servlets Work Flow&lt;/font&gt;&lt;/b&gt;
&lt;p&gt;
Servlets always run behind the scene on the Web Server. Servlets provide a framework to create applications that implement a HTML 

request/response. For intance, a Browser sends a request to the Webserver for HTML page content. The Webserver forward this request to 

Servlet via its extender software. Servlet processes the request by pulling data from data table, converting them in HTML format, and 

sending back to the Web Server. Then, Web Server forward the result back to Web Browser who initiated the request for HTML page 

content, hence displaying result on the GUI.

&lt;p&gt;
&lt;b&gt;&lt;font size="6" color="red"&gt;How to create Servlets&lt;/font&gt;&lt;/b&gt;
&lt;p&gt;
Java Servlets are created just like other java source file on the ASCII Editor. Compiled and run in a Java Virtual Machine. 
&lt;pre&gt;
&amp;lt;filename&amp;gt;.java (Source Code)
MyFirstServlet.java
&amp;lt;filename&amp;gt;.class (Compiled)
MyFirstServlet.class
&lt;/pre&gt;

&lt;p&gt;
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;
import java.servlet.*;
public class MyFirstSerlet extends HttpServlet
    {
       public void service(ServletRequest request, ServletResponse response) 
      throws ServletException, IOException
      {
      ...
      }
      ...
   }
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
The &lt;i&gt;service()&lt;/i&gt; method comes with two parameters: request and response. These parameters encapsulate data sent by the Browser 

client and provide access to parameters and allow Servlets to process result status, including errors.
&lt;p&gt;
&lt;b&gt;&lt;font size="14" color="red"&gt;How to run Servlets&lt;/font&gt;&lt;/b&gt;
&lt;p&gt;
Servlets are run using Web Servers such as Apache in the production environment. The Servlet Engine (Servlet Container) provides 

runtime environment to Servlets. Servlet Engine come as Standalone and Add-on. Some Web Server support Servlets right out of the box, 

meaning no need to install Third-party Add-on. This kind of Web Servers are called a Standalone Servlet Engine. Standalone Servlet 

Engine is a server that includes biult-in support for Servlets. Some example of Standalone Servlet Engines are Oracle Weblogic Application 

Server or Tomcat Server from Project Jakarta or WebSphere Application Server from IBM so on. On the other hand, Add-On Servlet 

Engine requires a third party Add-on installed such as Apache do not support Servlets right out of the box.

&lt;p&gt;
&lt;a href="http://javasansar.blogspot.com/2008/12/unix.html"&gt;&lt;b&gt;&lt;i&gt;&lt;font color ="#FF6600"&gt;&amp;#8592;Return To Menu&lt;/font&gt;&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;
&lt;p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7844341291913287808-4253948825747545783?l=javasansar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/4253948825747545783/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7844341291913287808&amp;postID=4253948825747545783' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/4253948825747545783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/4253948825747545783'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/2008/12/java-server.html' title='Java Servlets'/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08436281743629996970'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7844341291913287808.post-8476688962337884799</id><published>2008-12-13T18:25:00.001-05:00</published><updated>2009-08-10T21:11:57.210-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Advanced'/><title type='text'>Oracle Weblogic</title><content type='html'>&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;font color="olive"&gt;&lt;MARQUEE width="50%"&gt;Learn Java in just 5 weeks...&lt;/MARQUEE&gt;&lt;/font&gt;&lt;br&gt;
&lt;b&gt;Creating a WebLogic Domain and Server&lt;/b&gt;&lt;br&gt;
&lt;p&gt;
In this tutorial you use the WebLogic Server Configuration Wizard to create a domain and server to deploy and run the MedRec applications.The tutorial also shows you how to start the server. The Avitek Medical Records Development Tutorials guide you through the process of developing, packaging, and deploying real-world J2EE applications with WebLogic Server. MedRec is an educational tool for all levels of J2EE developers; it showcases the use of each J2EE component, and illustrates best practice design patterns for component interaction and client development
Requirement: Have Weblogic Application server installed of your choice may be weblogic 10 latest version available as of today. Go to this link:
&lt;a href="http://www.bea.com/"&gt;Click Here!&lt;/a&gt; &lt;br&gt;
&lt;/p&gt;
&lt;br&gt;
&lt;b&gt;Proc 1: Create the MedRec domain and MedRec server.&lt;/b&gt;&lt;br&gt;
The MedRec domain includes a single server that will host the MedRec back-end services, the MedRec Administration application, and the Patient application (both applications are Web applications).
1. Launch the Configuration Wizard: &lt;br&gt;
Start—&gt;All Programs—&gt;BEA Products—&gt;Tools—&gt;Configuration Wizard&lt;br&gt;
2. In the Welcome window, select Create a new WebLogic domain. &lt;br&gt;
3. Click Next. &lt;br&gt;
4. In the Select Domain Source window, select the option that begins Generate a domain configured automatically ... &lt;br&gt;
5. Click Next. &lt;br&gt;
6. In the Configure Administrative Username and Password window, enter: &lt;br&gt;

&lt;ul&gt;
&lt;li&gt;weblogic for User Name&lt;/li&gt; 
&lt;li&gt;weblogic for User Password and Confirm user Password &lt;/li&gt;
&lt;li&gt;An optional description.&lt;/li&gt;
&lt;/ul&gt;
7. Click Next. 
8. In the Configure Server Start Mode and JDK window, select: 
&lt;ul&gt;
&lt;li&gt;Development Mode for WebLogic Domain Startup Mode &lt;/li&gt;
&lt;li&gt;Sun SDK 1.5.0_XX @ JDK_location, under the BEA Supplied JDKs option, for JDK Selection &lt;/li&gt;
&lt;/ul&gt;
9. Click Next. 
10. In the Customize Environments and Services Settings window, select Yes. 
11. Click Next. 
12. In the Configure the Administration Server window, enter or select: 
&lt;ul&gt;
&lt;li&gt;MedRecServer for Name. &lt;/li&gt;
&lt;li&gt;All Local Addresses for Listen Address. &lt;/li&gt;
&lt;li&gt;7101 for Listen Port.&lt;/li&gt; 
&lt;li&gt;The SSL Enabled check box.&lt;/li&gt; 
&lt;li&gt;7102 for SSL Listen Port.&lt;/li&gt;
&lt;/ul&gt; 
13. Click Next. 
14. Select Next in the following windows without making any changes: 
&lt;ul&gt;
&lt;li&gt;Configure Managed Servers &lt;/li&gt;
&lt;li&gt;Configure Machines &lt;/li&gt;
&lt;/ul&gt;
15. In the Review WebLogic Domain window, click on MedRecServer in the left pane and review your choices, then click Next. 
16. In the Create WebLogic Domain window: 
&lt;ul&gt;
&lt;li&gt;Enter MedRecDomain as the Domain Name. &lt;/li&gt;
&lt;li&gt;Click Create to create the MedRec domain in the folder displayed in the Domain Location text box. When the Configuration Wizard finishes creating the domain, the Domain Created Successfully! message is displayed. &lt;/li&gt;
&lt;/ul&gt;
17. Click Done to close the Configuration Wizard. 
&lt;ul&gt;
&lt;li&gt;Do not check Start Admin Server.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;b&gt;Proc 2: Enable log4j for logging application messages.&lt;/b&gt;&lt;br&gt;&lt;br&gt;
The MedRec application suite uses log4j for logging application messages. You must copy the log4j properties file from the pre-configured MedRec domain and identify it using a startup option in MedRecServer startup script. You also need to copy the log4j jar files to the lib directory of the MedRec domain. To complete these steps:
1. Copy the log4j properties file from the pre-configured MedRec domain (under the main WebLogic Server installation directory) to the new domain you just created. 
For example, if you installed WebLogic Server in the c:\bea directory, then enter the following in a command-line shell:
prompt&gt; copy c:\bea\weblogic91\samples\domains\medrec\log4jConfig.xml c:\bea\user_projects\domains\MedRecDomain
&lt;br&gt;&lt;br&gt;
2. Open the setDomainEnv.cmd script, located in the bin directory of your newly created domain directory, for your new domain in a text editor. For example: 
prompt&gt; notepad c:\bea\user_projects\domains\MedRecDomain\bin\setDomainEnv.cmd
&lt;br&gt;&lt;br&gt;
3. Find the following line in the setDomainEnv.cmd script: 
if NOT "%LOG4J_CONFIG_FILE%"=="" (
&lt;br&gt;&lt;br&gt;
4. Add the following two lines immediately before the line specified in the preceding step: 
set LOG4J_CONFIG_FILE=c:\bea\user_projects\domains\MedRecDomain\log4jConfig.xml
for %%i in ("%LOG4J_CONFIG_FILE%") do set LOG4J_CONFIG_FILE=%%~fsi
It is assumed in the preceding text that the MedRecDomain directory is c:\bea\user_projects\domains\MedRecDomain; enter your exact domain directory if it is different.
&lt;br&gt;&lt;br&gt;
5. Save the file and exit your text editor. 
&lt;br&gt;&lt;br&gt;
6. Copy the log4j JAR files from the lib directory of the pre-configured MedRec domain to the lib directory of the new domain you just created: 
prompt&gt; copy c:\bea\weblogic91\samples\domains\medrec\lib\*.jar c:\bea\user_projects\domains\MedRecDomain\lib 
All JAR files in the lib subdirectory of a domain directory are automatically added to the WebLogic Server system CLASSPATH when the servers in the domain start up.



&lt;hr&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7844341291913287808-8476688962337884799?l=javasansar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/8476688962337884799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7844341291913287808&amp;postID=8476688962337884799' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/8476688962337884799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/8476688962337884799'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/2008/12/java-weblogic.html' title='Oracle Weblogic'/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08436281743629996970'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7844341291913287808.post-1044104874519425598</id><published>2008-12-13T18:21:00.007-05:00</published><updated>2009-02-07T20:36:54.797-05:00</updated><title type='text'></title><content type='html'>&lt;font face="Comic Sans MS" color="navy"&gt;JavaNews...&lt;/font&gt;&lt;br /&gt;

&lt;hr width="100%" color="red"&gt;
&lt;table&gt; 
&lt;tr&gt;
&lt;td&gt;
&lt;font color="navy"&gt;New Hands-On Learning for Identity Manager 8.0&lt;br /&gt;
Experience the power of Identity Manager 8.0 first-hand with Sun's new self-paced course and on demand labs.Get an overview of the product features and product architecture. Through detailed demonstrations, you will also understand how to use various features of the product, including how to manage roles, view and configure in line attributes, use the Data Exporter function and configure service tags.With a single click, you get access to a remote lab environment with lab exercises and asynchronous support from an instructor – if you have any questions along the way.  &lt;br /&gt; &lt;a href="http://www.sun.com/training/catalog/courses/WSPL-IDM-2471.xml?cid=e7479"&gt;&lt;font size="2" color="red"&gt;More..&lt;/font&gt;&lt;/a&gt;
&lt;/font&gt;

&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;hr width="100%" color="red"&gt;
&lt;table&gt; 
&lt;tr&gt;
&lt;td&gt;
&lt;font color="navy"&gt;Sun Microsystems has finalized JSR 222. &lt;br /&gt;
Java Architecture for XML Binding (JAXB) 2.0. "JAXB 2.0 is a follow-on to JSR 31 Java XML Data Binding Specification building upon the architecture introduced in JAXB 1.0 JAXB 1.0 lowered the barrier for developers manipulating XML content from Java TM applications. &lt;br /&gt; &lt;a href="http://jcp.org/en/jsr/detail?id=222"&gt;&lt;font size="2" color="red"&gt;More..&lt;/font&gt;&lt;/a&gt;
&lt;/font&gt;

&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;hr width="100%" color="red"&gt;
&lt;table&gt; 
&lt;tr&gt;
&lt;td&gt;
&lt;font color="navy"&gt;Rahul N. Merchant Elected to Sun Microsystems Board of Directors

Mr. Merchant Brings More Than 25 Years of Successful Technology Leadership and Operational Management Experience
SANTA CLARA, CA February 2, 2009 Sun Microsystems, Inc. (NASDAQ: JAVA) today announced that Rahul N. Merchant has been elected to the Company's Board of Directors. Mr. Merchant is an accomplished financial services industry leader with a proven track record for managing large technology operations and organizations across the globe. &lt;br /&gt; &lt;a href="http://www.sun.com/aboutsun/pr/2009-02/sunflash.20090202.1.xml"&gt;&lt;font size="2" color="red"&gt;More..&lt;/font&gt;&lt;/a&gt;
&lt;/font&gt;

&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;

&lt;hr width="100%" color="red"&gt;
&lt;table&gt; 
&lt;tr&gt;
&lt;td&gt;
&lt;font color="navy"&gt;O'Reilly's new Head First Software Development sums up decades of research on what works and what doesn't in the often arcane world of software development.&lt;br /&gt; &lt;a href="http://java.sun.com/developer/Books/hf_swdev"&gt;&lt;font size="2" color="red"&gt;More..&lt;/font&gt;&lt;/a&gt;
&lt;/font&gt;

&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
How to Create Translucent and Shaped Windows&lt;br /&gt;
&lt;hr width="100%" color="red"&gt;

&lt;table&gt; 
&lt;tr&gt;
&lt;td&gt;
&lt;font color="navy"&gt;With the Java SE 6 update 10 release, you can create uniformly translucent windows or per-pixel gradients, or apply a shape to a non-decorated window.&lt;br /&gt; &lt;a href="http://java.sun.com/developer/technicalArticles/GUI/translucent_shaped_windows/"&gt;&lt;font size="2" color="red"&gt;More..&lt;/font&gt;&lt;/a&gt;
&lt;/font&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7844341291913287808-1044104874519425598?l=javasansar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/1044104874519425598/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7844341291913287808&amp;postID=1044104874519425598' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/1044104874519425598'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/1044104874519425598'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/2008/12/java-jdbc.html' title=''/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08436281743629996970'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7844341291913287808.post-816927461715413887</id><published>2008-12-13T18:20:00.005-05:00</published><updated>2009-02-02T22:22:19.508-05:00</updated><title type='text'></title><content type='html'>&lt;font face="Comic Sans MS" color="navy"&gt;About the books...&lt;/font&gt;&lt;br /&gt;

&lt;hr width="100%" color="silver"&gt;&lt;br /&gt;
&lt;a href="http://1.bp.blogspot.com/_Hg_5jfleI8k/SYefcVQ-1TI/AAAAAAAAACE/3uBsHtsMehA/s1600-h/head_first.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img border="0" id="BLOGGER_PHOTO_ID_5298378795718202674" style="width: 115px; height: 119px;" alt="" src="http://1.bp.blogspot.com/_Hg_5jfleI8k/SYefcVQ-1TI/AAAAAAAAACE/3uBsHtsMehA/s200/head_first.jpg"/&gt;&lt;/a&gt;&lt;br /&gt;

&lt;table&gt; 
&lt;tr&gt;
&lt;td&gt;

&lt;font color="navy"&gt;Head First Java combines puzzles, strong visuals, mysteries, and soul-searching interviews with famous 
Java objects to engage you in many different ways. 
It's fast, it's fun, and it's impressive. And, despite its playful appearance, 
Head First Java is real deal: it is a complete introduction to object-oriented programming and Java. 
We can learn everything from the fundamentals to advanced topics, including threads, network sockets, 
and distributed programming with RMI. And the new. second edition focuses on Java 5.0, 
the latest version of the Java language and development platform. 
Because Java 5.0 is a major update to the platform, with deep, code-level changes, 
even more careful study and implementation is required. 
So learning the Head First way is more important than ever. &lt;br /&gt; &lt;/font&gt;
&lt;font color="silver"&gt;
Head First Java&lt;br /&gt;
By Kathy Sierra, Bert Bates&lt;br /&gt;
Edition: 2, illustrated&lt;br /&gt;
Published by O'Reilly, 2005&lt;br /&gt;
ISBN 0596009208, 9780596009205&lt;br /&gt;
688 pages&lt;br /&gt;
&lt;/font&gt;

&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7844341291913287808-816927461715413887?l=javasansar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/816927461715413887/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7844341291913287808&amp;postID=816927461715413887' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/816927461715413887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/816927461715413887'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/2008/12/java-database.html' title=''/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08436281743629996970'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_Hg_5jfleI8k/SYefcVQ-1TI/AAAAAAAAACE/3uBsHtsMehA/s72-c/head_first.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7844341291913287808.post-1383406982343733115</id><published>2008-12-13T18:19:00.004-05:00</published><updated>2009-08-10T21:13:02.410-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Advanced'/><title type='text'>Java Webservice</title><content type='html'>&lt;br&gt;&lt;br&gt;
&lt;font color="red"&gt;&lt;MARQUEE width="50%"&gt;Java Webservice Tutorial will be comming soon...&lt;/MARQUEE&gt;&lt;/font&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7844341291913287808-1383406982343733115?l=javasansar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/1383406982343733115/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7844341291913287808&amp;postID=1383406982343733115' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/1383406982343733115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/1383406982343733115'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/2008/12/java-webservice.html' title='Java Webservice'/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08436281743629996970'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7844341291913287808.post-8005948324516679751</id><published>2008-12-13T18:19:00.003-05:00</published><updated>2009-08-10T21:12:41.645-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Advanced'/><title type='text'>Eclipse Tutorial</title><content type='html'>&lt;p&gt;
&lt;font color="red"&gt;&lt;MARQUEE width="50%"&gt;Eclipse Tutorial will be comming soon...&lt;/MARQUEE&gt;&lt;/font&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7844341291913287808-8005948324516679751?l=javasansar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/8005948324516679751/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7844341291913287808&amp;postID=8005948324516679751' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/8005948324516679751'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/8005948324516679751'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/2008/12/eclipse-tutorial.html' title='Eclipse Tutorial'/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08436281743629996970'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7844341291913287808.post-1257987250290860555</id><published>2008-12-13T18:18:00.011-05:00</published><updated>2009-08-20T00:38:34.040-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Advanced'/><title type='text'>Unix/Solaris Basics</title><content type='html'>&lt;font color="red"&gt;&lt;MARQUEE width="100%"&gt;Learn Java in just 5 Weeks&lt;/MARQUEE&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFFF"&gt;

&lt;tr&gt;
&lt;td bgcolor="white"&gt;
&lt;a href="#u1b1"&gt;&lt;b&gt;Unix/Solaris Introduction&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;
&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="white"&gt;
&lt;a href="#u1b2"&gt;&lt;b&gt;Managing File and Directory&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;
&lt;td&gt;
&lt;a href="http://javasansar.blogspot.com/2008/12/week-two-tutorial.html"&gt;&lt;b&gt;&lt;i&gt;&lt;font color ="#FF6600"&gt;Goto Week Two Tutorial&amp;#8594;&lt;/font&gt;&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;

&lt;td&gt;
&lt;a href="http://javasansar.blogspot.com/2008/12/week-three-tutorial.html"&gt;&lt;b&gt;&lt;i&gt;&lt;font color ="#FF6600"&gt;Goto Week Three Tutorial&amp;#8594;&lt;/font&gt;&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;
&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="white"&gt;
&lt;a href="#u1b3"&gt;&lt;b&gt;Working with Shell&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="white"&gt;
&lt;a href="#u1b4"&gt;&lt;b&gt;File Archive and Remote transfer&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="white"&gt;
&lt;a href="#u1b5"&gt;&lt;b&gt; Searching and Process Manipulation&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;&lt;/tr&gt;

&lt;/table&gt;
&lt;hr&gt;




&lt;b&gt;&lt;a name="u1b1"&gt;1. UNIX/Solaris Introduction.&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
&lt;p&gt;
UNIX was originally developed in 1969 by AT&amp;amp;T Bell laboratories. It was modified and made distributable by University of California 

at Berkeley in the Berkeley Software Distribution (BSD) UNIX. Sun's SunOS is also originated from BSD UNIX. Later on AT&amp;amp;T, BSD, 

and other OS Systems incorporated and developed SVR4 UNIX. SVR4 is the basis of current Sun's SunSolaris.
&lt;p&gt;
UNIX comes with three major components: Kernel, Shell, Directory.&lt;br&gt;
Kernel is the core of the any UNIX/SunOS system. It manages physical resources of the computer including CPU, devices, processes, file 

systems, and memory. &lt;/ br&gt;
Shell is an interface which gives user an access to interact between user and kernel. It is a command interpreter which accepts commands 

that user enters, interprets those commands and sends them to kernal and it is executed by the kernel and output is dispalyed on the 

standard output.&lt;/ br&gt;
UNIX including SunSolaris support three major type of shells: Bourne Shell, Korn Shell, and C Shell. The Command-Line Interface (CLI) syntax comprises of:
&lt;pre&gt; command  option(s) arguement(s)&lt;/pre&gt;&lt;/ br&gt;
UNIX commands are basically come with the single word such as ls, pwd, date, who, uname so on. Option(s) gives more precise result 

from the command such as: &lt;pre&gt;ls -l &lt;/pre&gt; where -l options will give list of files and directories with detail informations such as 

file permission, owner, file size, file names so on.
&lt;p&gt;
An argument in the UNIX command will allow to filter or define precise result you want to get such as &lt;pre&gt;ls -l &amp;lt;filename&amp;gt; &lt;/pre&gt; 

this will allow user to search exact file name he/she wants to display. The CLI allows to enter multiple commands in a signle line by using 

semicollon seperator such as &lt;pre&gt;ls -ltr &amp;lt;filename&amp;gt;; pwd; &lt;/pre&gt; Shell executes command from left to right.
&lt;p&gt;
Few basic commands used in UNIX/SunSolaris.&lt;/ br&gt;
&lt;table border="1" cellpadding="2" cellspacing="2" bgcolor="#F0FFFF"&gt;
&lt;tr&gt;&lt;th cellpadding="8"&gt;Command Names&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;pwd&lt;/td&gt;&lt;td&gt;Determines current working directory&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;ls&lt;/td&gt;&lt;td&gt;Lists files and directories&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;ls -la&lt;/td&gt;&lt;td&gt;Lists hidden and detail informaion of the files and directories&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;ls -ld&lt;/td&gt;&lt;td&gt;Lists directory without its contents&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;ls -R&lt;/td&gt;&lt;td&gt;Lists the content of direcory(s) recursively&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;ls -F&lt;/td&gt;&lt;td&gt;Lists the file types&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;file &amp;lt;filename&amp;gt;&lt;/td&gt;&lt;td&gt;Lists the file and directory types&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;cd &amp;lt;directoryname&amp;gt;&lt;/td&gt;&lt;td&gt;Changes directory&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;cd ..&lt;/td&gt;&lt;td&gt;Moving back to parent directory&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;cd ../..&lt;/td&gt;&lt;td&gt;Moving back to multiple level parent directory&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;cd &amp;lt;directoryname&amp;gt;&lt;/td&gt;&lt;td&gt;Relative Path&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;cd /&amp;lt;directoryname&amp;gt;&lt;/td&gt;&lt;td&gt;Absolute Path&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;cd&lt;/td&gt;&lt;td&gt;Return to Home directory&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;cd ~&lt;/td&gt;&lt;td&gt;Return Home directory&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;cd /&lt;/td&gt;&lt;td&gt;Retrun to root directory&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;cat &amp;lt;filename&amp;gt;&lt;/td&gt;&lt;td&gt;Displays file contents&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;more &amp;lt;filename&amp;gt;&lt;/td&gt;&lt;td&gt;View files one page/screen at a time&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;head &amp;lt;filename&amp;gt;&lt;/td&gt;&lt;td&gt;Displays first 10 line of a file&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;tail &amp;lt;filename&amp;gt;&lt;/td&gt;&lt;td&gt;Displays last 10 lines of a file&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;wc -w &amp;lt;filename&amp;gt;&lt;/td&gt;&lt;td&gt;Counts words of a file&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;lp &amp;lt;filename&amp;gt;&lt;/td&gt;&lt;td&gt;Submit print request&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;lpstat -option &amp;lt;printer&amp;gt;&lt;/td&gt;&lt;td&gt;Displays the status of print request&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;lp &amp;lt;filename&amp;gt;&lt;/td&gt;&lt;td&gt;Submit print request&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;lp &amp;lt;filename&amp;gt;&lt;/td&gt;&lt;td&gt;Submit print request&lt;/td&gt;&lt;/tr&gt;

&lt;/table&gt;
&lt;br /&gt;
&lt;a href="http://javasansar.blogspot.com/2008/12/unix.html"&gt;&lt;b&gt;&lt;i&gt;&lt;font color ="#FF6600"&gt;&amp;#8592;Return Menu&lt;/font&gt;&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;
&lt;p&gt;


&lt;b&gt;&lt;a name="u1b2"&gt;2. Managing File and Directory.&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
&lt;p&gt;
&lt;b&gt;Copy, move, and rename files and directories &lt;/b&gt;
&lt;p&gt;
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;
   $ cp options sources target
   $ cp -i file1 file2
   $ cp -i file1 /home/dir1
   $ pwd
     /export/home/user1
   $ cp -r dir1 dir2
   $ cp -r dir1 ../dir2/dir3
   $ ls ../dir2/dir3
     file1 file2 file3
   $ mv file1 file2 (rename file1 to file2)
   $ mv file1 /export/home/user1 (move file1 to home directory)
   $ mv file1 ~ (move file1 to current directory)
   $ mv dir1 dir2 (move conetent of dir1 to dir2)
   $ mv dir1 newdir (rename directory)
   $ mkdir dir1 dir2 dir3 (create multiple directories)
   $ mkdir dir1/sub_dir1 (create a directory/sub_directory)
   $ rmdir dir1 (delete an empty directory)
   $ rm -r dir1 (delete directory and its files)
   $ touch file1 file2 file3 (create file(s) )
   $ rm -i file1 (delete file1)
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;


&lt;b&gt; Using symbolic links &lt;/b&gt;
&lt;p&gt;
Symbolic link is a pointer which contains the path name to another directory or file. It is used to link files that are residing in different file 

system. It helps moving file to new location and provides a easy file name rather than its original name. &lt;br /&gt;

&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;
   $ ln -s source_file target_file 
   $ ln -s /export/home/user1/file1 file1_link (create symbolic link file)
   $ ls -F file1_link (view symbolic file)
   $ rm file_link (delete symbolic file)
    
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;

&lt;b&gt;VI Editor to create/modify files&lt;/b&gt;
&lt;p&gt;
VI Editor is command line, interactive text editor which is used to create and modify text (ASCII) files in UNIX system. VI Editor comes 

with three major modes:
&lt;pre&gt;
Command Mode
Edite Mode
LastLine Mode
&lt;/pre&gt;
Command Mode helps perform text change, delete, copy, move operation. Importantly, it will allow to search text string by using slash "/" 

and question mark symbol "?". Edit Mode will allow to add/type text and save the contents. Last Line Mode will allow advanced users to 

work extensively. Type collon ":" to go to LastLine Mode from the command line mode. 
&lt;p&gt;
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;
     $ vi filename (create a file in vi editor)
       type i or a to add text in vi editor which takes you to Edit Mode
       press Escape to go to Command Line
       :wq (save and quit the vi editor)
     $ view (view file in read-only mode)    
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;

&lt;table border="1" cellpadding="2" cellspacing="2" bgcolor="#F0FFFF"&gt;
&lt;tr&gt;&lt;th&gt;Key Sequences&lt;/th&gt;&lt;th&gt;Cursor Movement&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;i, a&lt;/td&gt;&lt;td&gt;add/append text in Edit Mode&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;b, w&lt;/td&gt;&lt;td&gt;back one word/forward one word&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;G, 1G&lt;/td&gt;&lt;td&gt;Last/First line of the file&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Control-F, Control-B&lt;/td&gt;&lt;td&gt;One page forward/backward&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-R, r&lt;/td&gt;&lt;td&gt;Overrites/Replaces characters&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;delete a character&lt;/td&gt;&lt;/tr&gt; 
&lt;tr&gt;&lt;td&gt;dd&lt;/td&gt;&lt;td&gt;delete a line&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;/String&lt;/td&gt;&lt;td&gt;Search string forward&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;?string&lt;/td&gt;&lt;td&gt;Search string backward&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;n, N&lt;/td&gt;&lt;td&gt;Search next occurence&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;yy&lt;/td&gt;&lt;td&gt;Yanks a copy of a line&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;p, P&lt;/td&gt;&lt;td&gt;paste abpve yanked copy under a line containing the cursor&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;:wq!&lt;/td&gt;&lt;td&gt;Save and Quit from Edit Mode&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;:q!&lt;/td&gt;&lt;td&gt;Quit without saving&lt;/td&gt;&lt;/tr&gt;

&lt;/table&gt;
&lt;br /&gt;


&lt;b&gt;Shell Metacharacters and Korn Shell Variables&lt;/b&gt;
&lt;p&gt;
Korn Shell metacharacters are specific characters, usually symbols which have special meaning to the shell. Metacharacters are catagorized 

in three parts:&lt;br /&gt;
&amp;#8594; Pathname Metacharacter&lt;br /&gt;
&amp;#8594; Filename Substitute metacharacter&lt;br /&gt;
&amp;#8594; Quota Metacharacter&lt;br /&gt;
&lt;p&gt;
Pathname Metacharacter simplifies the location changes within the directory structure. Pathname Metacharacter use symbols like Tilde (~) 

and Dash (-). Tilde "~" represents home directory. Filename substitution metacharacter allows to substitute shell metacharacter for other 

characters to ease to use commands. Symbols such as Asterisk (*), Question mark (?), Square braket ([]) are used as filename substitution 

metacharacters. Quota Metacharcter uses symbols such as single quota (' '), or double quota (" "), Back slash(/), dollar sign ($) etc. 

Quotation mark instructs shell to ignore or mask the all enclosed metacharacters. As we can use following commands to learn more about 

these Metacharacters.
&lt;p&gt;
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;
  $ cd ~/dir1 
  $ pwd
  $ /export/home/user/dir1 
  $ cd - (Navigate to previous directory)
  $ ls *.sh (List all files ending with .sh extension
  $ ls dir? (List all directory dir following one character i.e. dir1, dir2)
  $ ls [a-d]* (List set of files/directories starting with "a" To "d")
  $ (' ') (single forward quot ignore all enclosed metacharacters)
  $ (') (single backward quot execute and display the output)
  $ echo “Date: ‘date ‘”
  $ echo “The user pwd is: $(pwd). "
  $ (" ") (Ignore all except for single backward quot, backslash, and dollar sign)
  $ (\) (Do not interpret next character as metacharacters) 
  $ (&amp; (command) ) (Execute and display output of the command enclosed)
  $ echo $SHELL
    
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;b&gt;What is Korn Shell Variables&lt;/b&gt;
&lt;p&gt;
A temporary storage in memory is referred to a shell variable. Shell allows storage of values in variables. Variables contains information 

that is needed to function for other processes and it also allows to customize the shell.

&lt;p&gt; 
&lt;table border="0" cellpadding="3" cellspacing="3" bgcolor="white"&gt;
&lt;tr&gt;&lt;th&gt;Action:&lt;/th&gt;&lt;th&gt;Commands&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Set a variable&lt;/td&gt;&lt;td&gt;VAR=value, export VAR=value&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Unset variable&lt;/td&gt;&lt;td&gt;unset VAR&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Display all variables&lt;/td&gt;&lt;td&gt;set, env, export&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Values stored in variable&lt;/td&gt;&lt;td&gt;echo $VAR&lt;/td&gt;&lt;/tr&gt;

&lt;/table&gt;

&lt;/p&gt; 
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;
  
  $ echo $SHELL
  $ set (Display all variables
  $ export (Display variables and thier values
  $ var=value (set variable and assign value)
  $ private=/export/home/private (set a variable private)
  $ unset var (delete the value(s) stored in the variable)
  $ unset private (unset the private variable)
  $ EDITOR, FCEDIT, HOME, LOGNAME, PATH, PS1, PS2, SHELL  (default variables assigned)
  $ echo $EDITOR
  $ PS1 = “$LOGNAME@ ‘uname -n' \$PWD $ ” (Changing value of PS1 variable)
  $ echo $PATH
  $ PATH=$PATH:~ (Extend value of variable PATH)
  $ echo $PATH
  $ history -10
  $ history -r (Display reverse history)    
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;

&lt;b&gt;&lt;font color="purple"&gt;What is File Descriptor?&lt;/font&gt;&lt;/b&gt;
&lt;p&gt;
File Descriptors work with the processes created by shell. File Descriptor determines where input originated and where output and error 

message are sent. Three major types of File Descriptors are:
&lt;p&gt; 
&lt;table border="0" cellpadding="3" cellspacing="3" bgcolor="white"&gt;
&lt;tr&gt;&lt;th&gt;File Des #&lt;/th&gt;&lt;th&gt;File Desc Abbriviation&lt;/th&gt;&lt;th&gt;Definition&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;0&lt;/td&gt;&lt;td&gt;stdin&lt;/td&gt;&lt;td&gt;Standard Command Input&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;stdout&lt;/td&gt;&lt;td&gt;Standard Command Output&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;stderr&lt;/td&gt;&lt;td&gt;Standard Command Error &lt;/td&gt;&lt;/tr&gt;

&lt;/table&gt;
&lt;p&gt;
&lt;b&gt;&lt;font color="blue"&gt;What is PIPE (|) command?&lt;/font&gt;&lt;/b&gt;
&lt;p&gt;
Pipe character is used to redirect standard output to the standard input of another command. A pipe character is inserted between two 

commands. The first command writes the output to the standard output. The second command reads standard output from previous 

command as standard input. Overall, use of pipe helps to connect multiple commands.
&lt;br /&gt;
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;
  
  $ &amp;lt; (Read the input from a file)
  $ &amp;lt; &amp;lt;filename&amp;gt;
  $ &amp;gt; (Send output to a file)
  $ ls -ltr &gt; filename (Redirect the list result to a file)
  $ command 2&gt; filename (Redirect the Standard Error to a file)
  $ find /etc -type f -exec grep PASSREQ {} \; -print 2&gt; /dev/null
  $ --Use of Pipe (|) Character
  $ command | command
  $ ls -ltr | wc -w
  $ ps -ef (list all the processes and details)    
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;

&lt;b&gt;&lt;font color ="red"&gt;View and modify file and directory permissions&lt;/font&gt;&lt;/b&gt;
&lt;p&gt;
There are three type of users in UNIX/Solaris. Owner, Group, and Other. /etc/passwd and /etc/shadow files contain user's permissions. 

Each type of user has three set of permissions: Read, Write, Execute. First permission set represents owner, second group and third other 

respectively.
&lt;p&gt; 
&lt;table border="0" cellpadding="3" cellspacing="3" bgcolor="white"&gt;
&lt;tr&gt;&lt;th&gt;Permission&lt;/th&gt;&lt;th&gt;File Access&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Read (r)&lt;/td&gt;&lt;td&gt;View permission&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Write (w)&lt;/td&gt;&lt;td&gt;write/modify file/directory contents&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Execute (e)&lt;/td&gt;&lt;td&gt;Execute executable files i.e. shell script&lt;/td&gt;&lt;/tr&gt;

&lt;/table&gt;
&lt;p&gt;
To modify file/directory permssion for users, &lt;pre&gt;chmod&lt;/pre&gt; command is used. chmod command will change permssion based on 

the symbolic mode and octal mode. Symbolic Mode uses combination of letters and symbols to change user's file/directory permissions. 

Octal Mode uses octal numbers to change the permissions of files and directories. Octal mode consists of three octal numbers from 0-7 

which uses comination of numbers for the file/directory permssion.
&lt;p&gt; 
&lt;table border="0" cellpadding="3" cellspacing="3" bgcolor="white"&gt;
&lt;tr&gt;&lt;th&gt;Octal Value&lt;/th&gt;&lt;th&gt;Permission&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;Read&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;Write&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;Execute&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;
Octal table with combined set of permssions:
&lt;br /&gt;
&lt;table border="1" cellpadding="2" cellspacing="2" bgcolor="#F0FFFF"&gt;
&lt;tr&gt;&lt;th&gt;Permission Set&lt;/th&gt;&lt;th&gt;Octal Value&lt;/th&gt;&lt;th&gt;Binary Value&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;rwx&lt;/td&gt;&lt;td&gt;7&lt;/td&gt;&lt;td&gt;111(4+2+1)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;rw-&lt;/td&gt;&lt;td&gt;6&lt;/td&gt;&lt;td&gt;110(4+2+0)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;r-x&lt;/td&gt;&lt;td&gt;5&lt;/td&gt;&lt;td&gt;101(4+0+1)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;r--&lt;/td&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;100(4+0+0)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-wx&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;011(0+2+1)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-w-&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;010(0+2+0)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;--x&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;001(0+0+1)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;---&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;td&gt;000(0+0+0)&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
This table represents a combined octal values and set of permissions.
&lt;p&gt; 
&lt;table border="0" cellpadding="3" cellspacing="3" bgcolor="white"&gt;
&lt;tr&gt;&lt;th&gt;Octal Mode&lt;/th&gt;&lt;th&gt;Permission&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;777&lt;/td&gt;&lt;td&gt;rwxrwxrwx&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;775&lt;/td&gt;&lt;td&gt;rwxrwxr-x&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;755&lt;/td&gt;&lt;td&gt;rwxr-xr-x&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;644&lt;/td&gt;&lt;td&gt;rw-r--r--&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;

&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;
  
  $ ls -l filename (view file and directory permission)
  $ -rwx------ (read, write, execute permission for owner)
  $ ls -n (view UIDs and GIDs)
  $ chmod symbolic_mode filename
  $ ls -l file1
  $ chmod o+r file1 (Add read permission for "other" user)
  $ chmod o-r file1 (Remove read permission for "other" user)
  $ chmod octal_mode filename
  $ chmod 755 file1
  $ ls -l file1
  $ umask 027
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;a href="http://javasansar.blogspot.com/2008/12/unix.html"&gt;&lt;b&gt;&lt;i&gt;&lt;font color ="#FF6600"&gt;&amp;#8592;Return Menu&lt;/font&gt;&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;
&lt;p&gt;
&lt;b&gt;&lt;a name="u1b3"&gt;3. Working with Shell.&lt;/a&gt;&lt;/b&gt;
&lt;p&gt;
&lt;b&gt;&lt;font color="red"&gt;How to manage jobs in Shell?&lt;/font&gt;&lt;/b&gt;
&lt;p&gt;
A job is a process that runs in the shell.
&lt;p&gt;
&lt;table border="1" cellpadding="2" cellspacing="2" bgcolor="#F0FFFF"&gt;
&lt;tr&gt;&lt;th&gt;Command Set&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;jobs&lt;/td&gt;&lt;td&gt;List all jobs currently running&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;bg %135&lt;/td&gt;&lt;td&gt;Run current job at the backgroud&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;fg %135&lt;/td&gt;&lt;td&gt;Pull jobs from background to foreground&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;stops %135&lt;/td&gt;&lt;td&gt;Stop a job running at background&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;sleep 2000 &amp;&lt;/td&gt;&lt;td&gt;Running sleep command at background&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;alias&lt;/td&gt;&lt;td&gt;List all aliases currently running&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;alias h=history&lt;/td&gt;&lt;td&gt;Create alias 'h" for history command&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;alias info='uname -a;id; date'&lt;/td&gt;&lt;td&gt;Create alias 'info" for system info&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;unalias h&lt;/td&gt;&lt;td&gt;Remove alias 'h" of history command&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;b&gt;&lt;font color="green"&gt;What is Function &amp; Options in Korn Shell?&lt;/font&gt;&lt;/b&gt;
&lt;p&gt;
A function is set of ogranized commands which helps perform multiple task quicker and in a efficient ways. For example:the following 

function "num" creates a function that will help display total number of word counts redirected the output from first command&lt;br /&gt;
function num {ls -ltr | wc -w} 
&lt;p&gt;
Option are referred to "Switches" in which controls the shell's behavior and Options are regarded as boolean value such as true/false or 

On/Off.
&lt;p&gt;
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;  
  $ typeset -f (display all the current running fuctions)
  $ typeset +f (Display only fuction name)
  $ set -o (view current options)
  $ set -o option_name
  $ set -o noclobber (Turn on noclobber option)
  $ set +o noclobber (Turn Off noclobber option)
  $ ls -l &gt; log (list and redirect the result to log file)  
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;

&lt;b&gt;&lt;font color="blue"&gt;What is a Shell Script?&lt;/font&gt;&lt;/b&gt;
&lt;p&gt;
Shell Scripts are nothing more than text files which contains UNIX-based commands and comments. This great advantage of script is an 

ability to automate command sequences such that a script that can be repeatedly used while stopping or starting the system. Hash "#" 

sign is used to comment text on shell to provide more information about the script. and comments begining with "#" hash sign will be 

ignored by shell. Kernel reads "#!" first to indentify the program which interpret the line in the script. Shell Scripts are run line by line and 

users need read and execution permission to be able to run a script&lt;br /&gt;

&lt;p&gt;
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;  
  $ # this is comment (comment not read by shell)
  $ ls -ltr # list all the files with long list and permission (command and comments)
  $ chmod u+rx myScript.sh
  $ ./myScript.sh (Run the script) 
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;

&lt;b&gt;&lt;font color="purple"&gt;Create Conditional Commands if/fi&lt;/font&gt;&lt;/b&gt;
&lt;p&gt; 
Shell Script uses variety of conditional commands while creating scripts. Most used conditional commands are:
&lt;pre&gt;
Conditional Constructs: &amp;&amp; and ||
Conditional Commands: if 
Conditional Commands: while
Conditional Commands: case
&lt;/pre&gt;
"&amp;&amp;" conditional construct is used to show that second command will be performed only if precceeding command is successful. For 

example:&lt;br /&gt;
&lt;i&gt;mkdir /export/home/user1 &amp;&amp; cd /export/home/user1&lt;/i&gt; &lt;br /&gt;
In this case, user will navigated to user1 directory only if first command is successfully performed. "||" double pipe is used in script to 

develop a logic that if first command fails then go and execute second commands such that: &lt;br /&gt;
&lt;i&gt;mkdir /export/home/user1 || mkdir /export/home/user2&lt;/i&gt;
&lt;p&gt;
"if" command is used to evaluate first command, if passes then execute else go to next command and perform the same steps as the 

previously steps.Syntax to perform if conditional commands is&lt;br /&gt;
&lt;pre&gt;
if expression
then
command1
else
command2
fi
&lt;/pre&gt;
&lt;p&gt;
Here is an example how we can perform if else conditional command to test if user has a read "r" permission on /etc/passwd file&lt;br /&gt;
&lt;pre&gt;
$ if test -r /etc/passwd
&amp;gt; then
&amp;gt; echo "You have Read permission on /etc/passwd file"
&amp;gt; else
&amp;gt; echo "Sorry, you don't have Read permission on /etc/passwd file"
&amp;gt; fi
&lt;/pre&gt;
"while" command loops the commands until it meets its condition(s). Syntax to use while command is: &lt;br /&gt;
&lt;pre&gt;
while expression
do
command
done
&lt;/pre&gt;

&lt;p&gt;
&lt;a href="http://javasansar.blogspot.com/2008/12/unix.html"&gt;&lt;b&gt;&lt;i&gt;&lt;font color ="#FF6600"&gt;&amp;#8592;Return Menu&lt;/font&gt;&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;
&lt;p&gt;

&lt;script type="text/javascript"&gt;&lt;!--
indeed_jobroll_format = "300x250";
indeed_jobroll_publisher = "4159526527794233";
indeed_jobroll_keywords = "java developers";
indeed_jobroll_location = "";
indeed_jobroll_channel = "java developer";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="http://jobroll.indeed.com/ads/jobroll2.js"&gt;
&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://www.indeed.com/"&gt;Jobs&lt;/a&gt; by Indeed&lt;/noscript&gt;
&lt;hr&gt;
&lt;p&gt;
&lt;b&gt;&lt;a name="u1b4"&gt;4. File Archive and Remote Transfer.&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
&lt;p&gt;
&lt;b&gt;&lt;font color="green"&gt;Compressing &amp;amp; Archiving files and directories&lt;/font&gt;&lt;/b&gt;
&lt;p&gt;
By compressing and archiving files and directory will safeguard files and directories in an archive. It can be retrieved if they are 

accidentally deleted or lost. It can be archived in removable media such as external hard drive, USB Flash drive so on. We use two popular 

command to archive files and directories. &lt;br /&gt;
"tar" command and "jar" command. tar command archives file to and extract file from a single file called tar file. jar command combines 

multiple files and in addition to that it also compresses files. The following table applies to both tar, and jar commands.
&lt;p&gt;
&lt;table border="1" cellpadding="2" cellspacing="2" bgcolor="#F0FFFF"&gt;
&lt;tr&gt;&lt;th&gt;Command Set&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;Extract file from tar&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v&lt;/td&gt;&lt;td&gt;Execute in verbose mode, write to the standard output&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;f&lt;/td&gt;&lt;td&gt;Specifies the archive file&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;c&lt;/td&gt;&lt;td&gt;Create a new tar file&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;t&lt;/td&gt;&lt;td&gt;List the table of contents of tar file&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;  
  $ tar functions archivefile filename(s)
  $ tar cvf mytarfile.tar file1 file2 file3 (archive file1, file2, file3 in mytarfile.tar file)
  $ mt -f /dev/rmt/0 status (check system has tape device mounted)
  $ tar cvf /dev/rmt/0 . (archive everything on tape device from current directory)
  $ cp mytarfile.tar /export/home/user1/dir1 (copy mytarfile.tar to directory dir1)
  $ tar tf /dev/rmt/0 (View content of tar file in tape device)
  $ tar tf mytarfile.tar (view content of the tar files) 
  $ tar xvf /dev/rmt/0 (retrieve/extract tar file from tape device)
  $ tar xvf mytarfile.tar (Extract files from mytarfile.tar)
  $ jar options destination filenames
  $ jar cvf /export/home/user1/bundle.jar * (Archive everything to specified directory)
  $ compress -v mytarfile.tar (compress mytarfile.tar using -v option)
  $ zcat mytarfile.tar.Z (View compressed file)
  $ uncompress -v mytarfile.tar.Z (uncompress mytarfile.tar.Z file)
  $ gzip file1 file2 (compress files using gzip command)
  $ gunzip file1.gz file2.gz (uncompress file using gunzip command)
  $ gzcat file1.gz (view commpressed file)
  $ zip file.zip file1 file2 file3 (compress file1, file2, file3 in file.zip file)
  $ unzip file.zip (extract from file.zip)
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;b&gt;&lt;font color="red"&gt;Establish Remote login session&lt;/font&gt;&lt;/b&gt;
&lt;p&gt;
Remote login session allows user to access remote host from your current desktop allowing access to use resources in the remote 

computers. The ~/.rhost file provides user's access authentication for user to access the local host. 

&lt;p&gt;
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;  
  $ rlogin hostname
  $ uname -n (View the hostname)
  $ rlogin -l user1 hostname
  $ rlogin host3 (login to remote host to kill the corrupted session)
  $ pkill shell (kill the process remotely)
  $ telnet hostname (Type User/Passwd to remote host)
  $ vncserver options (Accessing X VNC window)
  $ rcp source_file hostname:destination_file
  $ rcp file1 remote_host:/tmp (copy file from localhost to remotehost)
  $ rcp remote_host:/tmp/file1 /export/home/user (copy file1 from remote host to local host)
  $ rcp -r ~/dir1 remote_host:/tmp (copy dir1 directory from local machine to remote machine)
  $ ftp hostname (Create ftp login session at remote_host)
  $ cd (Change the current directory at ftp remote session)
  $ lcd (Change the current directory at local system)
  $ mget (transfer multiple file from remote to local directory)
  $ mput (transfer multiple files from local to remote)
  $ bye (ends the ftp session)
  
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;a href="http://javasansar.blogspot.com/2008/12/unix.html"&gt;&lt;b&gt;&lt;i&gt;&lt;font color ="#FF6600"&gt;&amp;#8592;Return Menu&lt;/font&gt;&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;
&lt;p&gt;

&lt;b&gt;&lt;a name="u1b5"&gt;5. Search and Process Manipulation.&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
&lt;p&gt;
&lt;b&gt;&lt;font color="red"&gt;Search for content in files and directories&lt;/font&gt;&lt;/b&gt;
&lt;p&gt; 
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;
  
  $ grep option pattern filename
  $ grep -n success /home/user1 (search all the lines that contains string "success")
  $ egrep '[a-m]+root' /export/home/user1 (Search string root preceeding letter a to m)
  $ fgrep success *.sh (search string "success" in all files whose extension is .sh)
  $ egrep 'failure| success' file1 (display all the lines that contains either failure or success)
  
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;b&gt;&lt;font color="red"&gt;Search for files and directories &lt;/font&gt;&lt;/b&gt;
&lt;p&gt; 
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;
  
  $ find pathname expression action
  $ find ~ -name file1 (find a file by file name on home directory)
  $ find ~ -name file1 -ok rm {} \; (find a file "file1" and delete it) or
  $ find ~ -name *.sh -exec rm {} \; (find all files with .sh ext and delete them) 
  $ find . -name file1 (find a file "file1" on current directory)
  $ find . -mtime +3 (find files Not modified in last 3 days on current directory)
  $ find ~ -size +20 (find files that is larger than block 20)
  $ find . -mtime +3 (find files Not modified in last 3 days on current directory)
  $ find / -name file1 (find file1 starting from root (/) directory)
  
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;b&gt;&lt;font color="red"&gt;View and search for a specific process&lt;/font&gt;&lt;/b&gt;
&lt;p&gt; 
When one logs in or open an application or run command, UNIX/Solaris systems create processes. It is called a daemon and these provide 

services and runs on the backgroud. Each process comes with an unique Process Identification called "PID" and which is used by the kernel 

to manage and track processes. Also, each process includes an User ID "UID" and Group ID "GID" which reflects who owns the process(s). 

Processes have children processes and child process is executed first than the parent process.
&lt;p&gt; 
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;
  
  $ ps option(s)
  $ ps -ef | more (display all the current running processes with uid, pid)
  $ ps -e | grep lp (search list of ps and send to grep which searches a text "lp") 
  $ pgrep lp (search process "lp")
  $ ptree 135 (List process in tree hierachy structure following the child processes)
  $ find . -mtime +3 (find files Not modified in last 3 days on current directory)
  $ kill -option PIDs
  $ pkill -option PIDs
  $ kill -9 135
  
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
Processes respond to signal messages such that if you hit "Control+C", this will send signal 2 which means interrupt the current process. 

So signal are identified by signal number and thier names. The following table will display some very essential signals, their names, and 

associated actions:
&lt;p&gt; 
&lt;table border="0" cellpadding="3" cellspacing="3" bgcolor="white"&gt;
&lt;tr&gt;&lt;th&gt;Signal #&lt;/th&gt;&lt;th&gt;Signal Name&lt;/th&gt;&lt;th&gt;Definition&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;SIGHUP&lt;/td&gt;&lt;td&gt;Hang Up or drop terminal conection&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;SIGINT&lt;/td&gt;&lt;td&gt;Interrupt (Control+C)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;9&lt;/td&gt;&lt;td&gt;SIGKILL&lt;/td&gt;&lt;td&gt;Kill processes &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;15&lt;/td&gt;&lt;td&gt;SIGTERM&lt;/td&gt;&lt;td&gt;Terminate a process&lt;/td&gt;&lt;/tr&gt;

&lt;/table&gt;
&lt;p&gt;

&lt;a href="http://javasansar.blogspot.com/2008/12/unix.html"&gt;&lt;b&gt;&lt;i&gt;&lt;font color ="#FF6600"&gt;&amp;#8592;Return Menu&lt;/font&gt;&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;
&lt;p&gt;

&lt;hr&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7844341291913287808-1257987250290860555?l=javasansar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/1257987250290860555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7844341291913287808&amp;postID=1257987250290860555' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/1257987250290860555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/1257987250290860555'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/2008/12/unix.html' title='Unix/Solaris Basics'/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08436281743629996970'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7844341291913287808.post-8768156751169426709</id><published>2008-12-13T18:17:00.008-05:00</published><updated>2009-08-20T00:11:50.455-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Advanced'/><title type='text'>Unix/Solaris Advanced</title><content type='html'>&lt;font color="red"&gt;&lt;MARQUEE width="100%"&gt;Learn Java in just 5 Weeks&lt;/MARQUEE&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFFF"&gt;

&lt;tr&gt;
&lt;td bgcolor="white"&gt;
&lt;a href="#u1b1"&gt;&lt;b&gt;Unix/Solaris Introduction&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;
&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="white"&gt;
&lt;a href="#u1b2"&gt;&lt;b&gt;Managing File and Directory&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;
&lt;td&gt;
&lt;a href="http://javasansar.blogspot.com/2008/12/week-two-tutorial.html"&gt;&lt;b&gt;&lt;i&gt;&lt;font color ="#FF6600"&gt;Goto Week Two Tutorial&amp;#8594;&lt;/font&gt;&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;

&lt;td&gt;
&lt;a href="http://javasansar.blogspot.com/2008/12/week-three-tutorial.html"&gt;&lt;b&gt;&lt;i&gt;&lt;font color ="#FF6600"&gt;Goto Week Three Tutorial&amp;#8594;&lt;/font&gt;&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;
&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="white"&gt;
&lt;a href="#u1b3"&gt;&lt;b&gt;Working with Shell&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="white"&gt;
&lt;a href="#u1b4"&gt;&lt;b&gt;File Archive and Remote transfer&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td bgcolor="white"&gt;
&lt;a href="#u1b5"&gt;&lt;b&gt; Searching and Process Manipulation&lt;/b&gt;&lt;/a&gt;
&lt;/td &gt;&lt;/tr&gt;

&lt;/table&gt;
&lt;hr&gt;




&lt;b&gt;&lt;a name="u1b1"&gt;1. UNIX/Solaris Introduction.&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
&lt;p&gt;
UNIX was originally developed in 1969 by AT&amp;amp;T Bell laboratories. It was modified and made distributable by University of California 

at Berkeley in the Berkeley Software Distribution (BSD) UNIX. Sun's SunOS is also originated from BSD UNIX. Later on AT&amp;amp;T, BSD, 

and other OS Systems incorporated and developed SVR4 UNIX. SVR4 is the basis of current Sun's SunSolaris.
&lt;p&gt;
UNIX comes with three major components: Kernel, Shell, Directory.&lt;br&gt;
Kernel is the core of the any UNIX/SunOS system. It manages physical resources of the computer including CPU, devices, processes, file 

systems, and memory. &lt;/ br&gt;
Shell is an interface which gives user an access to interact between user and kernel. It is a command interpreter which accepts commands 

that user enters, interprets those commands and sends them to kernal and it is executed by the kernel and output is dispalyed on the 

standard output.&lt;/ br&gt;
UNIX including SunSolaris support three major type of shells: Bourne Shell, Korn Shell, and C Shell. The Command-Line Interface (CLI) syntax comprises of:
&lt;pre&gt; command  option(s) arguement(s)&lt;/pre&gt;&lt;/ br&gt;
UNIX commands are basically come with the single word such as ls, pwd, date, who, uname so on. Option(s) gives more precise result 

from the command such as: &lt;pre&gt;ls -l &lt;/pre&gt; where -l options will give list of files and directories with detail informations such as 

file permission, owner, file size, file names so on.
&lt;p&gt;
An argument in the UNIX command will allow to filter or define precise result you want to get such as &lt;pre&gt;ls -l &amp;lt;filename&amp;gt; &lt;/pre&gt; 

this will allow user to search exact file name he/she wants to display. The CLI allows to enter multiple commands in a signle line by using 

semicollon seperator such as &lt;pre&gt;ls -ltr &amp;lt;filename&amp;gt;; pwd; &lt;/pre&gt; Shell executes command from left to right.
&lt;p&gt;
Few basic commands used in UNIX/SunSolaris.&lt;/ br&gt;
&lt;table border="1" cellpadding="2" cellspacing="2" bgcolor="#F0FFFF"&gt;
&lt;tr&gt;&lt;th cellpadding="8"&gt;Command Names&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;pwd&lt;/td&gt;&lt;td&gt;Determines current working directory&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;ls&lt;/td&gt;&lt;td&gt;Lists files and directories&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;ls -la&lt;/td&gt;&lt;td&gt;Lists hidden and detail informaion of the files and directories&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;ls -ld&lt;/td&gt;&lt;td&gt;Lists directory without its contents&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;ls -R&lt;/td&gt;&lt;td&gt;Lists the content of direcory(s) recursively&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;ls -F&lt;/td&gt;&lt;td&gt;Lists the file types&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;file &amp;lt;filename&amp;gt;&lt;/td&gt;&lt;td&gt;Lists the file and directory types&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;cd &amp;lt;directoryname&amp;gt;&lt;/td&gt;&lt;td&gt;Changes directory&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;cd ..&lt;/td&gt;&lt;td&gt;Moving back to parent directory&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;cd ../..&lt;/td&gt;&lt;td&gt;Moving back to multiple level parent directory&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;cd &amp;lt;directoryname&amp;gt;&lt;/td&gt;&lt;td&gt;Relative Path&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;cd /&amp;lt;directoryname&amp;gt;&lt;/td&gt;&lt;td&gt;Absolute Path&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;cd&lt;/td&gt;&lt;td&gt;Return to Home directory&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;cd ~&lt;/td&gt;&lt;td&gt;Return Home directory&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;cd /&lt;/td&gt;&lt;td&gt;Retrun to root directory&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;cat &amp;lt;filename&amp;gt;&lt;/td&gt;&lt;td&gt;Displays file contents&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;more &amp;lt;filename&amp;gt;&lt;/td&gt;&lt;td&gt;View files one page/screen at a time&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;head &amp;lt;filename&amp;gt;&lt;/td&gt;&lt;td&gt;Displays first 10 line of a file&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;tail &amp;lt;filename&amp;gt;&lt;/td&gt;&lt;td&gt;Displays last 10 lines of a file&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;wc -w &amp;lt;filename&amp;gt;&lt;/td&gt;&lt;td&gt;Counts words of a file&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;lp &amp;lt;filename&amp;gt;&lt;/td&gt;&lt;td&gt;Submit print request&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;lpstat -option &amp;lt;printer&amp;gt;&lt;/td&gt;&lt;td&gt;Displays the status of print request&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;lp &amp;lt;filename&amp;gt;&lt;/td&gt;&lt;td&gt;Submit print request&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td cellpadding="8"&gt;lp &amp;lt;filename&amp;gt;&lt;/td&gt;&lt;td&gt;Submit print request&lt;/td&gt;&lt;/tr&gt;

&lt;/table&gt;
&lt;br /&gt;
&lt;a href="http://javasansar.blogspot.com/2008/12/unix.html"&gt;&lt;b&gt;&lt;i&gt;&lt;font color ="#FF6600"&gt;&amp;#8592;Return Menu&lt;/font&gt;&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;
&lt;p&gt;


&lt;b&gt;&lt;a name="u1b2"&gt;2. Managing File and Directory.&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
&lt;p&gt;
&lt;b&gt;Copy, move, and rename files and directories &lt;/b&gt;
&lt;p&gt;
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;
   $ cp options sources target
   $ cp -i file1 file2
   $ cp -i file1 /home/dir1
   $ pwd
     /export/home/user1
   $ cp -r dir1 dir2
   $ cp -r dir1 ../dir2/dir3
   $ ls ../dir2/dir3
     file1 file2 file3
   $ mv file1 file2 (rename file1 to file2)
   $ mv file1 /export/home/user1 (move file1 to home directory)
   $ mv file1 ~ (move file1 to current directory)
   $ mv dir1 dir2 (move conetent of dir1 to dir2)
   $ mv dir1 newdir (rename directory)
   $ mkdir dir1 dir2 dir3 (create multiple directories)
   $ mkdir dir1/sub_dir1 (create a directory/sub_directory)
   $ rmdir dir1 (delete an empty directory)
   $ rm -r dir1 (delete directory and its files)
   $ touch file1 file2 file3 (create file(s) )
   $ rm -i file1 (delete file1)
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;


&lt;b&gt; Using symbolic links &lt;/b&gt;
&lt;p&gt;
Symbolic link is a pointer which contains the path name to another directory or file. It is used to link files that are residing in different file 

system. It helps moving file to new location and provides a easy file name rather than its original name. &lt;br /&gt;

&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;
   $ ln -s source_file target_file 
   $ ln -s /export/home/user1/file1 file1_link (create symbolic link file)
   $ ls -F file1_link (view symbolic file)
   $ rm file_link (delete symbolic file)
    
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;

&lt;b&gt;VI Editor to create/modify files&lt;/b&gt;
&lt;p&gt;
VI Editor is command line, interactive text editor which is used to create and modify text (ASCII) files in UNIX system. VI Editor comes 

with three major modes:
&lt;pre&gt;
Command Mode
Edite Mode
LastLine Mode
&lt;/pre&gt;
Command Mode helps perform text change, delete, copy, move operation. Importantly, it will allow to search text string by using slash "/" 

and question mark symbol "?". Edit Mode will allow to add/type text and save the contents. Last Line Mode will allow advanced users to 

work extensively. Type collon ":" to go to LastLine Mode from the command line mode. 
&lt;p&gt;
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;
     $ vi filename (create a file in vi editor)
       type i or a to add text in vi editor which takes you to Edit Mode
       press Escape to go to Command Line
       :wq (save and quit the vi editor)
     $ view (view file in read-only mode)    
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;

&lt;table border="1" cellpadding="2" cellspacing="2" bgcolor="#F0FFFF"&gt;
&lt;tr&gt;&lt;th&gt;Key Sequences&lt;/th&gt;&lt;th&gt;Cursor Movement&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;i, a&lt;/td&gt;&lt;td&gt;add/append text in Edit Mode&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;b, w&lt;/td&gt;&lt;td&gt;back one word/forward one word&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;G, 1G&lt;/td&gt;&lt;td&gt;Last/First line of the file&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Control-F, Control-B&lt;/td&gt;&lt;td&gt;One page forward/backward&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-R, r&lt;/td&gt;&lt;td&gt;Overrites/Replaces characters&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;delete a character&lt;/td&gt;&lt;/tr&gt; 
&lt;tr&gt;&lt;td&gt;dd&lt;/td&gt;&lt;td&gt;delete a line&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;/String&lt;/td&gt;&lt;td&gt;Search string forward&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;?string&lt;/td&gt;&lt;td&gt;Search string backward&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;n, N&lt;/td&gt;&lt;td&gt;Search next occurence&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;yy&lt;/td&gt;&lt;td&gt;Yanks a copy of a line&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;p, P&lt;/td&gt;&lt;td&gt;paste abpve yanked copy under a line containing the cursor&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;:wq!&lt;/td&gt;&lt;td&gt;Save and Quit from Edit Mode&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;:q!&lt;/td&gt;&lt;td&gt;Quit without saving&lt;/td&gt;&lt;/tr&gt;

&lt;/table&gt;
&lt;br /&gt;


&lt;b&gt;Shell Metacharacters and Korn Shell Variables&lt;/b&gt;
&lt;p&gt;
Korn Shell metacharacters are specific characters, usually symbols which have special meaning to the shell. Metacharacters are catagorized 

in three parts:&lt;br /&gt;
&amp;#8594; Pathname Metacharacter&lt;br /&gt;
&amp;#8594; Filename Substitute metacharacter&lt;br /&gt;
&amp;#8594; Quota Metacharacter&lt;br /&gt;
&lt;p&gt;
Pathname Metacharacter simplifies the location changes within the directory structure. Pathname Metacharacter use symbols like Tilde (~) 

and Dash (-). Tilde "~" represents home directory. Filename substitution metacharacter allows to substitute shell metacharacter for other 

characters to ease to use commands. Symbols such as Asterisk (*), Question mark (?), Square braket ([]) are used as filename substitution 

metacharacters. Quota Metacharcter uses symbols such as single quota (' '), or double quota (" "), Back slash(/), dollar sign ($) etc. 

Quotation mark instructs shell to ignore or mask the all enclosed metacharacters. As we can use following commands to learn more about 

these Metacharacters.
&lt;p&gt;
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;
  $ cd ~/dir1 
  $ pwd
  $ /export/home/user/dir1 
  $ cd - (Navigate to previous directory)
  $ ls *.sh (List all files ending with .sh extension
  $ ls dir? (List all directory dir following one character i.e. dir1, dir2)
  $ ls [a-d]* (List set of files/directories starting with "a" To "d")
  $ (' ') (single forward quot ignore all enclosed metacharacters)
  $ (') (single backward quot execute and display the output)
  $ echo “Date: ‘date ‘”
  $ echo “The user pwd is: $(pwd). "
  $ (" ") (Ignore all except for single backward quot, backslash, and dollar sign)
  $ (\) (Do not interpret next character as metacharacters) 
  $ (&amp; (command) ) (Execute and display output of the command enclosed)
  $ echo $SHELL
    
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;b&gt;What is Korn Shell Variables&lt;/b&gt;
&lt;p&gt;
A temporary storage in memory is referred to a shell variable. Shell allows storage of values in variables. Variables contains information 

that is needed to function for other processes and it also allows to customize the shell.
&lt;p&gt;
&lt;pre&gt;
Action:               Command:
--------             -----------------------------
Set a variable          VAR=value, export VAR=value
Unset variable          unset VAR
Display all variables       set, env, export
Values stored in variable     echo $VAR
&lt;/pre&gt;
&lt;/p&gt; 
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;
  
  $ echo $SHELL
  $ set (Display all variables
  $ export (Display variables and thier values
  $ var=value (set variable and assign value)
  $ private=/export/home/private (set a variable private)
  $ unset var (delete the value(s) stored in the variable)
  $ unset private (unset the private variable)
  $ EDITOR, FCEDIT, HOME, LOGNAME, PATH, PS1, PS2, SHELL  (default variables assigned)
  $ echo $EDITOR
  $ PS1 = “$LOGNAME@ ‘uname -n' \$PWD $ ” (Changing value of PS1 variable)
  $ echo $PATH
  $ PATH=$PATH:~ (Extend value of variable PATH)
  $ echo $PATH
  $ history -10
  $ history -r (Display reverse history)    
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;

&lt;b&gt;&lt;font color="purple"&gt;What is File Descriptor?&lt;/font&gt;&lt;/b&gt;
&lt;p&gt;
File Descriptors work with the processes created by shell. File Descriptor determines where input originated and where output and error 

message are sent. Three major types of File Descriptors are:
&lt;p&gt;
&lt;pre&gt;
File Des #       File Desc Abbr             Definitions
---------        -------------------           ---------------
0             stdin               Standard Command Input
1             stdout              Standard Command Output
2             stderr              Standard Command Error
&lt;/pre&gt;
&lt;b&gt;&lt;font color="blue"&gt;What is PIPE (|) command?&lt;/font&gt;&lt;/b&gt;
&lt;p&gt;
Pipe character is used to redirect standard output to the standard input of another command. A pipe character is inserted between two 

commands. The first command writes the output to the standard output. The second command reads standard output from previous 

command as standard input. Overall, use of pipe helps to connect multiple commands.
&lt;br /&gt;
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;
  
  $ &amp;lt; (Read the input from a file)
  $ &amp;lt; &amp;lt;filename&amp;gt;
  $ &amp;gt; (Send output to a file)
  $ ls -ltr &gt; filename (Redirect the list result to a file)
  $ command 2&gt; filename (Redirect the Standard Error to a file)
  $ find /etc -type f -exec grep PASSREQ {} \; -print 2&gt; /dev/null
  $ --Use of Pipe (|) Character
  $ command | command
  $ ls -ltr | wc -w
  $ ps -ef (list all the processes and details)    
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;

&lt;b&gt;&lt;font color ="red"&gt;View and modify file and directory permissions&lt;/font&gt;&lt;/b&gt;
&lt;p&gt;
There are three type of users in UNIX/Solaris. Owner, Group, and Other. /etc/passwd and /etc/shadow files contain user's permissions. 

Each type of user has three set of permissions: Read, Write, Execute. First permission set represents owner, second group and third other 

respectively.
&lt;pre&gt;
Permission        File Access
-------------     ---------------
Read (r)       View permission
Write (w)       write/modify file/directory contents
Execute (e)      Execute executable files i.e. shell script
&lt;/pre&gt; 
To modify file/directory permssion for users, &lt;pre&gt;chmod&lt;/pre&gt; command is used. chmod command will change permssion based on 

the symbolic mode and octal mode. Symbolic Mode uses combination of letters and symbols to change user's file/directory permissions. 

Octal Mode uses octal numbers to change the permissions of files and directories. Octal mode consists of three octal numbers from 0-7 

which uses comination of numbers for the file/directory permssion.
&lt;pre&gt;&lt;font color="red"&gt;
Octal Value              Permission
------------            ---------------
4                    Read
2                    Write
1                    Execute
&lt;/font&gt;
&lt;/pre&gt;
&lt;p&gt;
Octal table with combined set of permssions:
&lt;br /&gt;
&lt;table border="1" cellpadding="2" cellspacing="2" bgcolor="#F0FFFF"&gt;
&lt;tr&gt;&lt;th&gt;Permission Set&lt;/th&gt;&lt;th&gt;Octal Value&lt;/th&gt;&lt;th&gt;Binary Value&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;rwx&lt;/td&gt;&lt;td&gt;7&lt;/td&gt;&lt;td&gt;111(4+2+1)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;rw-&lt;/td&gt;&lt;td&gt;6&lt;/td&gt;&lt;td&gt;110(4+2+0)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;r-x&lt;/td&gt;&lt;td&gt;5&lt;/td&gt;&lt;td&gt;101(4+0+1)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;r--&lt;/td&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;100(4+0+0)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-wx&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;011(0+2+1)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-w-&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;010(0+2+0)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;--x&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;001(0+0+1)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;---&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;td&gt;000(0+0+0)&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
This table represents a combined octal values and set of permissions.
&lt;pre&gt;
Octal Mode      Permissions
---------------    ----------------
777          rwxrwxrwx
775          rwxrwxr-x
755          rwxr-xr-x
644          rw-r--r--
&lt;/pre&gt;
&lt;p&gt;
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;
  
  $ ls -l filename (view file and directory permission)
  $ -rwx------ (read, write, execute permission for owner)
  $ ls -n (view UIDs and GIDs)
  $ chmod symbolic_mode filename
  $ ls -l file1
  $ chmod o+r file1 (Add read permission for "other" user)
  $ chmod o-r file1 (Remove read permission for "other" user)
  $ chmod octal_mode filename
  $ chmod 755 file1
  $ ls -l file1
  $ umask 027
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;a href="http://javasansar.blogspot.com/2008/12/unix.html"&gt;&lt;b&gt;&lt;i&gt;&lt;font color ="#FF6600"&gt;&amp;#8592;Return Menu&lt;/font&gt;&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;
&lt;p&gt;
&lt;b&gt;&lt;a name="u1b3"&gt;3. Working with Shell.&lt;/a&gt;&lt;/b&gt;
&lt;p&gt;
&lt;b&gt;&lt;font color="red"&gt;How to manage jobs in Shell?&lt;/font&gt;&lt;/b&gt;
&lt;p&gt;
A job is a process that runs in the shell.
&lt;p&gt;
&lt;table border="1" cellpadding="2" cellspacing="2" bgcolor="#F0FFFF"&gt;
&lt;tr&gt;&lt;th&gt;Command Set&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;jobs&lt;/td&gt;&lt;td&gt;List all jobs currently running&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;bg %135&lt;/td&gt;&lt;td&gt;Run current job at the backgroud&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;fg %135&lt;/td&gt;&lt;td&gt;Pull jobs from background to foreground&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;stops %135&lt;/td&gt;&lt;td&gt;Stop a job running at background&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;sleep 2000 &amp;&lt;/td&gt;&lt;td&gt;Running sleep command at background&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;alias&lt;/td&gt;&lt;td&gt;List all aliases currently running&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;alias h=history&lt;/td&gt;&lt;td&gt;Create alias 'h" for history command&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;alias info='uname -a;id; date'&lt;/td&gt;&lt;td&gt;Create alias 'info" for system info&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;unalias h&lt;/td&gt;&lt;td&gt;Remove alias 'h" of history command&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;b&gt;&lt;font color="green"&gt;What is Function &amp; Options in Korn Shell?&lt;/font&gt;&lt;/b&gt;
&lt;p&gt;
A function is set of ogranized commands which helps perform multiple task quicker and in a efficient ways. For example:the following 

function "num" creates a function that will help display total number of word counts redirected the output from first command&lt;br /&gt;
function num {ls -ltr | wc -w} 
&lt;p&gt;
Option are referred to "Switches" in which controls the shell's behavior and Options are regarded as boolean value such as true/false or 

On/Off.
&lt;p&gt;
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;  
  $ typeset -f (display all the current running fuctions)
  $ typeset +f (Display only fuction name)
  $ set -o (view current options)
  $ set -o option_name
  $ set -o noclobber (Turn on noclobber option)
  $ set +o noclobber (Turn Off noclobber option)
  $ ls -l &gt; log (list and redirect the result to log file)  
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;

&lt;b&gt;&lt;font color="blue"&gt;What is a Shell Script?&lt;/font&gt;&lt;/b&gt;
&lt;p&gt;
Shell Scripts are nothing more than text files which contains UNIX-based commands and comments. This great advantage of script is an 

ability to automate command sequences such that a script that can be repeatedly used while stopping or starting the system. Hash "#" 

sign is used to comment text on shell to provide more information about the script. and comments begining with "#" hash sign will be 

ignored by shell. Kernel reads "#!" first to indentify the program which interpret the line in the script. Shell Scripts are run line by line and 

users need read and execution permission to be able to run a script&lt;br /&gt;

&lt;p&gt;
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;  
  $ # this is comment (comment not read by shell)
  $ ls -ltr # list all the files with long list and permission (command and comments)
  $ chmod u+rx myScript.sh
  $ ./myScript.sh (Run the script) 
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;

&lt;b&gt;&lt;font color="purple"&gt;Create Conditional Commands if/fi&lt;/font&gt;&lt;/b&gt;
&lt;p&gt; 
Shell Script uses variety of conditional commands while creating scripts. Most used conditional commands are:
&lt;pre&gt;
Conditional Constructs: &amp;&amp; and ||
Conditional Commands: if 
Conditional Commands: while
Conditional Commands: case
&lt;/pre&gt;
"&amp;&amp;" conditional construct is used to show that second command will be performed only if precceeding command is successful. For 

example:&lt;br /&gt;
&lt;i&gt;mkdir /export/home/user1 &amp;&amp; cd /export/home/user1&lt;/i&gt; &lt;br /&gt;
In this case, user will navigated to user1 directory only if first command is successfully performed. "||" double pipe is used in script to 

develop a logic that if first command fails then go and execute second commands such that: &lt;br /&gt;
&lt;i&gt;mkdir /export/home/user1 || mkdir /export/home/user2&lt;/i&gt;
&lt;p&gt;
"if" command is used to evaluate first command, if passes then execute else go to next command and perform the same steps as the 

previously steps.Syntax to perform if conditional commands is&lt;br /&gt;
&lt;pre&gt;
if expression
then
command1
else
command2
fi
&lt;/pre&gt;
&lt;p&gt;
Here is an example how we can perform if else conditional command to test if user has a read "r" permission on /etc/passwd file&lt;br /&gt;
&lt;pre&gt;
$ if test -r /etc/passwd
&amp;gt; then
&amp;gt; echo "You have Read permission on /etc/passwd file"
&amp;gt; else
&amp;gt; echo "Sorry, you don't have Read permission on /etc/passwd file"
&amp;gt; fi
&lt;/pre&gt;
"while" command loops the commands until it meets its condition(s). Syntax to use while command is: &lt;br /&gt;
&lt;pre&gt;
while expression
do
command
done
&lt;/pre&gt;

&lt;p&gt;
&lt;a href="http://javasansar.blogspot.com/2008/12/unix.html"&gt;&lt;b&gt;&lt;i&gt;&lt;font color ="#FF6600"&gt;&amp;#8592;Return Menu&lt;/font&gt;&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;
&lt;p&gt;

&lt;script type="text/javascript"&gt;&lt;!--
indeed_jobroll_format = "300x250";
indeed_jobroll_publisher = "4159526527794233";
indeed_jobroll_keywords = "java developers";
indeed_jobroll_location = "";
indeed_jobroll_channel = "java developer";
//--&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="http://jobroll.indeed.com/ads/jobroll2.js"&gt;
&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://www.indeed.com/"&gt;Jobs&lt;/a&gt; by Indeed&lt;/noscript&gt;
&lt;hr&gt;
&lt;p&gt;
&lt;b&gt;&lt;a name="u1b4"&gt;4. File Archive and Remote Transfer.&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
&lt;p&gt;
&lt;b&gt;&lt;font color="green"&gt;Compressing &amp;amp; Archiving files and directories&lt;/font&gt;&lt;/b&gt;
&lt;p&gt;
By compressing and archiving files and directory will safeguard files and directories in an archive. It can be retrieved if they are 

accidentally deleted or lost. It can be archived in removable media such as external hard drive, USB Flash drive so on. We use two popular 

command to archive files and directories. &lt;br /&gt;
"tar" command and "jar" command. tar command archives file to and extract file from a single file called tar file. jar command combines 

multiple files and in addition to that it also compresses files. The following table applies to both tar, and jar commands.
&lt;p&gt;
&lt;table border="1" cellpadding="2" cellspacing="2" bgcolor="#F0FFFF"&gt;
&lt;tr&gt;&lt;th&gt;Command Set&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;x&lt;/td&gt;&lt;td&gt;Extract file from tar&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v&lt;/td&gt;&lt;td&gt;Execute in verbose mode, write to the standard output&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;f&lt;/td&gt;&lt;td&gt;Specifies the archive file&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;c&lt;/td&gt;&lt;td&gt;Create a new tar file&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;t&lt;/td&gt;&lt;td&gt;List the table of contents of tar file&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;  
  $ tar functions archivefile filename(s)
  $ tar cvf mytarfile.tar file1 file2 file3 (archive file1, file2, file3 in mytarfile.tar file)
  $ mt -f /dev/rmt/0 status (check system has tape device mounted)
  $ tar cvf /dev/rmt/0 . (archive everything on tape device from current directory)
  $ cp mytarfile.tar /export/home/user1/dir1 (copy mytarfile.tar to directory dir1)
  $ tar tf /dev/rmt/0 (View content of tar file in tape device)
  $ tar tf mytarfile.tar (view content of the tar files) 
  $ tar xvf /dev/rmt/0 (retrieve/extract tar file from tape device)
  $ tar xvf mytarfile.tar (Extract files from mytarfile.tar)
  $ jar options destination filenames
  $ jar cvf /export/home/user1/bundle.jar * (Archive everything to specified directory)
  $ compress -v mytarfile.tar (compress mytarfile.tar using -v option)
  $ zcat mytarfile.tar.Z (View compressed file)
  $ uncompress -v mytarfile.tar.Z (uncompress mytarfile.tar.Z file)
  $ gzip file1 file2 (compress files using gzip command)
  $ gunzip file1.gz file2.gz (uncompress file using gunzip command)
  $ gzcat file1.gz (view commpressed file)
  $ zip file.zip file1 file2 file3 (compress file1, file2, file3 in file.zip file)
  $ unzip file.zip (extract from file.zip)
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;b&gt;&lt;font color="red"&gt;Establish Remote login session&lt;/font&gt;&lt;/b&gt;
&lt;p&gt;
Remote login session allows user to access remote host from your current desktop allowing access to use resources in the remote 

computers. The ~/.rhost file provides user's access authentication for user to access the local host. 

&lt;p&gt;
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;  
  $ rlogin hostname
  $ uname -n (View the hostname)
  $ rlogin -l user1 hostname
  $ rlogin host3 (login to remote host to kill the corrupted session)
  $ pkill shell (kill the process remotely)
  $ telnet hostname (Type User/Passwd to remote host)
  $ vncserver options (Accessing X VNC window)
  $ rcp source_file hostname:destination_file
  $ rcp file1 remote_host:/tmp (copy file from localhost to remotehost)
  $ rcp remote_host:/tmp/file1 /export/home/user (copy file1 from remote host to local host)
  $ rcp -r ~/dir1 remote_host:/tmp (copy dir1 directory from local machine to remote machine)
  $ ftp hostname (Create ftp login session at remote_host)
  $ cd (Change the current directory at ftp remote session)
  $ lcd (Change the current directory at local system)
  $ mget (transfer multiple file from remote to local directory)
  $ mput (transfer multiple files from local to remote)
  $ bye (ends the ftp session)
  
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;a href="http://javasansar.blogspot.com/2008/12/unix.html"&gt;&lt;b&gt;&lt;i&gt;&lt;font color ="#FF6600"&gt;&amp;#8592;Return Menu&lt;/font&gt;&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;
&lt;p&gt;

&lt;b&gt;&lt;a name="u1b5"&gt;5. Search and Process Manipulation.&lt;/a&gt;&lt;/b&gt;&lt;br&gt;
&lt;p&gt;
&lt;b&gt;&lt;font color="red"&gt;Search for content in files and directories&lt;/font&gt;&lt;/b&gt;
&lt;p&gt; 
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;
  
  $ grep option pattern filename
  $ grep -n success /home/user1 (search all the lines that contains string "success")
  $ egrep '[a-m]+root' /export/home/user1 (Search string root preceeding letter a to m)
  $ fgrep success *.sh (search string "success" in all files whose extension is .sh)
  $ egrep 'failure| success' file1 (display all the lines that contains either failure or success)
  
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;b&gt;&lt;font color="red"&gt;Search for files and directories &lt;/font&gt;&lt;/b&gt;
&lt;p&gt; 
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;
  
  $ find pathname expression action
  $ find ~ -name file1 (find a file by file name on home directory)
  $ find ~ -name file1 -ok rm {} \; (find a file "file1" and delete it) or
  $ find ~ -name *.sh -exec rm {} \; (find all files with .sh ext and delete them) 
  $ find . -name file1 (find a file "file1" on current directory)
  $ find . -mtime +3 (find files Not modified in last 3 days on current directory)
  $ find ~ -size +20 (find files that is larger than block 20)
  $ find . -mtime +3 (find files Not modified in last 3 days on current directory)
  $ find / -name file1 (find file1 starting from root (/) directory)
  
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;b&gt;&lt;font color="red"&gt;View and search for a specific process&lt;/font&gt;&lt;/b&gt;
&lt;p&gt; 
When one logs in or open an application or run command, UNIX/Solaris systems create processes. It is called a daemon and these provide 

services and runs on the backgroud. Each process comes with an unique Process Identification called "PID" and which is used by the kernel 

to manage and track processes. Also, each process includes an User ID "UID" and Group ID "GID" which reflects who owns the process(s). 

Processes have children processes and child process is executed first than the parent process.
&lt;p&gt; 
&lt;table border="0" cellpadding="2" cellspacing="2" width="100%" bgcolor="#FFFFCC"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;pre&gt;
  
  $ ps option(s)
  $ ps -ef | more (display all the current running processes with uid, pid)
  $ ps -e | grep lp (search list of ps and send to grep which searches a text "lp") 
  $ pgrep lp (search process "lp")
  $ ptree 135 (List process in tree hierachy structure following the child processes)
  $ find . -mtime +3 (find files Not modified in last 3 days on current directory)
  $ kill -option PIDs
  $ pkill -option PIDs
  $ kill -9 135
  
&lt;/pre&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
Processes respond to signal messages such that if you hit "Control+C", this will send signal 2 which means interrupt the current process. 

So signal are identified by signal number and thier names. The following table will display some very essential signals, their names, and 

associated actions:
&lt;pre&gt;
Signal #        Signal Name          Definition 
--------        --------------        ----------------------    
1            SIGHUP         Hang Up or drop terminal conection 
2            SIGINT         Interrupt (Control+C)   
9            SIGKILL        Kill processes 
15           SIGTERM        Terminate a process       
&lt;/pre&gt; 
&lt;p&gt;
&lt;a href="http://javasansar.blogspot.com/2008/12/unix.html"&gt;&lt;b&gt;&lt;i&gt;&lt;font color ="#FF6600"&gt;&amp;#8592;Return Menu&lt;/font&gt;&lt;/i&gt;&lt;/b&gt;&lt;/a&gt;
&lt;p&gt;

&lt;hr&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7844341291913287808-8768156751169426709?l=javasansar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/8768156751169426709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7844341291913287808&amp;postID=8768156751169426709' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/8768156751169426709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/8768156751169426709'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/2008/12/structured-query-language.html' title='Unix/Solaris Advanced'/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08436281743629996970'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7844341291913287808.post-3639488822705590532</id><published>2008-12-13T18:16:00.001-05:00</published><updated>2009-08-10T21:14:41.876-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Advanced'/><title type='text'>Hyper Text Markup Language</title><content type='html'>&lt;br&gt;&lt;br&gt;
&lt;font color="red"&gt;&lt;MARQUEE width="50%"&gt;HTML/XML Tutorial will be comming soon...&lt;/MARQUEE&gt;&lt;/font&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7844341291913287808-3639488822705590532?l=javasansar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/3639488822705590532/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7844341291913287808&amp;postID=3639488822705590532' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/3639488822705590532'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/3639488822705590532'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/2008/12/hyper-text-markup-language.html' title='Hyper Text Markup Language'/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08436281743629996970'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7844341291913287808.post-3811050572704693017</id><published>2008-12-13T18:15:00.002-05:00</published><updated>2009-08-10T21:15:02.831-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java Advanced'/><title type='text'>Cascading Style Sheet</title><content type='html'>&lt;br&gt;&lt;br&gt;
&lt;font color="red"&gt;&lt;MARQUEE width="50%"&gt;Learn Java in just 5 weeks&lt;/MARQUEE&gt;&lt;/font&gt;
&lt;p&gt;CSS stands for Cascading Style Sheets. In web development, Cascading Style Sheets (CSS) is a stylesheet language used to control the layout of web pages. Its most common application is to style web pages written in HTML and XHTML, but the language can be applied to any kind of XML document, including SVG and XUL. CSS is used to help readers of web pages to define colors, fonts, layout, and other aspects of document presentation.
&lt;p&gt; Style Sheet are simply text file (.css) compose of lines that tells browsers how to display a html page. It is designed primarily to enable the separation of document content (written in HTML or a similar markup language) from document presentation (written in CSS). This separation can improve content accessibility, provide more flexibility and control in the specification of presentation characteristics, and reduce complexity and repetition in the structural content. &lt;br&gt;
In CSS, a style is a grouping of different properties given a common name. If you were to re-create this paper for the web, you could define styles for the text on your title page, outline page, and so on. For example, you can create a style called myHeadings and specify its font properties to be bold and have a font-size of 14pt. A specification of a property is known as a rule. With a style established, whenever you type in text for a my heading, you can set it to the myHeading style and all of that style's properties are applied to the selected text in one step. Later, if you decide to change the font color or some other aspect of the style, you can just change its definition or specification in the style sheet and the appearance of all text marked with that style will change throughout the webpage or website.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7844341291913287808-3811050572704693017?l=javasansar.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javasansar.blogspot.com/feeds/3811050572704693017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7844341291913287808&amp;postID=3811050572704693017' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/3811050572704693017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7844341291913287808/posts/default/3811050572704693017'/><link rel='alternate' type='text/html' href='http://javasansar.blogspot.com/2008/12/cascating-style-sheet.html' title='Cascading Style Sheet'/><author><name>javaSansar</name><uri>http://www.blogger.com/profile/10695749411300553169</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08436281743629996970'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry></feed>