<?xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"><channel><title>Techenzer®</title><description></description><managingEditor>noreply@blogger.com (Hamid)</managingEditor><pubDate>Sat, 4 Apr 2026 17:00:29 +0530</pubDate><generator>Blogger http://www.blogger.com</generator><openSearch:totalResults xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">25</openSearch:totalResults><openSearch:startIndex xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">1</openSearch:startIndex><openSearch:itemsPerPage xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">500</openSearch:itemsPerPage><link>http://hamidkalu.blogspot.com/</link><language>en-us</language><itunes:explicit>no</itunes:explicit><itunes:subtitle/><itunes:category text="Education"><itunes:category text="Educational Technology"/></itunes:category><itunes:owner><itunes:email>noreply@blogger.com</itunes:email></itunes:owner><item><title>ISO 8583 Tutorial – Introduction for Beginners</title><link>http://hamidkalu.blogspot.com/2014/02/iso-8583-tutorial-introduction-for.html</link><category>Electronic Transaction</category><category>ISO-8583</category><author>noreply@blogger.com (Hamid)</author><pubDate>Wed, 26 Feb 2014 10:31:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7786780271346850842.post-2253252397736387799</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="posttitle"&gt;
&lt;h2 class="pagetitle"&gt;
&lt;/h2&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://www.flickr.com/photos/37976179@N08/4687267445" style="margin-left: 1em; margin-right: 1em;" target="_blank"&gt;&lt;img alt="Financial Transaction Tax campaign" class="zemanta-img-inserted zemanta-img-configured" src="http://farm5.static.flickr.com/4037/4687267445_d25b9ea2e4_m.jpg" height="161" title="Financial Transaction Tax campaign" width="240" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;b&gt;Introduction&lt;/b&gt;&lt;/h2&gt;
reference Jimmy Blog&lt;br /&gt;
All (or most?) financial transaction is using &lt;a class="zem_slink" href="http://en.wikipedia.org/wiki/ISO_8583" rel="wikipedia" target="_blank" title="ISO 8583"&gt;ISO 8583&lt;/a&gt;
 standard, which at first I thought is a complicated standard. But after
 learn and see how it implemented it’s not as complex as I thought.&lt;br /&gt;
In this post I will try to explain (based on my experience &lt;img alt=":)" src="http://jimmod.com/blog/wp-includes/images/smilies/icon_smile.gif" /&gt; before I go deeper on the programming side.&lt;br /&gt;
Although it’s a ’standard’ I see that’s many variant for the detail implementation of ISO 8583.&lt;br /&gt;
Financial transaction is communication between 2 system through socket connection.&lt;br /&gt;
After connection established, each system can send message in ISO 8583 
format which commonly will be request and the other system will 
response.&lt;br /&gt;
From my experience the communication will be start with sign on and then the financial transactions.&lt;br /&gt;
Periodically an echo message is send to make sure the other system is still alive.&lt;br /&gt;
If I break down the flow:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a class="zem_slink" href="http://en.wikipedia.org/wiki/405-line_television_system" rel="wikipedia" target="_blank" title="405-line television system"&gt;System A&lt;/a&gt; open connection to System B (through specific IP and Port).&lt;/li&gt;
&lt;li&gt;Connection established.&lt;/li&gt;
&lt;li&gt;System A send Sign-On request message.&lt;/li&gt;
&lt;li&gt;System B send &lt;a class="zem_slink" href="http://en.wikipedia.org/wiki/Sign-on" rel="wikipedia" target="_blank" title="Sign-on"&gt;Sign-on&lt;/a&gt; response message.&lt;/li&gt;
&lt;li&gt;System A will start send &lt;a class="zem_slink" href="http://en.wikipedia.org/wiki/Ping" rel="wikipedia" target="_blank" title="Ping"&gt;Echo request&lt;/a&gt; message periodically (e.g every 1 minute).&lt;/li&gt;
&lt;li&gt;System B will send Echo response message when receive Echo request message.&lt;/li&gt;
&lt;li&gt;When financial transaction happen, System A will send Transaction request message.&lt;/li&gt;
&lt;li&gt;Then System B will send Transaction response message.&lt;/li&gt;
&lt;li&gt;If something wrong happen (usually timeout so System A didn’t get 
the response), System A will send Reversal request message to cancel 
the&amp;nbsp;previous transaction.&lt;/li&gt;
&lt;li&gt;System B will send Reversal response message.&lt;/li&gt;
&lt;/ol&gt;
I hope my explaination give clear basic understanding about the flow.&lt;br /&gt;
Next the question will be what’s this ISO 8583 message looks like.&lt;br /&gt;
We can separate the message into 3 parts:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Message &lt;a class="zem_slink" href="http://en.wikipedia.org/wiki/Data_type" rel="wikipedia" target="_blank" title="Data type"&gt;Type&lt;/a&gt; &lt;a class="zem_slink" href="http://en.wikipedia.org/wiki/Identifier" rel="wikipedia" target="_blank" title="Identifier"&gt;Identifier&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Bitmaps&lt;/li&gt;
&lt;li&gt;Data Elements&lt;/li&gt;
&lt;/ul&gt;
&lt;a href="http://jimmod.com/blog/wp-content/uploads/2011/07/ISO8583-structure.png"&gt;&lt;img alt="ISO8583 - structure" src="http://jimmod.com/blog/wp-content/uploads/2011/07/ISO8583-structure-300x28.png" height="28" title="ISO8583 - structure" width="300" /&gt;&lt;/a&gt;&lt;br /&gt;
ISO8583 – structure&lt;br /&gt;
&lt;h2&gt;
&lt;b&gt;Message Type Identifier&lt;/b&gt;&lt;/h2&gt;
Message Type Identifier or MTI is 4 digits numeric that describe the message type. It will explain the message function.&lt;br /&gt;
Commonly used:&lt;br /&gt;
- 02xx : Financial Message (e.g 0200 for request, 0210 for response)&lt;br /&gt;
- 04xx : Reversal Message (e.g 0400 for request, 0410 for response)&lt;br /&gt;
- 08xx : &lt;a class="zem_slink" href="http://en.wikipedia.org/wiki/Network_management" rel="wikipedia" target="_blank" title="Network management"&gt;Network Management&lt;/a&gt; Message (e.g 0800 for request, 0810 for response)&lt;br /&gt;
* I found more detail &amp;amp; complete list at &lt;a href="http://en.wikipedia.org/wiki/ISO_8583" target="_blank" title="wikipedia"&gt;wikipedia&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;
&lt;b&gt;Bitmaps&lt;/b&gt;&lt;/h2&gt;
Bitmaps is field that contain information about which &lt;a class="zem_slink" href="http://en.wikipedia.org/wiki/Data_element" rel="wikipedia" target="_blank" title="Data element"&gt;data element&lt;/a&gt; is presence or absence. Based on the variant it could be 16 &lt;a class="zem_slink" href="http://en.wikipedia.org/wiki/Hexadecimal" rel="wikipedia" target="_blank" title="Hexadecimal"&gt;hexadecimal&lt;/a&gt; characters.&lt;br /&gt;
An example will make it clear.&lt;br /&gt;
The bitmap is:&lt;br /&gt;
B220000000100000&lt;br /&gt;
If we break down to binary (I hope you understand how to convert hexadecimal to binary:) :&lt;br /&gt;
1011001000100000000000000000000000000000000100000000000000000000&lt;br /&gt;
Since I’m nice &lt;img alt=";)" src="http://jimmod.com/blog/wp-includes/images/smilies/icon_wink.gif" /&gt; I create graphical illustration.&lt;br /&gt;
&lt;a href="http://jimmod.com/blog/wp-content/uploads/2011/07/ISO8583-bitmaps.png"&gt;&lt;img alt="Bitmap sample" src="http://jimmod.com/blog/wp-content/uploads/2011/07/ISO8583-bitmaps-300x8.png" height="8" title="ISO8583 - bitmaps" width="300" /&gt;&lt;/a&gt;&lt;br /&gt;
Bitmap sample&lt;br /&gt;
You can see that in this bitmap it explain that data element in the message is 1, 3, 4, 7, 11.&lt;br /&gt;
There’s special meaning of first bit of bitmap, if it has value of 1 that mean there’s secondary bitmap.&lt;br /&gt;
And what the hell is this secondary bitmap?&lt;br /&gt;
Since 16 hexadecimal characters will can only contain info of 64 data 
element, some transactions contain data element number 64 – 128. That 
mean the 16 hexadecimal characters is not sufficient.&lt;br /&gt;
With set the first bit to ‘1′ that will inform there’s additional bitmap, which is another 16 hexadecimal characters.&lt;br /&gt;
So in this case the full bitmap example should be:&lt;br /&gt;
B220000000100000&lt;b&gt;0000000000800000&lt;/b&gt;&lt;br /&gt;
Convert to binary:&lt;br /&gt;
1011001000100000000000000000000000000000000100000000000000000000&lt;b&gt;0000000000000000000000000000000000000000100000000000000000000000&lt;/b&gt;&lt;br /&gt;
From the bitmap, data element presence in the message : 3, 4, 7, 11, 105.&lt;br /&gt;
&lt;a href="http://jimmod.com/blog/wp-content/uploads/2011/07/ISO8583-bitmaps-2.png"&gt;&lt;img alt="Sample Bitmap complete" src="http://jimmod.com/blog/wp-content/uploads/2011/07/ISO8583-bitmaps-2-300x20.png" height="26" title="ISO8583 - bitmaps - 2" width="400" /&gt;&lt;/a&gt;&lt;br /&gt;
Sample Bitmap complete&lt;br /&gt;
&lt;h2&gt;
Data Elements&lt;/h2&gt;
Data Elements is the essense of the whole &lt;a class="zem_slink" href="http://www.iso.org/" rel="homepage" target="_blank" title="International Organization for Standardization"&gt;ISO&lt;/a&gt; message, contain information about the transaction (transaction type, amount, customer id, etc).&lt;br /&gt;
Each data element have their on format, attribute and length.&lt;br /&gt;
Each data element number also have standard purpose, for example DE #4 is transaction amount.&lt;br /&gt;
I will explain based on the example above, since this is only introduction I don’t want to confuse beginner reader. In &lt;a href="http://en.wikipedia.org/wiki/ISO_8583#Data_elements" target="_blank"&gt;wikipedia &lt;/a&gt; there’s full list.&lt;br /&gt;
For our examples, the data element list:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;#3 – Processing code – n 6&lt;/li&gt;
&lt;li&gt;#4 – Transaction amount – n 12&lt;/li&gt;
&lt;li&gt;#7 – Transmission date &amp;amp; time – n 10&lt;/li&gt;
&lt;li&gt;#11 – Systems trace audit number – n 6&lt;/li&gt;
&lt;li&gt;#44 – Additional response data – an ..25&lt;/li&gt;
&lt;li&gt;#105 – Reserved for ISO use – ans …999&lt;/li&gt;
&lt;/ul&gt;
To make it practical let’s just use example.&lt;br /&gt;
We want to send :&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;DE #3 : 201234&lt;/li&gt;
&lt;li&gt;DE #4 : 10000&lt;/li&gt;
&lt;li&gt;DE #7 : 1107221830&lt;/li&gt;
&lt;li&gt;DE #11 : 123456&lt;/li&gt;
&lt;li&gt;DE #44 : A5DFGR&lt;/li&gt;
&lt;li&gt;DE #105 : ABCDEFGHIJ 1234567890&lt;/li&gt;
&lt;/ul&gt;
Using above value, the data in data elements :&lt;br /&gt;
&lt;a href="http://jimmod.com/blog/wp-content/uploads/2011/07/ISO8583-de2.png"&gt;&lt;img alt="ISO8583 - de" src="http://jimmod.com/blog/wp-content/uploads/2011/07/ISO8583-de2-300x77.png" height="163" title="ISO8583 - de" width="640" /&gt;&lt;/a&gt;&lt;br /&gt;
ISO8583 – de&lt;br /&gt;
Based on the type each value will be formatted.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;a : alpha (including blanks)&lt;/li&gt;
&lt;li&gt;n : numeric value&lt;/li&gt;
&lt;li&gt;s : special characters&lt;/li&gt;
&lt;li&gt;x (no dot) : length is x (fixed)&lt;/li&gt;
&lt;li&gt;.x (one dot) : &amp;nbsp;max length is x (1 digit in front as length info)&lt;/li&gt;
&lt;li&gt;..xx (two dot) : &amp;nbsp;max length is xx (2 digit in front as length info)&lt;/li&gt;
&lt;li&gt;…xxx (three dot) : &amp;nbsp;max length is xxx (3 digit in front as length info)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
&lt;b&gt;ISO Message&lt;/b&gt;&lt;/h2&gt;
From above examples the whole ISO message will be :&lt;br /&gt;
0200B2200000001000000000000000800000201234000000010000110722183012345606A5DFGR021ABCDEFGHIJ 1234567890&lt;br /&gt;
&lt;a href="http://jimmod.com/blog/wp-content/uploads/2011/07/ISO8583-full1.png"&gt;&lt;img alt="ISO8583 - full" src="http://jimmod.com/blog/wp-content/uploads/2011/07/ISO8583-full1.png" height="88" title="ISO8583 - full" width="983" /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;
Conclusion&lt;/h2&gt;
Ok. This article already long enough &lt;img alt=":)" src="http://jimmod.com/blog/wp-includes/images/smilies/icon_smile.gif" /&gt;&lt;br /&gt;
Actually I always prefer short article, but on this case it’s cannot be to short.&lt;br /&gt;
Anyway, I hope this article is clear enough for you.&lt;br /&gt;
Like always, just drop question in the comment if you confused.&lt;br /&gt;
&lt;h6 class="zemanta-related-title" style="font-size: 1em;"&gt;
&lt;/h6&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="http://farm5.static.flickr.com/4037/4687267445_d25b9ea2e4_t.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">7</thr:total></item><item><title>How to Get More Facebook Likes for Your Page</title><link>http://hamidkalu.blogspot.com/2013/11/how-to-get-more-facebook-likes-for-your.html</link><category>Facebook hacked</category><author>noreply@blogger.com (Hamid)</author><pubDate>Sun, 3 Nov 2013 20:02:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7786780271346850842.post-3021290976569030347</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;10 Easy Ways to Get More Facebook Likes for Your Business Page&lt;/span&gt;&lt;/h2&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&amp;nbsp;In order to achieve success on Facebook you need a community. That’s a
 fact. If you don’t have a community, you don’t have anyone listening to
 you, and if there’s no one listening to you, it’s difficult to build 
brand awareness and deliver ROI.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;You need a community filled with people who like you and share your 
content with like-minded friends. But it’s not just about the quantity 
of Facebook likes that you collect, it’s about the quality; attracting 
Facebook likes from a group targeted to suit your business goals whose 
comments (and endorsement!) can increase your shares on Facebook.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;So here are ten quick and easy tips to drive targeted Facebook likes to your business page.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;1. Complete your Facebook Page Profile&lt;/span&gt;&lt;/h2&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Your Facebook Page is the first thing people see when they come to 
visit you on Facebook. Let visitors know why they should like you! 
Create a catchy description and make sure you categorize your page 
correctly. Also make sure to list your address, phone number and hours 
of operation (if applicable). Not only will this inform your potential 
followers, it will tell Facebook what kind of organization you are you 
so they know to show your page when users are searching for companies 
like yours – which can increase your Facebook likes even more!&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;2. Ask friends&amp;nbsp; and other contacts to like you on Facebook&lt;/span&gt;&lt;/h2&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Friends are like underpants. Some snap under pressure, some are a 
little twisted, but some will give you support. When you first create a 
Facebook Page like this&amp;nbsp;&lt;a href="http://facebook.com/ShokingTrick" target="_blank"&gt;PAGE&lt;/a&gt; invite your supportive friends, family and business partners to like your Facebook Page.
 These initial likes will give you higher social media credibility and 
visibility. Then, alert your customers, prospects and your other social 
communities, and promote your Facebook page anywhere you mention your 
website. If people don’t know your Facebook page exists, they can’t like
 it.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;3. Add social plugins to your website&lt;/span&gt;&lt;/h2&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Visitors on your website should be able to&amp;nbsp; find your Facebook Page easily. My recommendation is to use &lt;a href="https://developers.facebook.com/docs/plugins/" rel="nofollow" target="_blank"&gt;Facebook’s Social Plugins&lt;/a&gt;, like the &lt;a href="https://developers.facebook.com/docs/reference/plugins/like-box/" rel="nofollow" target="_blank"&gt;Like box plugin&lt;/a&gt;, to get more Facebook likes. These plugins include a like button, your recent posts, and pictures of some of your fans.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;4. Find out what interests your community&lt;/span&gt;&lt;/h2&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;With Facebook’s new Graph Search it’s really easy to find out what 
interests your target community, and post relevant content to increase 
Facebook likes.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Here’s a real example:&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;I have a Facebook Page &lt;a href="http://facebook.com/ShokingTrick" target="_blank"&gt;Shocking fb Tircks&lt;/a&gt; on facebook . To learn more about my target community’s interests, I 
search for “how many people like facebook trick".&lt;/span&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeyh7DVfYZhhbmG_I45BGOkn6fE3hp-WSONuCYqq-3T5nGjB4Z5xMziHc3DMQJplwFHkMC2s6g4Uof5SoQQilhU0S2sbo-uVXtIQ0G425-6V2aCJqofz_GoveIEbsMV0nnpqtrPknDfsTB/s1600/Untitled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeyh7DVfYZhhbmG_I45BGOkn6fE3hp-WSONuCYqq-3T5nGjB4Z5xMziHc3DMQJplwFHkMC2s6g4Uof5SoQQilhU0S2sbo-uVXtIQ0G425-6V2aCJqofz_GoveIEbsMV0nnpqtrPknDfsTB/s640/Untitled.png" height="488" width="640" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;This information is great to have at hand when I’m thinking about 
what to post on my Facebook page. By posting content that my audience is
 interested in (for example, suggesting how to secure your password and all) they will share it with their friends and help me get more 
Facebook likes. This same content will also attract likes from people 
who come to my Facebook page from &lt;a href="http://hamidkalu.blogspot.in/" target=""&gt;my website&lt;/a&gt;, email signature, or a 
Facebook search.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;5. Use Facebook Ads&lt;/span&gt;&lt;/h2&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Facebook ads are another great way to increase Facebook likes. To get
 the most out of your ads, you can target by your community’s interests 
to find people similar to your current fans.&lt;br /&gt;
In the image below, you can see how I’ve used the information that I got
 from Graph Search and how I’ve targeted my ad for my new pizza place.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;img alt="Facebook Ads" class="alignleft size-medium wp-image-3942" src="http://www.meltwater.com/wp-content/uploads/2013/08/Facebook-Ads-300x108.png" height="115" width="320" /&gt;&lt;/div&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Experiment with different types of ads to see what works best for 
your organization, and make sure you choose the option that allows 
Facebook users to like your page directly from the ad.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;6. Run a contest&lt;/span&gt;&lt;/h2&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;There are many companies that have created successful contests on 
Facebook that resulted in many thousands of Facebook likes. But there 
are some things that you need to know before you create your own 
contest. For starters, make sure that your contest follows Facebook’s &lt;a href="https://www.facebook.com/page_guidelines.php" rel="nofollow" target="_blank"&gt;promotion guidelines&lt;/a&gt;.
 Your contest must use a Facebook app, which allows you to create a 
fan-gate, so that only those who first like your page can participate in
 the contest. Apps also have a unique URL, so you can promote your 
contest with a Facebook ad and increase Facebook likes even more.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Also, when you create a contest make sure that your app is working 
for mobile users, that the content of the contest is funny, that it’s 
easy to participate and that the contest encourage users to share their 
result and participation with their friends.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;7. Like, and interact with, other companies&lt;/span&gt;&lt;/h2&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Did you know that you can engage with other company pages as your 
Business Page on Facebook? This is a great way to build awareness among 
like-minded companies and their followers.&amp;nbsp; To do this, visit your 
Facebook Page, click on “Edit Page” in your Admin Panel and select “Use 
Facebook as YourPage.”&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;img alt="Facebook Like as Page" class="alignleft size-full wp-image-3943" src="http://www.meltwater.com/wp-content/uploads/2013/08/Facebook-Like-as-Page.png" height="127" width="154" /&gt;&lt;/div&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;div dir="ltr"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Finding companies to like and interact with is easy. Use 
Graph search and search for e.g. companies, pages, places that is of 
interests for your company and like these Pages (you can’t like personal
 profiles).&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;After you have liked some Pages, you can view your company’s Newsfeed
 and engage with the pages you like. Not only is the company likely to 
follow you back, but their engagement with your page will help you 
increase Facebook likes amongst their followers as well.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;8. Publish engaging content&lt;/span&gt;&lt;/h2&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;It’s important to publish engaging, entertaining and interesting 
posts on a regular basis, and to keep an eye out for the posts that get 
the most engagement. If your posts are valuable to your followers, then 
they will share your posts with their friends, helping you increase your
 Facebook likes. Images are among the best types of post for driving 
engagement so make sure you publish images your followers can relate to 
and will like. You may also want to include calls to action in some of 
your posts, asking followers to like, comment or share your content, or 
ask your community a question.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;9. Be active&lt;/span&gt;&lt;/h2&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;By now you know that you should publish engaging, interesting and 
entertaining content. But how often should you post? There is no magic 
number but there are best practices and analytics to guide you. Post &lt;i&gt;at least&lt;/i&gt;
 one status update per day, and experiment with the timing of your posts
 to see when the majority of your followers are active. People are 
unlikely to like your Facebook page if you don’t post regularly – and 
they certainly won’t engage with your content (or help you get more 
likes) if they don’t see your posts.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;10. Measure, analyze and learn&lt;/span&gt;&lt;/h2&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Use Facebook Insights to find useful metrics on your page 
performance. You can see things like reach (how many users are seeing 
your posts), engaged users (how many users engage with your posts) and 
new likes (when and why do you get new followers). These metrics will 
help you understand what’s driving your likes and engagement, so that 
you can adjust your posts accordingly. If you would like to know if you 
have good engagement, or want other recommendations for improvement, try
 out our free Facebook analytics tool, &lt;a href="http://likealyzer.com/" target="_blank"&gt;LikeAlyzer.&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Now you people think what about my own Website page, let me tell you I have more than 20 pages some of them have more than 2 lacs users and I am the only person who handles this.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;check this out &lt;a href="http://facebook.com/aashiqui2" target="_blank"&gt;AASHIQUI2.&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;Would you like to add any tips for getting more Facebook likes? 
Did I forget something? Please add a comment and, if you like the post, 
feel free to share it with your friends.&lt;/b&gt; &lt;/span&gt;

&lt;script&gt;(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&amp;appId=327933373929598";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));&lt;/script&gt;

&lt;br /&gt;
&lt;span style="font-family: Verdana, sans-serif; font-size: x-large;"&gt;&lt;b&gt;&lt;a href="http://thereferraljob.com/?refer=10420" target="_blank"&gt;Click Here To Know More&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class="fb-like" data-href="http://www.hamidkalu.blogspot.in/2013/10/hacked-facebook-account-with-one-sms.html" data-send="true" data-show-faces="false" data-width="450"&gt;
&lt;/div&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeyh7DVfYZhhbmG_I45BGOkn6fE3hp-WSONuCYqq-3T5nGjB4Z5xMziHc3DMQJplwFHkMC2s6g4Uof5SoQQilhU0S2sbo-uVXtIQ0G425-6V2aCJqofz_GoveIEbsMV0nnpqtrPknDfsTB/s72-c/Untitled.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">66</thr:total></item><item><title>Introducing Next browser for Android, Experience the NextGen browsing</title><link>http://hamidkalu.blogspot.com/2013/11/introducing-next-browser-for-android.html</link><category>Android</category><category>Facebook hacked</category><category>Mobile device</category><category>Next Browser</category><author>noreply@blogger.com (Hamid)</author><pubDate>Sun, 3 Nov 2013 19:28:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7786780271346850842.post-6927873689548822035</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="comments-area" id="comments"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgldq4X6g8gwYAYZG50l5l1po6c4GW_nUEWZRwjMR220_n2HORDHSmdVp6e3d9XTAbRDJxW1-VSLj2UHHk023Cy75aLfA5YtVLF7bEFPlslT1MSO-gPlVmYIgq8w43xTUOnygLJZnjlBUF3/s1600/NextBrowser_hq1okz.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="308" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgldq4X6g8gwYAYZG50l5l1po6c4GW_nUEWZRwjMR220_n2HORDHSmdVp6e3d9XTAbRDJxW1-VSLj2UHHk023Cy75aLfA5YtVLF7bEFPlslT1MSO-gPlVmYIgq8w43xTUOnygLJZnjlBUF3/s640/NextBrowser_hq1okz.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h3 style="text-align: left;"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;Next-Generation browser for Android-NEXT BROWSER&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Android is the most advance operating system for mobile and it makes a smartphone even smarter. So, why not use the most advance web browser for the smart operating system. We are talking about the Next Browser for Android. This Next Browser is developed by Go Dev Team who are the developers of the most widely used Go Launchers set of themes.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;It is far ahead from other browsers because it provides you with everything that you need while surfing in a browser such as, Flash player, Java and even a wide range of extensions that very few browser supports like Dolphin Browser and Firefox for Android. We will provide the list of extensions below.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Every other browser has it’s own feature such as Chrome has multi-tab browsing, Firefox offers extensions and Opera Mini is powered with lightning fast speed. But, what Go Launcher team has done is, they have taken the best features of all the above mentioned browsers and came up with a new, Next Browser. It has the option of multi-task, most visited site page, RSS view of your favorite sites, large pack of extensions and other cool features.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;img alt="" class="aligncenter wp-image-9507" height="377" src="http://res.cloudinary.com/tropicalpost/image/upload/v1382627361/NextBrowser1_aoazlt.jpg" width="640" /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;Here are some major Extensions in the Next Browser:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;And many other extensions available. You can view the extensions by swiping to the left from the edge of the screen. It also supports Flash and has the options to disable Flash, enable Flash or enable when required.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;The best part of this app is that it is free of cost and it can be downloaded from the Play Store.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;Download&lt;/b&gt;:&amp;gt;&amp;gt; &lt;a href="https://play.google.com/store/apps/details?id=com.jiubang.browser&amp;amp;hl=en-GB" target="_blank"&gt;Next Browser&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="clearfix"&gt;
&lt;/div&gt;

&lt;div id="fb-root"&gt;&lt;/div&gt;
&lt;script&gt;(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&amp;appId=327933373929598";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));&lt;/script&gt;
&lt;div class="fb-like" data-href="http://hamidkalu.blogspot.in/2013/11/introducing-next-browser-for-android.html" data-colorscheme="light" data-layout="standard" data-action="like" data-show-faces="false" data-send="false"&gt;&lt;/div&gt;

&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgldq4X6g8gwYAYZG50l5l1po6c4GW_nUEWZRwjMR220_n2HORDHSmdVp6e3d9XTAbRDJxW1-VSLj2UHHk023Cy75aLfA5YtVLF7bEFPlslT1MSO-gPlVmYIgq8w43xTUOnygLJZnjlBUF3/s72-c/NextBrowser_hq1okz.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Android KitKat (4.4) is going to expand Google marketshare</title><link>http://hamidkalu.blogspot.com/2013/11/android-kitkat-44-is-going-to-expand.html</link><category>Android</category><category>Mobile device</category><author>noreply@blogger.com (Hamid)</author><pubDate>Sat, 2 Nov 2013 12:48:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7786780271346850842.post-6307214560582353851</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1hg7HzHUjIj7waIMYUvLu3tER33uoBpWkAugSs5_XdoZCER-hVTVlNIB9QdVRfSOHHk5OYvd7P79TtcKwEGETysPVQ8t4P4MkwTM-flQ36hOYPN9vr0TxDlGUPkuozDmrIRVS7gGh7VJ3/s1600/android_kit_kat_tweet.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="318" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1hg7HzHUjIj7waIMYUvLu3tER33uoBpWkAugSs5_XdoZCER-hVTVlNIB9QdVRfSOHHk5OYvd7P79TtcKwEGETysPVQ8t4P4MkwTM-flQ36hOYPN9vr0TxDlGUPkuozDmrIRVS7gGh7VJ3/s320/android_kit_kat_tweet.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;span id="advenueINTEXT" name="advenueINTEXT" style="float: left;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class="Normal showpage1" id="artext1"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="Normal"&gt;
SAN FRANCISCO:  Google on Thursday unveiled the newest version of its  Android
 smartphone software, aiming to allow more smartphone users access to 
its evolving menu of online services such as driving directions 
voice-activated search.&lt;br /&gt;
&lt;br /&gt;
The new "KitKat" version of Android 
will be able to run on inexpensive, low-end smartphones as well as the 
most advanced devices,  Sundar Pichai, Google senior vice president of Android, Chrome and Apps said at a press event in San Francisco.&lt;br /&gt;
&lt;br /&gt;
"Now you have one version of the operating system which will run across
 all versions of Android smartphones," Pichai said, noting that 
smartphones sold in "emerging markets" often come loaded with older 
versions of Android, that lack many key features and capabilities.&lt;br /&gt;
&lt;br /&gt;
The move could help Google ensure that more users have access to the 
growing selection of profitable online services. It also could make the 
Android software more attractive to third-party app developers, who have
 been frustrated by what they call the "fragmented" nature of Android 
devices.&lt;br /&gt;
&lt;br /&gt;
Google's Android software runs on 80% of the world's 
smartphones, according to industry analysts. But many of the Android 
devices sold use older versions of the software, which are not 
compatible with many new features.&lt;br /&gt;
&lt;br /&gt;
Many developers still build apps intended for Apple's iPhone and iPad first, said BGC Partners analyst Colin Gillis.&lt;br /&gt;
&lt;br /&gt;
"You want your users to be using your services, and  KitKat will help foster that," said Gillis.&lt;br /&gt;
&lt;br /&gt;
Roughly 29% of the Android smartphones in operation as of Oct. 2 feature the " Gingerbread"
 version of the operating system. Introduced in December 2010, that 
version of Android relies on an older Web browser and does not support 
Google Now, a sort of personal digital assistant technology that 
automatically provides relevant information about a user's personal 
calendar, weather and travel plans.&lt;br /&gt;
&lt;br /&gt;
The new KitKat version of 
Android integrates Google search technology directly into the phone in 
various ways. The phone's contact list allows users to find phone 
numbers of their personal acquaintances as well as of local businesses, 
such as restaurants and dry cleaners.&lt;br /&gt;
&lt;br /&gt;
Google also showed off a 
new feature that will allow smartphone users to find information by 
searching pages on the Web as well as information within the apps they 
have loaded on their phones. A search for a particular chocolate cookie 
recipe, for example, could yield results from a cooking app.&lt;br /&gt;
&lt;br /&gt;
Google also showed off the new Nexus 5 smartphone which will be the 
first device to feature the KitKat software. The phone, built by LG, 
will be available in 10 countries starting Thursday without a contract 
for $349.  &lt;/div&gt;
&lt;/div&gt;
&lt;span id="storyendpath"&gt;&lt;/span&gt;&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1hg7HzHUjIj7waIMYUvLu3tER33uoBpWkAugSs5_XdoZCER-hVTVlNIB9QdVRfSOHHk5OYvd7P79TtcKwEGETysPVQ8t4P4MkwTM-flQ36hOYPN9vr0TxDlGUPkuozDmrIRVS7gGh7VJ3/s72-c/android_kit_kat_tweet.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Barack Obama's Twitter, Facebook, Campaign website and Email Accounts hacked by Syrian Electronic Army</title><link>http://hamidkalu.blogspot.com/2013/11/barack-obamas-twitter-facebook-campaign.html</link><category>Facebook hacked</category><author>noreply@blogger.com (Hamid)</author><pubDate>Sat, 2 Nov 2013 12:41:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7786780271346850842.post-6002241135919039612</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;The pro-Assad group Syrian Electronic Army claims it has hacked the President Barack Obama’s website , Twitter-Facebook accounts and&amp;nbsp;access email accounts linked to Organizing For Action, the non-profit offshoot of Obama For America, Obama's 2012 campaign operation.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Last night,&amp;nbsp;Syrian Electronic Army (SEA)&amp;nbsp;hacked into Obama's donation website &lt;b&gt;&lt;i&gt;donate.barackobama.com&lt;/i&gt;&lt;/b&gt;, which was temporarily &lt;a href="http://www.blogger.com/"&gt;redirected&lt;/a&gt; to the website of the hacking group (&lt;i&gt;&lt;span class="GINGER_SOFATWARE_correct" ginger_sofatware_markguid="ac21d774-1970-4a2b-acef-bc34c0e8dd53" ginger_sofatware_uiphraseguid="a59be756-dc77-4e1e-a00e-74fff70d909d" grcontextid="sea:0"&gt;sea&lt;/span&gt;&lt;span class="GINGER_SOFATWARE_correct" ginger_sofatware_markguid="cab7e12d-512d-47c7-951c-177a2470246e" ginger_sofatware_uiphraseguid="a59be756-dc77-4e1e-a00e-74fff70d909d" grcontextid=".:1"&gt;.&lt;/span&gt;&lt;span class="GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct" ginger_sofatware_markguid="90d1742a-2fde-4beb-80bc-bcddc2fe9ce5" ginger_sofatware_uiphraseguid="a59be756-dc77-4e1e-a00e-74fff70d909d" grcontextid="sy:2"&gt;sy&lt;/span&gt;/&lt;span class="GINGER_SOFATWARE_correct" ginger_sofatware_markguid="2ae8d181-34d6-4771-aea1-7ff25f89d784" ginger_sofatware_uiphraseguid="a59be756-dc77-4e1e-a00e-74fff70d909d" grcontextid="indexs:3"&gt;indexs&lt;/span&gt;/&lt;/i&gt;) with a short message: “&lt;i&gt;&lt;b&gt;Hacked by SEA&lt;/b&gt;&lt;/i&gt;”.
&lt;/span&gt;&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;
&lt;!-- adsense --&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;The hackers were able to take over only a secondary donations page. It was an older page - still on the site, but was no longer being used.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;They have also posted fake tweets and updates from Obama's Facebook Page and Twitter accounts,&amp;nbsp;"&lt;i&gt;All&lt;span class="GINGER_SOFATWARE_correct" ginger_sofatware_markguid="a27d4bb7-33f2-4b1f-ab87-e616d2a31674" ginger_sofatware_uiphraseguid="040a12af-c1dc-4236-bd58-2c2a5e0c6aff" grcontextid="the the:0"&gt;&amp;nbsp;the&lt;/span&gt;&amp;nbsp;links that Barack Obama account tweeted it and post it on Facebook was redirected to a video showing the truth about Syria&lt;/i&gt;" Hacker told Mashable in an interview.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;The attackers also compromised the URL shortening service that the President used to share links through social media (ShortSwitch.com). The compromised links directed users to a video called “Syria Facing Terrorism”, hosted on YouTube, which has since been removed.&lt;/span&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiKxhGbjqcfPVr558Om0qFUM_hwu3a_z09GMBmcwUAOc9KxURyDGr5aLGJUuKA0AKa9IBTcX7xwUsMIg2bIQxSiMZ1tr2bj2kWSuHaUcpDMdEPNmnfQdBrj_lcP47v7VInRtKQYpD6qt0/s1600/obama+twitter+hacked.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiKxhGbjqcfPVr558Om0qFUM_hwu3a_z09GMBmcwUAOc9KxURyDGr5aLGJUuKA0AKa9IBTcX7xwUsMIg2bIQxSiMZ1tr2bj2kWSuHaUcpDMdEPNmnfQdBrj_lcP47v7VInRtKQYpD6qt0/s1600/obama+twitter+hacked.png" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL_xq9ELX_BYYd0UZJV3oUxI_EGsPob4sFOvdO7poEKu6cFy3-Pth5ztIZdLBa8FhEFzH98BG0yFKGHU_WBwv53djCQOHljp_6dn6MdtmISigiHJWc6Outeo_LubjPt8sN546pex3pMy8/s1600/obama+facebook+hacked.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL_xq9ELX_BYYd0UZJV3oUxI_EGsPob4sFOvdO7poEKu6cFy3-Pth5ztIZdLBa8FhEFzH98BG0yFKGHU_WBwv53djCQOHljp_6dn6MdtmISigiHJWc6Outeo_LubjPt8sN546pex3pMy8/s728/obama+facebook+hacked.png" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;At the time of writing, the&amp;nbsp;&lt;i&gt;donate.barackobama.com&lt;/i&gt;&amp;nbsp;website no longer redirects visitors to the SEA’s website, but the links posted on his Twitter and Facebook accounts had not been fixed as of publishing time.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;According to a screenshot shared by the hacking group, they have also claimed that they have access Obama Campaign email accounts.&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqTeD8G0ty-d2B0MYOcq91ovitX-cdbSVL16xwXeZn8UPd3eoAX0Go4KOz84G2hyphenhyphenh9TZh6dOhZAwfR8i2rB2qAVy4aVjLLjkR0eSkh0BSPzrHRNPjmz7qgQBUW0AwIyz_sc3zECGkQT-Y/s1600/obama+emails+hacked.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqTeD8G0ty-d2B0MYOcq91ovitX-cdbSVL16xwXeZn8UPd3eoAX0Go4KOz84G2hyphenhyphenh9TZh6dOhZAwfR8i2rB2qAVy4aVjLLjkR0eSkh0BSPzrHRNPjmz7qgQBUW0AwIyz_sc3zECGkQT-Y/s728/obama+emails+hacked.png" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ_GS-F8AhyLxQjU4BgowMWwfMjXhHtxa6itdCFbrcNzWl-dnkHgNCuYYpju2aX6zFclp6ZB6Bbl0W_ysuuaBPDpcyaaDt0kvxr4d8eRyQe5Edmb_vBJiK6Am3gZs03PDFn0KiTRRJraw/s1600/Barack+Obama%E2%80%99s+Campaign+website+Hacked+by+Syrian+Electronic+Army.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ_GS-F8AhyLxQjU4BgowMWwfMjXhHtxa6itdCFbrcNzWl-dnkHgNCuYYpju2aX6zFclp6ZB6Bbl0W_ysuuaBPDpcyaaDt0kvxr4d8eRyQe5Edmb_vBJiK6Am3gZs03PDFn0KiTRRJraw/s728/Barack+Obama%E2%80%99s+Campaign+website+Hacked+by+Syrian+Electronic+Army.jpg" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Zone-H mirrors of hack are also&amp;nbsp;available for readers:&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;a href="http://www.zone-h.org/mirror/id/21091817"&gt;Link 1&lt;/a&gt;&amp;nbsp;(http://donate.barackobama.com)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;a href="http://www.zone-h.org/mirror/id/21091819"&gt;Link 2&lt;/a&gt;&amp;nbsp;(https://my.barackobama.com/page/s/hacked-by-sea)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmbdiCkTr5fRvRXDCa-OTR5sTGM0oQoFDq7IbM12UOyrBCGbIR3hdumKjLzp6wKVb60MW4r7gOpjzrwwOEdgH7jkNYQ0FwPmEkcUyy6nx6mgMAaYn1alOq9o5PiGqMm5o36h8dJZGPXLY/s1600/SEA.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmbdiCkTr5fRvRXDCa-OTR5sTGM0oQoFDq7IbM12UOyrBCGbIR3hdumKjLzp6wKVb60MW4r7gOpjzrwwOEdgH7jkNYQ0FwPmEkcUyy6nx6mgMAaYn1alOq9o5PiGqMm5o36h8dJZGPXLY/s1600/SEA.png" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;'Syrian Electronic Army is an organized hacking group loyal to the Syrian President Bashar al-Assad and known for their high profile cyber attacks. This year they were able to disrupt the&amp;nbsp;New York Times&amp;nbsp;web page multiple times, Twitter, CNN, the Huffington Post and&amp;nbsp;Global Post&amp;nbsp;and many more targets.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;The SEA website launched in May 2011 stating the group's mission: to attack the enemies of the Syrian government, mainly those who fabricated stories about the Syrian civil war.&lt;/span&gt;&lt;/div&gt;
&lt;script data-cfasync="false" type="text/javascript"&gt;
var obj0=document.getElementById("aim12069486134437234743");
var obj1=document.getElementById("aim22069486134437234743");
var s=obj1.innerHTML;
var r=s.search(/\x3C!-- adsense --\x3E/igm);
if(r&gt;0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+16);}
&lt;/script&gt;

&lt;br /&gt;
&lt;script type="text/rocketscript"&gt;&lt;!--
google_ad_client = "ca-pub-7983783048239650";
/* Banner Below Article Body */
google_ad_slot = "6391846819";
google_ad_width = 728;
google_ad_height = 90;
google_ad_region = "hackernews";
//--&gt;
&lt;/script&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;script data-rocketsrc="//pagead2.googlesyndication.com/pagead/show_ads.js" type="text/rocketscript"&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;div style="margin-top: 20px;"&gt;
&lt;/div&gt;
&lt;div class="fb-like" data-action="like" data-colorscheme="light" data-height="20" data-href="https://www.facebook.com/TutorialPoint" data-layout="button_count" data-send="false" data-show-faces="false" data-width="727"&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class="foot" style="width: 1060px;"&gt;
&lt;div id="product"&gt;
&lt;div id="footer-new"&gt;
&lt;div style="width: 1060px;"&gt;
&lt;div style="float: left; padding-left: 10px; width: 345px;"&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiKxhGbjqcfPVr558Om0qFUM_hwu3a_z09GMBmcwUAOc9KxURyDGr5aLGJUuKA0AKa9IBTcX7xwUsMIg2bIQxSiMZ1tr2bj2kWSuHaUcpDMdEPNmnfQdBrj_lcP47v7VInRtKQYpD6qt0/s72-c/obama+twitter+hacked.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Hacked Facebook Account with One SMS.</title><link>http://hamidkalu.blogspot.com/2013/10/hacked-facebook-account-with-one-sms.html</link><category>Facebook hacked</category><category>facebook security</category><category>Hacking Tools</category><category>SMS hacked</category><category>Warning</category><author>noreply@blogger.com (Hamid)</author><pubDate>Wed, 30 Oct 2013 18:09:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7786780271346850842.post-9166753966853232978</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRmxvmb_2GL0YNaS6LKBamUKGhQ_smzcWt4z2RFfzvPZuzLuMBUXiRPwerZv330AqBbSU0Q-n2PNTcI4Pnrzh8rWedHe3y2UTPWiFQq7pZbjnEnyjlL0zPmRD8mi6NhD5cacAsEA69ThmM/s1600/Untitled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="210" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRmxvmb_2GL0YNaS6LKBamUKGhQ_smzcWt4z2RFfzvPZuzLuMBUXiRPwerZv330AqBbSU0Q-n2PNTcI4Pnrzh8rWedHe3y2UTPWiFQq7pZbjnEnyjlL0zPmRD8mi6NhD5cacAsEA69ThmM/s320/Untitled.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Hacked Facebook Account with One SMS by UK based Hacker, Facebook Security Team rewarded him reporting flaws in the System.&lt;/span&gt;&lt;/h2&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Guys Today's story is different from others. People usually use Malicious code, Social Engineering, Trojans, Phishing to Hack a Facebook Account, But this story is entirely change, here Hacker called "fin1te" which is from UK found a big flaws in Facebook messaging system, reported to Facebook and Facebook rewarded him By $20,000 US.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Today I am going to explain you that how a UK based Security Researcher, "&lt;b&gt;&lt;i&gt;fin1te&lt;/i&gt;&lt;/b&gt;" is able to hack any Facebook account within a minute by doing one SMS.&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Because 90% of us are Facebook user too, so we know that there is an option of linking your mobile number with your account, which allows you to receive Facebook account updates via SMS directly to your mobile and also you can login into your account using that linked number rather than your email address or username.&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;!-- adsense --&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;According to &lt;a href="http://blog.fin1te.net/post/53949849983/hijacking-a-facebook-account-with-sms"&gt;hacker&lt;/a&gt;, the loophole was in phone number linking process, or in technical terms, at file&lt;/span&gt;&amp;nbsp;&lt;i&gt;/ajax/settings/mobile/confirm_phone.php&lt;/i&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;This particular webpage works in background when user submit his phone number and verification code, sent by Facebook to mobile. That submission form having two main parameters, one for &lt;b&gt;&lt;i&gt;verification code&lt;/i&gt;&lt;/b&gt;, and second is &lt;b&gt;&lt;i&gt;profile_id&lt;/i&gt;&lt;/b&gt;, which is the account to link the number to.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUz7yeYrO4U3B8152nFrwQyeOqlz5uCVl-S-D8-RZRQeFmGjgnaxcMoIP7H4lrrkJyOH32k34ZvKhU5vwOUlB5HhDwsgx-Fa4jEiF_aWNyF-FM9ZDzD2vNyROyWP_gUZXZyXxLHLH5MazX/s1600/Hacking+Facebook+Account+with+just+a+text+message.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="146" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUz7yeYrO4U3B8152nFrwQyeOqlz5uCVl-S-D8-RZRQeFmGjgnaxcMoIP7H4lrrkJyOH32k34ZvKhU5vwOUlB5HhDwsgx-Fa4jEiF_aWNyF-FM9ZDzD2vNyROyWP_gUZXZyXxLHLH5MazX/s640/Hacking+Facebook+Account+with+just+a+text+message.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;&amp;nbsp; &lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;b&gt;As attacker, follow these steps to execute hack:&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Change value of&amp;nbsp;&lt;b&gt;&lt;i&gt;profile_id&lt;/i&gt;&lt;/b&gt; to the Victim's&amp;nbsp;&lt;b&gt;&lt;i&gt;profile_id&lt;/i&gt;&lt;/b&gt;&amp;nbsp;value by tampering the parameters.&lt;/span&gt;&lt;/li&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;
&lt;li&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Send the letter &lt;b&gt;F&lt;/b&gt; to 32665, which is Facebook’s SMS shortcode in the UK. You will receive an 8 character verification code back.&amp;nbsp; &lt;/span&gt;&lt;div class="separator" style="clear: both; text-align: justify;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNkunl_PbAj5fTbQmULsNpOry5jwsVPEkOYoJU6stuVEyi-4jAvVy_4WH_6f_I3LX7zU5q0I6pYRQrb54ZcETksUt2fpkAc3EsJTkPvpNplcR-quirMhb25LW-edi60J4_2Oy-eAnFrYGa/s1600/facebook-sms-3-1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNkunl_PbAj5fTbQmULsNpOry5jwsVPEkOYoJU6stuVEyi-4jAvVy_4WH_6f_I3LX7zU5q0I6pYRQrb54ZcETksUt2fpkAc3EsJTkPvpNplcR-quirMhb25LW-edi60J4_2Oy-eAnFrYGa/s640/facebook-sms-3-1.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;&amp;nbsp;Enter that code in the box or as &lt;b&gt;&lt;i&gt;confirmation_code&lt;/i&gt;&lt;/b&gt; parameter value and Submit the form.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaMfnS-trHvCZ6rgvqkSqWfyZGX1FyGb7KBTbioIInw0g-TA-5wCqLKwvdG7UzmqOmIpL5zVxnR1ZUHMkoGTAjyTqnDUDplOP2uabAUmhvV2nQF2fK5FzF7ZB7T52xb0UhcGVEGXhikh1q/s1600/facebook-sms-4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaMfnS-trHvCZ6rgvqkSqWfyZGX1FyGb7KBTbioIInw0g-TA-5wCqLKwvdG7UzmqOmIpL5zVxnR1ZUHMkoGTAjyTqnDUDplOP2uabAUmhvV2nQF2fK5FzF7ZB7T52xb0UhcGVEGXhikh1q/s400/facebook-sms-4.jpg" width="225" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;span style="text-align: justify;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: justify;"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Facebook will accept that confirmation code and attacker's mobile number will be linked to victim's Facebook profile.&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: justify;"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;In next step hacker just need to go to Forgot password option and initiate the password reset request against of victim's account.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;center&gt;
&lt;script type="text/rocketscript"&gt;(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));&lt;/script&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/center&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Attacker now can get password recovery code to his own mobile number which is linked to victim's account using above steps. Enter the code and Reset the password!&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Facebook no longer accepting the profile_id parameter from the user end after receiving the bug report from the hacker.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;In return, Facebook paying $20,000 to&amp;nbsp;&lt;b&gt;&lt;i&gt;fin1te&lt;/i&gt;&lt;/b&gt;&amp;nbsp;as &lt;a href="http://www.google.com/cse?cx=017931741230951650006%3Apksj3nwgyw4&amp;amp;q=Bug+Bounty&amp;amp;ie=ISO-8859-1&amp;amp;sa=Search&amp;amp;siteurl=thehackernews.com%2F&amp;amp;ref=&amp;amp;ss=31772j1005907376j5#gsc.tab=0&amp;amp;gsc.q=Bug%20Bounty&amp;amp;gsc.page=1"&gt;Bug Bounty&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Found Really interesting??&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Don't forget to Subscribe us..&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;script data-cfasync="false" type="text/javascript"&gt;
var obj0=document.getElementById("aim13465796534476246168");
var obj1=document.getElementById("aim23465796534476246168");
var s=obj1.innerHTML;
var r=s.search(/\x3C!-- adsense --\x3E/igm);
if(r&gt;0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+16);}
&lt;/script&gt;

&lt;script async="" data-rocketsrc="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js" type="text/rocketscript"&gt;&lt;/script&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;!-- Banner Below Article Body --&gt;
&lt;script&gt;(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&amp;appId=327933373929598";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));&lt;/script&gt;

&lt;div class="fb-like" data-href="http://www.hamidkalu.blogspot.in/2013/10/hacked-facebook-account-with-one-sms.html" data-send="true" data-show-faces="false" data-width="450"&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRmxvmb_2GL0YNaS6LKBamUKGhQ_smzcWt4z2RFfzvPZuzLuMBUXiRPwerZv330AqBbSU0Q-n2PNTcI4Pnrzh8rWedHe3y2UTPWiFQq7pZbjnEnyjlL0zPmRD8mi6NhD5cacAsEA69ThmM/s72-c/Untitled.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">16</thr:total></item><item><title>10 Simple Tips to Secure Your Email Account</title><link>http://hamidkalu.blogspot.com/2013/10/10-simple-tips-to-secure-your-email.html</link><author>noreply@blogger.com (Hamid)</author><pubDate>Mon, 28 Oct 2013 20:02:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7786780271346850842.post-3861130223347651305</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;

&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFbs1fBV06BNQTYcMsSUUTRjN6ruCh6YEoJm4rSKD7-VCBWi40GSqjOcNPpXjAIxLmonNZAEOaAOr6THR_IlPeQLAQajwi22eqPna_wKcVEaPEEbObgZQ2DrQsNzOIEhnNhoqHd2r8czDj/s1600/index.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="236" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFbs1fBV06BNQTYcMsSUUTRjN6ruCh6YEoJm4rSKD7-VCBWi40GSqjOcNPpXjAIxLmonNZAEOaAOr6THR_IlPeQLAQajwi22eqPna_wKcVEaPEEbObgZQ2DrQsNzOIEhnNhoqHd2r8czDj/s320/index.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h1 style="padding-right: 50px;"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;10 Simple Tips to Secure Your Email Account:&lt;/span&gt;&lt;/h1&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;It’s tough to get people to pay attention and be serious about their 
online identity. An Email account is the first and primary component of 
your online identity and yet it’s the one that is left unguarded the 
most. Email accounts may be virtual but once hacked, the consequences 
and damages are very real.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;The problem with a hacked email account is the domino effect. All 
registrations, purchases, renewals, transactions, password reminders 
etc. are sent to your email inbox. So once the first domino falls, the 
entire setup falls apart in one fell swoop. After the jump, we’ve 
rounded up a few tips that can help you secure your email accounts of 
popular webmail services.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;span id="more-10759"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Use a Strong Password&lt;/span&gt;&lt;/h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;div class="wp-caption aligncenter" id="attachment_10760" style="width: 630px;"&gt;
&lt;div class="wp-caption-text"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Strong Password&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Yes, I know this is what every other tech blogger says every single 
time. But that has never made people any wiser. Even hackers feel 
insulted when they come across passwords like “sweetlove123”, “pass@123”
 and the like. Google is the best when it comes to putting real effort 
into securing your email account proactively. You can use special 
characters, numbers, upper and lower case alphabets of almost any 
length. My Gmail password is between 60 to 80 characters long and my 
general rule of thumb is to have a password that only the NSA can hack.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Use a reliable Secondary Email Address&lt;/span&gt;&lt;/h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Absolutely no Hotmail accounts for secondary fallback email account 
people. They still have their stone age era email account expiry plan 
after certain number days of non usage. So if the secondary email 
address is Hotmail and is expired, anyone create it back again to 
receive password reset information. And since webmail providers have 
this peculiar habit of giving all kinds of hints to remind you of the 
email address where the password recovery link has been sent, use an 
uncommon, custom domain or corporate email address that is hard to guess
 and hack into.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Setup SMS Alerts&lt;/span&gt;&lt;/h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;div class="wp-caption aligncenter" id="attachment_10761" style="width: 630px;"&gt;
&lt;div class="wp-caption-text"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;SMS Alerts&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Go to your account settings and add your mobile number to receive SMS
 alerts. Once that’s set up, Google will send you the password reset 
code whenever somebody tries to reset your password. Alternatively, if 
you are a smartphone user, you can rely on these SMS alerts and disable 
password recovery via email altogether. Email accounts are always 
vulnerable to a hacker from a remote place but your mobile phone is not.
 Yahoo provides the same feature free too. Hotmail has a similar feature
 but is not supported in a lot of countries.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Be sensible with your security question&lt;/span&gt;&lt;/h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Ok. There’s absolutely no point in having the security question, “My 
favorite doggy”, and posting pics of you and your poodle with images 
titled “Rolling with Rosy” on Facebook and Twitter. A lot of personal 
information is available online, thanks to social networks. On being the
 weakest links in the email security chain, security questions rank 
ahead of weak passwords. It’s nice to be an open book but select a 
question from those stapled pages and blacked out lines.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Check Filters and Forwarding Addresses&lt;/span&gt;&lt;/h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;In the event of a hack and after reclaiming the account, go through 
the existing filters to check if there are some sneaky filters set up 
that forward all your credit card, login info, bank account and other 
sensitive correspondence to an email address that is not yours. Go to 
the forwarding page and see that all your incoming mails are not 
forwarded to the hacker either. This helps you avoid getting hacked in 
the future too.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Avoid Public WiFi&lt;/span&gt;&lt;/h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Happy to have discovered an unsecured WiFi hotspot? Or mooching your 
neighbour’s spilt WiFi? Enjoying the free WiFi of the coffee shop round 
the corner? Good for you and so is for the hacker sitting nearby to 
sniff the packets right out of thin air. Avoid using public WiFi for 
accessing email or transacting online with a credit card. Casual 
browsing and YouTube watching (without logging in) are Ok. Accessing 
emails is a big no, no.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Do not share your login information&lt;/span&gt;&lt;/h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Another obvious fact. But at times, it’s necessary for small 
businesses and online entrepreneurs to share login information with 
colleagues. For example, accessing Google AdSense, Analytics or 
Microsoft Live services etc. The ideal solution is to create a dedicated
 account for accessing these services instead of linking everything to 
your personal email id and sharing it.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Login regularly&lt;/span&gt;&lt;/h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Even if a hacker gets hold of the answer to your security question, 
they cannot use it immediately to reset the password and break into your
 Gmail account. Password reset with security question is possible only 
after 24 hours of your account being inactive after receiving the 
password reset instructions. So for once, checking your mail regularly 
is a good thing. Also, it will help reset the Hotmail account’s expiry 
date. Unfortunately Hotmail and Yahoo do not have this useful 
restriction in place.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Special Features&lt;/span&gt;&lt;/h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Gmail&lt;/span&gt;&lt;/h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Enable HTTPS by default from your account settings. This helps from 
the password getting sniffed when transmitted over public WiFi hot 
spots. If you are a Google Apps user, enable pre release features to 
avail the upcoming two factor authentication system before it launches.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Hotmail&lt;/span&gt;&lt;/h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Use the Windows Live Essentials package and verify the computer you 
are using as reliable. “Trusted PC” is a unique new proof that lets you 
link your Hotmail account with one or more of your personal computers. 
Then, if you ever need to regain control of your account by resetting 
your password, you simply have to use the trusted computer and Hotmail 
will know you are the legitimate owner. It’s a great feature for those 
who are really paranoid about email security.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Yahoo&lt;/span&gt;&lt;/h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;div class="wp-caption aligncenter" id="attachment_10762" style="width: 630px;"&gt;
&lt;div class="wp-caption-text"&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Sign In Seal&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Make use of the sign in seal option to verify the computer. Sign in 
seal is basically an image or color that Yahoo displays for each of your
 computers adding another layer of security to the login process.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;Avoid Webmail&lt;/span&gt;&lt;/h3&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Still not sure about the safety and security of your email account 
online? It is totally understandable and I suggest you to take it off 
the Internet. I mean, partially. Get hold of an ISP and get a POP or 
IMAP account set up for your email address forgoing the webmail set up. 
Then use desktop email clients like Outlook or Thunderbird to pull your 
mails. It will make you feel dated, but is reliable and works 
effectively too.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: Verdana,sans-serif;"&gt;
&lt;/span&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;Did we miss an important tip or got a better suggestion? Share it with the rest of community in the comments section.&lt;/span&gt;&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFbs1fBV06BNQTYcMsSUUTRjN6ruCh6YEoJm4rSKD7-VCBWi40GSqjOcNPpXjAIxLmonNZAEOaAOr6THR_IlPeQLAQajwi22eqPna_wKcVEaPEEbObgZQ2DrQsNzOIEhnNhoqHd2r8czDj/s72-c/index.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>Mobile device could be dangerous for You</title><link>http://hamidkalu.blogspot.com/2013/10/mobile-device-could-be-dangerous-for-you.html</link><category>Mobile device</category><category>News</category><category>Warning</category><author>noreply@blogger.com (Hamid)</author><pubDate>Tue, 22 Oct 2013 19:25:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7786780271346850842.post-4866813376535943358</guid><description>




&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiS5QY4Q427euVoE2fJMqIxeuu76HsoOwM24bJ4U7t92K7UKuq9FIl9GOlaZtUXNm7iLbYOl1vK9Rj9PL1M_U3SEyU7SXno7gINXQ-Mfof8kBF5YoCp6m5ATF7Vk3XBLhZQhOlTo6C74EDg/s1600/1378294_530403810376010_2016450802_n.jpg" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="254" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiS5QY4Q427euVoE2fJMqIxeuu76HsoOwM24bJ4U7t92K7UKuq9FIl9GOlaZtUXNm7iLbYOl1vK9Rj9PL1M_U3SEyU7SXno7gINXQ-Mfof8kBF5YoCp6m5ATF7Vk3XBLhZQhOlTo6C74EDg/s320/1378294_530403810376010_2016450802_n.jpg" width="320" /&gt;&lt;/a&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiS5QY4Q427euVoE2fJMqIxeuu76HsoOwM24bJ4U7t92K7UKuq9FIl9GOlaZtUXNm7iLbYOl1vK9Rj9PL1M_U3SEyU7SXno7gINXQ-Mfof8kBF5YoCp6m5ATF7Vk3XBLhZQhOlTo6C74EDg/s1600/1378294_530403810376010_2016450802_n.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span style="color: #990000;"&gt;READ THIS!!!!&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span style="color: #990000;"&gt;IMPORTANT FROM THE UNIVERSITY OF MIAMI HOSPITAL&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style="text-align: left;"&gt;
&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span style="color: #990000;"&gt;VERY SERIOUS WARNING...&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt; I do this all the time! I guess I won't be doing it ANY more !&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; A few days ago, a person was recharging his mobile phone at home.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; Just at that time a call came in and he answered it with the charging Instrument still connected to the outlet.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt;
 After a few seconds electricity flowed into the cell phone unrestrained
 and the young man was thrown to the floor with a heavy thud. As you can
 see, the phone actually exploded.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; His parents rushed to the room only to find him unconscious, with a weak heartbeat and burnt fingers.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; He was rushed to the nearby hospital, but was pronounced dead on arrival.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; Cell phones are a very useful modern invention.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; However, we must be aware that it can also be an instrument of death.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt;
 Never use the cell phone while it is hooked to the electrical outlet! 
If you are charging the cell phone and a call comes in, unplug it from 
the charger and outlet.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #666666;"&gt;&lt;span style="font-family: Verdana,sans-serif;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; FORWARD THIS TO THE PEOPLE THAT MATTER IN YOUR LIFE!!!&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;div class="fb-comments" data-href="http://hamidkalu.blogspot.in/2013/10/mobile-device-could-be-dangerous-for-you.html" data-numposts="5" data-width="600"&gt;&lt;/div&gt;

&lt;div id="fb-root"&gt;&lt;/div&gt;
&lt;script&gt;(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&amp;appId=327933373929598";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));&lt;/script&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiS5QY4Q427euVoE2fJMqIxeuu76HsoOwM24bJ4U7t92K7UKuq9FIl9GOlaZtUXNm7iLbYOl1vK9Rj9PL1M_U3SEyU7SXno7gINXQ-Mfof8kBF5YoCp6m5ATF7Vk3XBLhZQhOlTo6C74EDg/s72-c/1378294_530403810376010_2016450802_n.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>How to install Java in Windows and Mac Operating system</title><link>http://hamidkalu.blogspot.com/2013/10/how-to-install-java-in-windows.html</link><author>noreply@blogger.com (Hamid)</author><pubDate>Mon, 14 Oct 2013 13:12:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7786780271346850842.post-8510222224663876452</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;br /&gt;
&lt;div class="fb-like" data-href="http://hamidkalu.blogspot.in/2013/10/how-google-works.html" data-send="true" data-show-faces="false" data-width="450"&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;br /&gt;
&lt;div class="rent" id="text"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQUCJn8gaRUhSnBMy_PeS3Onv6yRC_rrjiZXE8ywCGlycVJpS7PWDyhf9I0L-PU_sAggsBC5HCsTR40AoFjhDZQzvsqssW_ANpLWMJvOLX_9v39qh4H3w1QzlCzD_IcM-VkjrlsRE50PrC/s1600/Java_logo.svg_.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="186" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQUCJn8gaRUhSnBMy_PeS3Onv6yRC_rrjiZXE8ywCGlycVJpS7PWDyhf9I0L-PU_sAggsBC5HCsTR40AoFjhDZQzvsqssW_ANpLWMJvOLX_9v39qh4H3w1QzlCzD_IcM-VkjrlsRE50PrC/s320/Java_logo.svg_.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;center&gt;
&lt;a href="http://hamidkalu.blogspot.in/" target="blank"&gt; How to Install Java (Windows &lt;small&gt;&amp;amp;reg&lt;/small&gt;)&lt;/a&gt;&lt;/center&gt;
&lt;a href="http://hamidkalu.blogspot.in/" target="blank"&gt;&lt;inf&gt;&lt;/inf&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;br /&gt;
Java Development Kit (JDK) 1.7 (officially named &lt;acronym title="Java Standard Edition"&gt;Java SE&lt;/acronym&gt;
 7), which is freely available from Sun Microsystems (now part of 
Oracle), is needed for writing Java programs. JDK can be downloaded from
 the Java mother site @ &lt;a href="http://java.sun.com/"&gt;http://java.sun.com&lt;/a&gt; (or &lt;a href="http://www.oracle.com/technetwork/java/index.html"&gt;http://www.oracle.com/technetwork/java/index.html&lt;/a&gt;).&lt;br /&gt;
&lt;h5&gt;
JDK or JRE?&lt;/h5&gt;
JRE (Java Runtime) is needed for &lt;i&gt;running&lt;/i&gt; Java programs. JDK 
(Java Development Kit), which includes JRE plus the development tools 
(such as compiler and debugger), is need for &lt;i&gt;writing&lt;/i&gt; as well as running Java programs. Since you are supposed to write Java Programs, you should install JDK, which includes JRE.&lt;br /&gt;
&lt;br /&gt;
&lt;h5&gt;
Step 0(a): Un-Install Older Version(s) of JDK/JRE&lt;/h5&gt;
I recommend that you install the latest JDK, but it can be messy if you have multiple versions of JDK/JRE.&lt;br /&gt;
If you have previously installed older version(s) of JDK/JRE, 
un-install ALL of them. Run "Control Panel" ⇒ Program and Features  ⇒ 
Un-install programs begin with "Java", such as "Java SE Development Kit"
 and "Java SE Runtime". If you are not sure whether you have older 
version(s) of JDK, check!&lt;br /&gt;
&lt;h5&gt;
Step 0(b): Understand Windows' CMD Shell&lt;/h5&gt;
Programmers need to know how to use CMD shell to issue commands. If you are completely new to CMD, read "&lt;a href="http://www3.ntu.edu.sg/home/ehchua/programming/howto/CMD_Survival.html"&gt;Programmer's Survival Guide for Windows&lt;/a&gt;".&lt;br /&gt;
&lt;h5&gt;
Step 1: Download JDK&lt;/h5&gt;
&lt;ol&gt;
&lt;li&gt;Goto Java SE download site @ &lt;a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html"&gt;http://www.oracle.com/technetwork/java/javase/downloads/index.html&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Click the "Download" button under "JDK" of "Java SE 7".&lt;/li&gt;
&lt;li&gt;Choose your operating platform, e.g., Windows x86 for 32-bit Windows
 OS or Windows x64 for 64-bit Windows OS. You can check whether your 
Windows OS is 32-bit or 64-bit via "Control Panel" ⇒ System ⇒ Under the 
"System Type".&lt;/li&gt;
&lt;/ol&gt;
&lt;h5&gt;
Step 2: Install JDK and JRE&lt;/h5&gt;
Run the downloaded installer (e.g., "&lt;code&gt;jdk-7uxx-windows-i586.exe&lt;/code&gt;"),
 which installs both the JDK (Java Development Kit) and JRE (Java 
Runtime).  By default, the JDK will be installed in directory "&lt;code&gt;C:\Program Files\Java\jdk1.7.0_{xx}&lt;/code&gt;", where &lt;code&gt;{xx}&lt;/code&gt; denotes the latest upgrade number; and JRE in "&lt;code&gt;C:\Program Files\Java\jre7&lt;b&gt;&lt;/b&gt;&lt;/code&gt;".&lt;br /&gt;
For novices, accept  the defaults. Simply click "next"..."next"... to install JDK in "&lt;code&gt;C:\Program Files\Java\jdk1.7.0_{xx}&lt;/code&gt;" and JRE in "&lt;code&gt;C:\Program Files\Java\jre7&lt;b&gt;&lt;/b&gt;&lt;/code&gt;". Take note of you JDK installed directory. I shall refer to the JDK installed directory as &lt;code&gt;&amp;lt;JAVA_HOME&amp;gt;&lt;/code&gt;, hereafter, in this article.&lt;br /&gt;
&lt;div class="side-note"&gt;
&lt;span class="line-heading"&gt;(For Advanced Users Only)&lt;/span&gt; The default JDK/JRE directories work but I recommend avoiding "&lt;code&gt;Program Files&lt;/code&gt;" directory because of that &lt;i&gt;blank&lt;/i&gt;
 character in the directory name. You may change the installed 
directories for JDK and JRE during installation. I personally installed 
JDK and all my programming tools in "&lt;code&gt;d:\bin&lt;/code&gt;" (instead of "&lt;code&gt;C:\Program Files&lt;/code&gt;") for ease of maintenance.&lt;/div&gt;
&lt;h5 id="jdk-install-step3"&gt;
Step 3: Include JDK's "&lt;span class="font-code"&gt;bin&lt;/span&gt;" Directory in the &lt;span class="font-code"&gt;PATH&lt;/span&gt;&lt;/h5&gt;
Windows OS searches the current  directory and the directories listed in the &lt;code&gt;PATH&lt;/code&gt; &lt;i&gt;environment variable&lt;/i&gt; for executable programs. JDK's programs (such as Java compiler &lt;code&gt;javac.exe&lt;/code&gt; and Java runtime &lt;code&gt;java.exe&lt;/code&gt;) reside in directory "&lt;code&gt;&amp;lt;JAVA_HOME&amp;gt;\bin&lt;/code&gt;" (where   &lt;code&gt;&amp;lt;JAVA_HOME&amp;gt;&lt;/code&gt; denotes the JDK installed directory, e.g., &lt;code&gt;C:\Program Files\Java\jdk1.7.0_{xx}&lt;/code&gt;). You need to include the "&lt;code&gt;&amp;lt;JAVA_HOME&amp;gt;\bin&lt;/code&gt;" directory in the &lt;code&gt;PATH&lt;/code&gt;.&lt;br /&gt;
To edit the &lt;code&gt;PATH&lt;/code&gt; environment variable in Windows 2000/XP/Vista/7/8:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Click "Start" button ⇒ "Control Panel" ⇒ "System" ⇒ (Vista/7/8 only) "Advanced system settings".&lt;/li&gt;
&lt;li&gt;Switch to "Advanced" tab ⇒ "Environment Variables..."&lt;/li&gt;
&lt;li&gt;In "System Variables" box, scroll down to select "&lt;code&gt;PATH&lt;/code&gt;" ⇒ "Edit..."&lt;/li&gt;
&lt;li&gt;&lt;span class="color-new"&gt;&lt;b&gt;(CAUTION: Read this paragraph 3 times before doing this step! There is no UNDO)&lt;/b&gt;&lt;/span&gt; In "Variable value" field, &lt;span class="underline"&gt;INSERT&lt;/span&gt; "&lt;code&gt;c:\Program Files\Java\jdk1.7.0_{xx}\bin&lt;/code&gt;" (VERIFY that this is your JDK's binary directory) &lt;span class="underline"&gt;IN FRONT&lt;/span&gt; of all the existing directories, &lt;span class="underline"&gt;followed by a semi-colon (&lt;code&gt;;&lt;/code&gt;)&lt;/span&gt; which separates the JDK's binary directory from the rest of the existing directories. &lt;span class="underline"&gt;DO NOT DELETE&lt;/span&gt; any existing entries; otherwise, some existing applications may not run.

  &lt;pre class="color-example"&gt;Variable name  : &lt;span class="color-new"&gt;&lt;b&gt;PATH&lt;/b&gt;&lt;/span&gt;
Variable value : &lt;span class="color-new"&gt;&lt;b&gt;c:\Program Files\Java\jdk1.7.0_{xx}\bin;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;[&lt;i&gt;exiting entries&lt;/i&gt;]&lt;/b&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="side-note"&gt;
&lt;span class="line-heading"&gt;(For Advanced Users Only)&lt;/span&gt;&lt;br /&gt;
I suggested that you place the JDK &lt;span class="font-code"&gt;bin&lt;/span&gt; directory &lt;i&gt;in front&lt;/i&gt; of "&lt;code&gt;c:\windows\system32&lt;/code&gt;" and "&lt;code&gt;c:\windows&lt;/code&gt;".  This is because some Windows systems may have an out-dated copy of JDK/JRE in these directories. Do a search for "&lt;code&gt;java.exe&lt;/code&gt;", and you will be amazed by the findings.&lt;br /&gt;
You could read "&lt;a href="http://www3.ntu.edu.sg/home/ehchua/programming/howto/Environment_Variables.html#JavaEnv"&gt;Java Applications and Environment Variable&lt;/a&gt;" for more discussions about &lt;code&gt;PATH&lt;/code&gt; environment variable.&lt;br /&gt;
I also recommend that you define an environment variable called &lt;code&gt;JAVA_HOME&lt;/code&gt;, which contains the JDK installed directory, and include the JDK &lt;code&gt;bin&lt;/code&gt; directory in the &lt;code&gt;PATH&lt;/code&gt; via &lt;code&gt;JAVA_HOME&lt;/code&gt;, i.e., &lt;code&gt;PATH=%JAVA_HOME%\bin;....&lt;/code&gt;.&lt;/div&gt;
&lt;h5&gt;
Step 4: Verify the JDK Installation&lt;/h5&gt;
Launch a CMD shell (Click "Start" button ⇒ run... ⇒ enter "&lt;code&gt;cmd&lt;/code&gt;"; or "Start" button ⇒ All Programs ⇒ Accessories ⇒ Command Prompt).&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Issue a "&lt;code&gt;path&lt;/code&gt;" command to list the contents of the &lt;code&gt;PATH&lt;/code&gt; environment variable. Check the output and make sure that &lt;code&gt;&amp;lt;JAVA_HOME&amp;gt;\bin&lt;/code&gt; is listed in the &lt;code&gt;PATH&lt;/code&gt;.

&lt;pre class="color-command"&gt;prompt&amp;gt; &lt;b&gt;path&lt;/b&gt;
PATH=&lt;span class="color-new"&gt;&lt;b&gt;c:\Program Files\Java\jdk1.7.0_{xx}\bin&lt;/b&gt;&lt;/span&gt;;[&lt;i&gt;other entries&lt;/i&gt;]&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Issue the following commands to verify that JDK/JRE are properly installed and display their version:

  &lt;pre class="color-command"&gt;prompt&amp;gt; &lt;b&gt;java -version&lt;/b&gt;
java version "1.7.0_{xx}"
Java(TM) SE Runtime Environment (build 1.7.0_{xx}-b11)
Java HotSpot(TM) Client VM (build 23.3-b01, mixed mode, sharing)
 
prompt&amp;gt; &lt;b&gt;javac -version&lt;/b&gt;
javac 1.7.0_{xx}&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h5&gt;
Step 5: Write a  Hello-World Java Program&lt;/h5&gt;
&lt;ol&gt;
&lt;li&gt;Create a directory to keep all your works, e.g., &lt;code&gt;d:\myproject&lt;/code&gt;,
 or any directory of your choice. Do NOT save your works in "Desktop" or
 "Documents" as they are hard to locate. The directory name shall not 
contain &lt;i&gt;blank&lt;/i&gt; or special characters. Use meaningful but short name as it is easier to type.&lt;/li&gt;
&lt;li&gt;Launch a programming text editor (such as &lt;a href="http://www3.ntu.edu.sg/home/ehchua/programming/howto/CMD_Survival.html#textpad"&gt;TextPad&lt;/a&gt; or &lt;a href="http://www3.ntu.edu.sg/home/ehchua/programming/howto/CMD_Survival.html#NotePadPP"&gt;NotePad++&lt;/a&gt;). Begin with a &lt;i&gt;new file&lt;/i&gt; and enter the following source code. Save the file as "&lt;code&gt;Hello.java&lt;/code&gt;", under your work directory (e.g., &lt;code&gt;d:\myproject&lt;/code&gt;).

  &lt;pre class="color-example"&gt;&lt;span class="color-comment"&gt;/*
 * First Java program to say Hello
 */&lt;/span&gt;
public class Hello {  &lt;span class="color-comment"&gt; // Save as "Hello.java" under "d:\myproject"&lt;/span&gt;
   public static void main(String[] args) {
      System.out.println("Hello, world!");
   }
}&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h5&gt;
Step 6: Compile and Run the Hello-World Java Program&lt;/h5&gt;
&lt;img alt="JavaBasics_GettingStarted.png" class="image-float-right" height="400" src="http://www3.ntu.edu.sg/home/ehchua/programming/java/images/JavaBasics_GettingStarted.png" width="268" /&gt;

&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;To compile the source code "&lt;code&gt;Hello.java&lt;/code&gt;":
&lt;ol&gt;
&lt;li&gt;Start a CMD Shell (Click "Start" button ⇒ Select "run..." ⇒ Enter "&lt;code&gt;cmd&lt;/code&gt;"; or "Start" button ⇒ All Programs ⇒ Accessories ⇒ Command Prompt).&lt;/li&gt;
&lt;li&gt;Set the &lt;i&gt;Current Drive&lt;/i&gt; to the drive where you saved your source file "&lt;code&gt;Hello.java&lt;/code&gt;". For example, suppose that your source file is saved in drive "&lt;code&gt;d&lt;/code&gt;", enter "&lt;code&gt;&lt;b&gt;d:&lt;/b&gt;&lt;/code&gt;" as follow:
  
&lt;pre class="color-command"&gt;prompt&amp;gt; &lt;b&gt;d:&lt;/b&gt;
D:\xxx&amp;gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Set the &lt;i&gt;Current Working Directory&lt;/i&gt; to the directory that you saved your source file via the &lt;b&gt;&lt;code&gt;cd&lt;/code&gt;&lt;/b&gt; (&lt;i&gt;Change Directory&lt;/i&gt;) command. For example, suppose that your source file is saved in directory "&lt;code&gt;d:\myproject&lt;/code&gt;".&lt;br /&gt;
  
&lt;pre class="color-command"&gt;D:\xxx&amp;gt; &lt;b&gt;cd \myproject&lt;/b&gt;
D:\myproject&amp;gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Issue a &lt;b&gt;&lt;code&gt;dir&lt;/code&gt;&lt;/b&gt; (&lt;i&gt;List Directory&lt;/i&gt;) command to confirm that your source file is present in the &lt;i&gt;current directory&lt;/i&gt;.
  
  &lt;pre class="color-command"&gt;D:\myproject&amp;gt; &lt;b&gt;dir&lt;/b&gt;
......
08-May-XX  06:25 PM               277 &lt;b&gt;Hello.java&lt;/b&gt;
......&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;Invoke the JDK compiler "&lt;b&gt;&lt;code&gt;javac&lt;/code&gt;&lt;/b&gt;" to compile the source code "&lt;code&gt;Hello.java&lt;/code&gt;".
  
&lt;pre class="color-command"&gt;D:\myproject&amp;gt; &lt;b&gt;javac Hello.java&lt;/b&gt;&lt;/pre&gt;
The compilation is successful if the command prompt returns.  Otherwise,
 error messages would be shown.  Correct the errors in your source file 
and re-compile. Check "&lt;a href="http://www3.ntu.edu.sg/home/ehchua/programming/howto/ErrorMessages.html#JDKErrors"&gt;Common JDK Installation Errors&lt;/a&gt;", if you encounter problem compiling your program.&lt;/li&gt;
&lt;li&gt;The output of the compilation is a Java class called "&lt;code&gt;Hello.class&lt;/code&gt;". Issue a &lt;b&gt;&lt;code&gt;dir&lt;/code&gt;&lt;/b&gt; (&lt;i&gt;List Directory&lt;/i&gt;) command again to check for the output. 
  
&lt;pre class="color-command"&gt;D:\myproject&amp;gt; &lt;b&gt;dir&lt;/b&gt;
......
xx-xxx-xx  01:53 PM               416 &lt;b&gt;Hello.class&lt;/b&gt;
xx-xxx-xx  06:25 PM               277 Hello.java
......&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;To run the program, invoke the Java Runtime "&lt;code&gt;&lt;b&gt;java&lt;/b&gt;&lt;/code&gt;":
&lt;pre class="color-command"&gt;D:\myproject&amp;gt; &lt;b&gt;java Hello&lt;/b&gt;
&lt;span class="color-new"&gt;Hello, world!&lt;/span&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;span class="line-heading"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h5&gt;
Step 7: (Optional) Download JDK API Documentation, Samples and Demos&lt;/h5&gt;
The JDK download does not include the documentation, which needs to 
be downloaded separately. In the past, I always insist that my students 
should have a local copy of JDK API Documentation. But, today, you can 
easily access the online copy by googling "JDK 7 Documentation".&lt;br /&gt;
To install JDK API documentation:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;From the Java SE download page (@ &lt;a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html"&gt;http://www.oracle.com/technetwork/java/javase/downloads/index.html&lt;/a&gt;), look for "&lt;span class="underline"&gt;Java SE 7 Documentation&lt;/span&gt;" (under "&lt;span class="underline"&gt;Additional Resources&lt;/span&gt;") ⇒ Download the zip-file (e.g., "&lt;code&gt;jdk-7....zip&lt;/code&gt;" - about 57MB).&lt;/li&gt;
&lt;li&gt;Unzip into the &lt;code&gt;&amp;lt;JAVA_HOME&amp;gt;&lt;/code&gt; (JDK installed directory).  The documentation will be unzipped into "&lt;code&gt;&amp;lt;$JAVA_HOME&amp;gt;\docs&lt;/code&gt;".  Browse the JDK documentation by opening "&lt;code&gt;&amp;lt;JAVA_HOME&amp;gt;\docs\index.html&lt;/code&gt;".&lt;/li&gt;
&lt;/ol&gt;
You should also download the "JDK Samples and Demos" from the Java SE download site.&lt;br /&gt;
&lt;h5&gt;
Step 8: (For Advanced Users Only) JDK's Source Code&lt;/h5&gt;
Source code for JDK is provided and kept in "&lt;code&gt;&amp;lt;JAVA_HOME&amp;gt;\src.zip&lt;/code&gt;". I strongly recommend that you to go through some of the source files such as "&lt;code&gt;String.java&lt;/code&gt;", "&lt;code&gt;Math.java&lt;/code&gt;", and "&lt;code&gt;Integer.java&lt;/code&gt;", under "&lt;code&gt;java\lang&lt;/code&gt;".&lt;br /&gt;
&lt;h4&gt;
1.1&amp;nbsp;&amp;nbsp;Using TextPad for Java Programming (on Windows)&lt;/h4&gt;
&lt;img alt="TextpadJava.png" class="image-float-right" height="276" src="http://www3.ntu.edu.sg/home/ehchua/programming/howto/images/TextpadJava.png" width="640" /&gt;

TextPad (@ &lt;a href="http://www.textpad.com/"&gt;www.textpad.com&lt;/a&gt;) is an excellent programming text editor for writing &lt;i&gt;toy&lt;/i&gt;
 Java programs. It can be configured to couple with the JDK, hence, 
bypassing the CMD shell. From the TextPad editor, you can invoke the JDK
 compiler/runtime directly via "Tools" menu ⇒ External Tools ⇒ "Compile 
Java" or "Run Java Application". Take note of the keyboard shortcuts - 
Ctrl+1 for compile and Ctrl+2 for run.&lt;br /&gt;
If you cannot find these commands in the "Tools" menu, goto 
"Configure" ⇒ Preferences... ⇒ Tools ⇒ Add ⇒ JDK Commands.  You can also
 configure the properties of "compile" and "run" there, such as 
prompting for command-line arguments.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
1.2&amp;nbsp;&amp;nbsp;Using NotePad++ for Java Programming (on Windows)&lt;/h4&gt;
Notepad++ (@ http://notepad-plus-plus.org) is a free and open-source programming editor.&lt;br /&gt;
You can use NotePad++ to input Java source code, and compile and run the Java program under CMD shell.&lt;br /&gt;
&lt;h5&gt;
NotePad++ Customization and Tips&lt;/h5&gt;
You can customize Notepad++ to compile and run Java programs with hot-keys.&amp;nbsp;&amp;nbsp; &lt;/div&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div id="fb-root"&gt;
&lt;/div&gt;
&lt;script&gt;(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&amp;appId=327933373929598";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));&lt;/script&gt;


&lt;style&gt;
#text{-moz-transform:rotate(-5deg);-o-transform:rotate(-5deg);-webkit-transform:rotate(-5deg);color:#FFF!important;font-family:arial;font-size:50px;font-weight:200;letter-spacing:-5.5px;line-height:45px;text-align:center;margin:20px 10px}
#text a{color:orange;text-shadow:1px 1px #000, 3px 3px #EEEEEE, 5px 5px #DDDDDD, 7px 7px #AAAAAA, -1px -1px #000;text-transform:lowercase;-moz-transition:all .3s ease-in 0;-webkit-transition:all .3s ease-in 0;-o-transition:all .3s ease-in 0;-kmoz-transition:all .3s ease-in 0}
#text a:hover{-moz-transition:all .3s ease-in 0;-webkit-transition:all .3s ease-in 0;-o-transition:all .3s ease-in 0;-kmoz-transition:all .3s ease-in 0;text-shadow:1px 1px #000, 3px 3px #EEEEEE, 5px 5px #DDDDDD, 7px 100px transparent, -1px -100px transparent;color:transparent}
inf{color:#d2a}
#text a:focus,#text a:active{color:#eee!important;-moz-transition:all 0 ease-in-out!important;-o-transition:all 0 ease-in-out!important;-kmoz-transition:all 0 ease-in-out!important;-webkit-transition:all 0 ease-in-out!important}
&lt;/style&gt;


&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQUCJn8gaRUhSnBMy_PeS3Onv6yRC_rrjiZXE8ywCGlycVJpS7PWDyhf9I0L-PU_sAggsBC5HCsTR40AoFjhDZQzvsqssW_ANpLWMJvOLX_9v39qh4H3w1QzlCzD_IcM-VkjrlsRE50PrC/s72-c/Java_logo.svg_.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>How Google Works</title><link>http://hamidkalu.blogspot.com/2013/10/how-google-works.html</link><category>Google Search Engine</category><author>noreply@blogger.com (Hamid)</author><pubDate>Sun, 6 Oct 2013 12:56:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7786780271346850842.post-6233747999094042657</guid><description>

&lt;br /&gt;
&lt;div class="fb-like" data-href="http://hamidkalu.blogspot.in/2013/10/how-google-works.html" data-send="true" data-show-faces="false" data-width="450"&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="content"&gt;
&lt;h1 class="articlePageTitle"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhobmiSmf5irDqOA-_aOZ0l5adMg40S1L4liz9yfPw2ltwtrF1oKeWAJClCfoKytfOz8rqq5dhYKYmLgtxAGXo5k9UeNgw-tDiLwT00VY2GIZAyhdCKz0tzNUfqV3pyonzqs33FbMSgqKc9/s1600/images.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhobmiSmf5irDqOA-_aOZ0l5adMg40S1L4liz9yfPw2ltwtrF1oKeWAJClCfoKytfOz8rqq5dhYKYmLgtxAGXo5k9UeNgw-tDiLwT00VY2GIZAyhdCKz0tzNUfqV3pyonzqs33FbMSgqKc9/s1600/images.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;
The Google Search Engine.&lt;/h1&gt;
Today, Google's popularity continues to grow. In 
2007, the company surpassed Microsoft as the most visited site on the 
Web [source: &lt;a href="http://www.sfgate.com/cgi-bin/article.cgi?file"&gt;Kopytoff&lt;/a&gt;]. The company's influence on the Web is undeniable. Practically every webmaster wants his or her site listed high on Google's &lt;b&gt;search engine results pages&lt;/b&gt; (&lt;b&gt;SERPs&lt;/b&gt;),
 because it almost always translates into more traffic on the 
corresponding Web site. Google has also acquired other Internet 
companies, ranging from &lt;a href="http://computer.howstuffworks.com/internet/social-networking/information/blog.htm"&gt;blogging&lt;/a&gt; services to the video-sharing site &lt;a href="http://money.howstuffworks.com/youtube.htm"&gt;YouTube&lt;/a&gt;.
 For a while, the company's search technology even powered rival 
companies' search engines -- Yahoo! relied on Google searches for nearly
 four years until developing its own search engine technologies in 2004 
[sources: &lt;a href="http://www.google.com/press/pressrel/pressrelease25.html"&gt;Google&lt;/a&gt;; &lt;a href="http://www.news.com/2100-1024_3-5160710.html"&gt;Hu and Olsen&lt;/a&gt;].&lt;br /&gt;
­Google's search engine is a powerful tool. Without search engines 
like Google, it would be practically impossible to find the information 
you need when you browse the Web. Like all search engines, Google uses a
 special &lt;b&gt;algorithm&lt;/b&gt;
 to generate search results. While Google shares general facts about its
 algorithm, the specifics are a company secret. This helps Google remain
 competitive with other search engines on the Web and reduces the chance
 of someone finding out how to abuse the system.&lt;br /&gt;
­Google uses automated programs called &lt;b&gt;spiders&lt;/b&gt; or &lt;b&gt;crawlers&lt;/b&gt;, just like most search engines. Also like other search engines, Google has a large index of &lt;b&gt;keywords&lt;/b&gt;
 and where those words can be found. What sets Google apart is how it 
ranks search results, which in turn determines the order Google displays
 results on its search engine results page (SERP). Google uses a 
trademarked algorithm called &lt;b&gt;PageRank&lt;/b&gt;, which assigns each Web page a relevancy score.&lt;br /&gt;
A Web page's PageRank depends on a few factors:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;The frequency and location of keywords within the Web page&lt;/b&gt;: If the keyword only appears once within the body of a page, it will receive a low score for that keyword.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;How long the Web page has existed&lt;/b&gt;:
 People create new Web pages every day, and not all of them stick around
 for long. Google places more value on pages with an established 
history.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;The number of other Web pages that link to the page in question&lt;/b&gt;: Google looks at how many Web pages link to a particular site to determine its relevance.&lt;/li&gt;
&lt;/ul&gt;
Out
 of these three factors, the third is the most important. It's easier to
 understand it with an example. Let's look at a search for the terms "&lt;a href="http://electronics.howstuffworks.com/planet-earth.htm"&gt;Planet Earth&lt;/a&gt;."&lt;br /&gt;
&lt;div class="line"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifBqetC_YecJ_sMYM-1p4ORVma8BvckTf0FuBvk7dtsklwZYBhx7IGawmBtI2EIxjWTKt0XVzg-7PwnL8w-uzxXuL8VkqqmG3WevE9pJzzL307qQTBc2ixNoUoQELPD9w3ZgyWIUJiy3Z3/s1600/Untitled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifBqetC_YecJ_sMYM-1p4ORVma8BvckTf0FuBvk7dtsklwZYBhx7IGawmBtI2EIxjWTKt0XVzg-7PwnL8w-uzxXuL8VkqqmG3WevE9pJzzL307qQTBc2ixNoUoQELPD9w3ZgyWIUJiy3Z3/s1600/Untitled.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
As more Web pages link to Discovery's Planet Earth page, the 
Discovery page's rank increases. When Discovery's page ranks higher than
 other pages, it shows up at the top of the Google search results page.&lt;br /&gt;
Because
 Google looks at links to a Web page as a vote, it's not easy to cheat 
the system. The best way to make sure your Web page is high up on 
Google's search results is to provide great content so that people will 
link back to your page. The more links your page gets, the higher its 
PageRank score will be. If you attract the attention of sites with a 
high PageRank score, your score will grow faster.&lt;br /&gt;
Google initiated
 an experiment with its search engine in 2008. For the first time, 
Google is allowing a group of beta testers to change the ranking order 
of search results. In this experiment, beta testers can promote or 
demote search results and tailor their search experience so that it's 
more personally relevant. Google executives say there's no guarantee 
that the company will ever implement this feature into the search engine
 globally.­&lt;br /&gt;
&lt;div style="text-align: right;"&gt;
&amp;nbsp;&lt;a href="http://hamidkalu.blogspot.in/2013/10/how-google-search-engine-works.html"&gt;Continue Reading..,&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div id="fb-root"&gt;
&lt;/div&gt;
&lt;script&gt;(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&amp;appId=327933373929598";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));&lt;/script&gt;

&lt;/div&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhobmiSmf5irDqOA-_aOZ0l5adMg40S1L4liz9yfPw2ltwtrF1oKeWAJClCfoKytfOz8rqq5dhYKYmLgtxAGXo5k9UeNgw-tDiLwT00VY2GIZAyhdCKz0tzNUfqV3pyonzqs33FbMSgqKc9/s72-c/images.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>How Google Search Engine Works</title><link>http://hamidkalu.blogspot.com/2013/10/how-google-search-engine-works.html</link><category>Search Engine</category><author>noreply@blogger.com (Hamid)</author><pubDate>Sun, 6 Oct 2013 12:54:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7786780271346850842.post-1821115942578909509</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCaFKpc_2NakVHw9EPiInhojNL4l0eoc9LeIM6DrD1DnJod-hNetxKqkxEMnh386Aon0hxnxxmSgdQ3xH4W-WNq0-C6WM5VVIdR4y78re4RLbiiIRAoQQA2qcLYWHtKf0_xNbtxTIKC_h9/s1600/search-engine-chart.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCaFKpc_2NakVHw9EPiInhojNL4l0eoc9LeIM6DrD1DnJod-hNetxKqkxEMnh386Aon0hxnxxmSgdQ3xH4W-WNq0-C6WM5VVIdR4y78re4RLbiiIRAoQQA2qcLYWHtKf0_xNbtxTIKC_h9/s1600/search-engine-chart.gif" /&gt;&lt;/a&gt;&lt;/div&gt;
Internet search engines are special sites on the Web that are 
designed to help people find information stored on other sites. There 
are differences in the ways various search engines work, but they all 
perform three basic tasks:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;They search the Internet -- or select pieces of the Internet -- based on important words.&lt;/li&gt;
&lt;li&gt;They keep an index of the words they find, and where they find them.&lt;/li&gt;
&lt;li&gt;They allow users to look for words or combinations of words found in that index.&lt;/li&gt;
&lt;/ul&gt;
Early
 search engines held an index of a few hundred thousand pages and 
documents, and received maybe one or two thousand inquiries each day. 
Today, a top search engine will index hundreds of millions of pages, and
 respond to tens of millions of queries per day. In this article, we'll 
tell you how these major tasks are performed, and how Internet search 
engines put the pieces together in order to let you find the information
 you need on the Web.&lt;br /&gt;
&lt;h1 class="articlePageTitle"&gt;
Web Crawling&lt;/h1&gt;
When most people talk about Internet search engines, they really mean
 World Wide Web search engines. Before the Web became the most visible 
part of the Internet, there were already search engines in place to help
 people find information on the Net. Programs with names like "gopher" 
and "Archie" kept indexes of files stored on servers connected to the Internet,
 and dramatically reduced the amount of time required to find programs 
and documents. In the late 1980s, getting serious value from the 
Internet meant knowing how to use gopher, Archie, Veronica and the rest.&lt;br /&gt;
Today,
 most Internet users limit their searches to the Web, so we'll limit 
this article to search engines that focus on the contents of Web pages.&lt;br /&gt;
Before
 a search engine can tell you where a file or document is, it must be 
found. To find information on the hundreds of millions of Web pages that
 exist, a search engine employs special software robots, called &lt;b&gt;spiders&lt;/b&gt;, to build lists of the words found on Web sites. When a spider is building its lists, the process is called &lt;b&gt;Web crawling&lt;/b&gt;.
 (There are some disadvantages to calling part of the Internet the World
 Wide Web -- a large set of arachnid-centric names for tools is one of 
them.) In order to build and maintain a useful list of words, a search 
engine's spiders have to look at a lot of pages.&lt;br /&gt;
How does any spider start its travels over the Web? The usual starting points are lists of heavily used servers
 and very popular pages. The spider will begin with a popular site, 
indexing the words on its pages and following every link found within 
the site. In this way, the spidering system quickly begins to travel, 
spreading out across the most widely used portions of the Web.&lt;br /&gt;
Google
 began as an academic search engine. In the paper that describes how the
 system was built, Sergey Brin and Lawrence Page give an example of how 
quickly their spiders can work. They built their initial system to use 
multiple spiders, usually three at one time. Each spider could keep 
about 300 connections to Web pages open at a time. At its peak 
performance, using four spiders, their system could crawl over 100 pages
 per second, generating around 600 kilobytes of data each second.&lt;br /&gt;
Keeping
 everything running quickly meant building a system to feed necessary 
information to the spiders. The early Google system had a server 
dedicated to providing URLs to the spiders. Rather than depending on an Internet service provider for the domain name server (DNS) that translates a server's name into an address, Google had its own DNS, in order to keep delays to a minimum.&lt;br /&gt;
When the Google spider looked at an HTML page, it took note of two things:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;The words within the page&lt;/li&gt;
&lt;li&gt;Where the words were found&lt;/li&gt;
&lt;/ul&gt;
Words occurring in the title, subtitles, &lt;b&gt;meta tags&lt;/b&gt;
 and other positions of relative importance were noted for special 
consideration during a subsequent user search. The Google spider was 
built to index every significant word on a page, leaving out the 
articles "a," "an" and "the." Other spiders take different approaches.&lt;br /&gt;
&lt;br /&gt;
&lt;h1 class="articlePageTitle"&gt;
Meta Tags&lt;/h1&gt;
&lt;b&gt;Meta tags&lt;/b&gt; allow the owner of a page to specify key 
words and concepts under which the page will be indexed. This can be 
helpful, especially in cases in which the words on the page might have 
double or triple meanings -- the meta tags
 can guide the search engine in choosing which of the several possible 
meanings for these words is correct. There is, however, a danger in 
over-reliance on meta tags, because a careless or unscrupulous page 
owner might add meta tags that fit very popular topics but have nothing 
to do with the actual contents of the page. To protect against this, 
spiders will correlate meta tags with page content, rejecting the meta 
tags that don't match the words on the page.&lt;br /&gt;
&lt;h1 class="articlePageTitle"&gt;
Building the Index&lt;/h1&gt;
Once the spiders have completed the task of finding information on 
Web pages (and we should note that this is a task that is never actually
 completed -- the constantly changing nature of the Web means that the 
spiders are always crawling), the search engine must store the 
information in a way that makes it useful. There are two key components 
involved in making the gathered data accessible to users:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;b&gt;information stored with the data&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;The &lt;b&gt;method by which the information is indexed&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
In
 the simplest case, a search engine could just store the word and the 
URL where it was found. In reality, this would make for an engine of 
limited use, since there would be no way of telling whether the word was
 used in an important or a trivial way on the page, whether the word was
 used once or many times or whether the page contained links to other 
pages containing the word. In other words, there would be no way of 
building the &lt;b&gt;ranking&lt;/b&gt; list that tries to present the most useful pages at the top of the list of search results.An index has a single purpose: It allows information to be found as 
quickly as possible. There are quite a few ways for an index to be 
built, but one of the most effective ways is to build a &lt;b&gt;hash table&lt;/b&gt;. In &lt;b&gt;hashing&lt;/b&gt;,
 a formula is applied to attach a numerical value to each word. The 
formula is designed to evenly distribute the entries across a 
predetermined number of divisions. This numerical distribution is 
different from the distribution of words across the alphabet, and that 
is the key to a hash table's effectiveness.&lt;br /&gt;
&lt;div class="content"&gt;
&lt;h1 class="articlePageTitle"&gt;
Building a Search&lt;/h1&gt;
Searching through an index involves a user building a &lt;b&gt;query&lt;/b&gt;
 and submitting it through the search engine. The query can be quite 
simple, a single word at minimum. Building a more complex query requires
 the use of Boolean operators that allow you to refine and extend the terms of the search.&lt;br /&gt;
The Boolean operators most often seen are:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;AND&lt;/b&gt;
 - All the terms joined by "AND" must appear in the pages or documents. 
Some search engines substitute the operator "+" for the word AND.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;OR&lt;/b&gt; - At least one of the terms joined by "OR" must appear in the pages or documents.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;NOT&lt;/b&gt;
 - The term or terms following "NOT" must not appear in the pages or 
documents. Some search engines substitute the operator "-" for the word 
NOT.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;FOLLOWED BY&lt;/b&gt; - One of the terms must be directly followed by the other.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;NEAR&lt;/b&gt; - One of the terms must be within a specified number of words of the other.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Quotation Marks&lt;/b&gt; - The words between the quotation marks are treated as a phrase, and that phrase must be found within the document or file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;br /&gt;
courtesy:HowStuffWorks.com &lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCaFKpc_2NakVHw9EPiInhojNL4l0eoc9LeIM6DrD1DnJod-hNetxKqkxEMnh386Aon0hxnxxmSgdQ3xH4W-WNq0-C6WM5VVIdR4y78re4RLbiiIRAoQQA2qcLYWHtKf0_xNbtxTIKC_h9/s72-c/search-engine-chart.gif" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>10 Easy Steps to build a Website</title><link>http://hamidkalu.blogspot.com/2013/10/10-easy-steps-to-build-website.html</link><author>noreply@blogger.com (Hamid)</author><pubDate>Thu, 3 Oct 2013 23:19:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7786780271346850842.post-4233543497488770562</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4de7hj7bMMm3nGEXcmac5BiCNKa41z9mX1DPAGUXrkKhczCKFc1_32TT3NoWdM4GIWaBZZ6Bf6aDJGmci3KL_ZdR5jy5ybR3rwYm5Q5mjDCqIWPayzNd4mYsycG5NYMtr6r0bQKQAe_Ew/s1600/website-design.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="197" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4de7hj7bMMm3nGEXcmac5BiCNKa41z9mX1DPAGUXrkKhczCKFc1_32TT3NoWdM4GIWaBZZ6Bf6aDJGmci3KL_ZdR5jy5ybR3rwYm5Q5mjDCqIWPayzNd4mYsycG5NYMtr6r0bQKQAe_Ew/s400/website-design.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div id="fb-root"&gt;
&lt;/div&gt;
&lt;script&gt;(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&amp;appId=327933373929598";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));&lt;/script&gt;

&lt;br /&gt;
&lt;div class="fb-like" data-href="http://hamidkalu.blogspot.in/2013/10/10-easy-steps-to-build-website.html" data-send="true" data-show-faces="false" data-width="450"&gt;
&lt;/div&gt;
&lt;hr /&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;h2 style="font-family: Arial Rounded MT Bold; text-align: left;"&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;span class="h2"&gt;&lt;b&gt;step 1:&lt;/b&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;span class="h2"&gt;&lt;/span&gt;&lt;small&gt;&lt;small&gt;&lt;span style="font-weight: normal;"&gt;&lt;/span&gt;&lt;/small&gt;&lt;/small&gt;&lt;small&gt;&lt;small&gt;&lt;span style="font-weight: normal;"&gt;&lt;/span&gt;&lt;/small&gt;&lt;/small&gt;&lt;span class="h2"&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;span style="color: #990000;"&gt;&lt;span class="" style="font-weight: normal;"&gt;Selecting
a domain name For Your Website:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;/h2&gt;
&lt;span style="font-size: small;"&gt;Preselect
a domain name but 1st
find the keywords &amp;nbsp;/ key phrases
that
pertain to your business or service. if you are not familiar with
&amp;nbsp;what a key word, key phrase or long tail keyword is chick
here &lt;span style="color: #006600;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Index_term" style="color: #cc9933; font-weight: normal;"&gt;&lt;span style="color: #ea7500; font-weight: bold;"&gt;keywords&lt;/span&gt;.&lt;/a&gt;
            &lt;span style="color: black;"&gt;incorporate
your keywords &amp;nbsp;into your domain name. your domain name does
not have to be your business name.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;small&gt;&lt;span style="font-size: large;"&gt;&lt;span style="color: #006600; font-family: Arial Rounded MT Bold;"&gt;&lt;span style="color: black;"&gt;&lt;span class="h2"&gt;step 2:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;small style="font-weight: normal;"&gt;&lt;span style="color: #006600;"&gt;&lt;span style="color: black;"&gt;&lt;span class=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/small&gt;&lt;/small&gt;&lt;/h2&gt;
&lt;h3 style="font-family: Arial Rounded MT Bold; font-weight: normal; text-align: left;"&gt;
&lt;b&gt;&lt;span style="font-size: small;"&gt;&lt;span style="color: #990000;"&gt;&lt;span class=""&gt;Check
availability of your selected domain name For Your Website:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;
&lt;div style="font-family: Arial Rounded MT Bold; font-weight: normal; text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;Use
one of
the two services listed on the right side bar to &amp;nbsp;determine if
your domain name has been taken. it is a &lt;span style="color: red; font-style: italic; font-weight: bold;"&gt;free&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;service. in
godaddy click
on &amp;nbsp;find your domain or in hostgator click on
&amp;nbsp;Domains. if
you find a domain you like lock it in so no one else can steal it from
you. then follow the instructions on having your domain hosted.&lt;/span&gt;&lt;/div&gt;
&lt;div class="h2" style="text-decoration: underline;"&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;small&gt;&lt;span style="font-size: large;"&gt;&lt;span style="color: #006600; font-family: Arial Rounded MT Bold;"&gt;&lt;span style="color: black;"&gt;&lt;span class="h2"&gt;step 3:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/small&gt;&lt;/h2&gt;
&lt;big&gt; &lt;/big&gt;&lt;/div&gt;
&lt;h3 style="font-family: Arial Rounded MT Bold; font-weight: normal; text-align: left;"&gt;
&lt;b&gt;&lt;span style="font-size: small;"&gt;&lt;span style="color: #990000;"&gt;Build
A Website:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;
&lt;span style="font-size: small;"&gt;determine what
type of
platform / website
you want to build. I use standard html &amp;nbsp;and word press. there
are
free templates that come with your hosting sites our you can create
your own design. design your website prior to publishing / uploading it
to your hosting company.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span class="h2"&gt;step 4:&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style="font-family: Arial Rounded MT Bold; font-weight: normal; text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;&lt;b&gt;&lt;span style="color: #990000;"&gt;SEO
Optimization For Your Website:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;div style="font-family: Arial Rounded MT Bold; font-weight: normal;"&gt;
&lt;span style="font-size: small;"&gt;Size
your
image files to match your webpage size &amp;nbsp;also name your files
&amp;nbsp;with a name that is relevant to your website image sizes. use
h1
h2 h3 h4 tags. paragraph your text. provide links both internal and
external. have some relevant back links to your site (these are links
for other websites linked back to your website).&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-family: Arial Rounded MT Bold; font-weight: normal;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span class="h2"&gt;step 5:&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style="font-family: Arial Rounded MT Bold; text-align: left;"&gt;
&lt;span style="color: #990000;"&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-weight: normal;"&gt;Website
Title Line, Keywords And Description:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;div style="font-family: Arial Rounded MT Bold;"&gt;
&lt;span style="font-size: small;"&gt;Keep
Your Title Line Between 20 And 60 Characters And Use Your Keywords /
Key Phrases In It. Don't Copy Your Domain Name. Your Website
Description Should Also Use Your Keywords. The Length Should Be No
Longer Than 140 Characters. Don't Over Stuff Your Keywords In Your
Website Or Description. In The Head Section Of Your Source Code Of Your
Website Make Sure You Have A Keyword Meta Tag. Add Your Keywords / Key
Phrases That Are Relevant To Your Website Only Once And In The Order
That They Are Mostly Used / Density. Use 50 Max. Use One Of The Free
Website Tools To Check The Density.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-family: Arial Rounded MT Bold;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span class="h2"&gt;step 6:&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style="font-family: Arial Rounded MT Bold; text-align: left;"&gt;
&lt;span style="color: #990000;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;Website
Video:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;div style="font-family: Arial Rounded MT Bold; text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;&lt;span style="font-family: Arial Rounded MT Bold;"&gt;Google Owns
YouTube. Shoot Or Build A Video. Windows Has A Video Maker In It. Once
Made Upload It To YouTube Or Another Video Hosting Platform. Open It
And Copy The Embedment File. In Your Website Program Install Your
Embedment File Into Your Website. &amp;nbsp;Here Is An
Example.&amp;nbsp; &lt;a href="http://www.youtube.com/watch?v=Uig4MBFBQGU" style="color: #ea7500; font-weight: bold;"&gt;Video How
To Build A &amp;nbsp;Website&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="font-family: Arial Rounded MT Bold; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font-family: Arial Rounded MT Bold; font-weight: normal;"&gt;
&lt;/div&gt;
&lt;h2&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: Arial Rounded MT Bold;"&gt;&lt;span class="h2"&gt;step 7:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style="font-family: Arial Rounded MT Bold; text-align: left;"&gt;
&lt;span style="color: #990000;"&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Indexing
Your Website For Search Engines &amp;amp; Directories:&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;span style="font-size: small;"&gt;Index
Your Website So It Will Push It Through The Search Engines Faster. It
May Take &amp;nbsp;24 Hrs To 8 Days But To Fully Index Your Site and
All
Its Links May Take Up To 90 Days.&lt;/span&gt;&lt;br /&gt;
&lt;h2&gt;
&lt;span style="font-size: large;"&gt;&lt;span style="font-family: Arial Rounded MT Bold;"&gt;&lt;span class="h2"&gt;step 8:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style="font-family: Arial Rounded MT Bold; text-align: left;"&gt;
&lt;span style="color: #990000;"&gt;&lt;span style="font-size: small;"&gt;Website
1st Page Ranking Using Localization:&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;div style="font-family: Arial Rounded MT Bold;"&gt;
&lt;span style="font-size: small;"&gt;Localizing
Your Search Results Will Make It Easier To Obtain 1st Page Ranking For
Your Website. Most Clients / Customers Will Not Venture Past The 1st Or
2nd Page. To Do This You Might Want To Add To Your Domain Name The City
That You Want To Do Business In And In Some Cases The State or You Can
Create Another Index Or Html Folder Under Your Root Folder (Domain
Name).&lt;/span&gt;&lt;/div&gt;
&lt;table cellpadding="2" cellspacing="2" style="margin-left: auto; margin-right: auto; text-align: left; width: 850px;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class="h1 h1" style="vertical-align: top;"&gt;&lt;h2 class="h2"&gt;
&lt;/h2&gt;
&lt;h2 class="h2"&gt;
&amp;nbsp;step 9:&lt;/h2&gt;
&lt;h3&gt;
 &lt;span class="h1"&gt;&lt;/span&gt;&lt;span style="color: #990000;"&gt;&lt;small&gt;&lt;span style="font-weight: normal;"&gt;&lt;b&gt;&lt;span style="font-size: small;"&gt;Website 1st Page Ranking Using
Link Buildin&lt;/span&gt;g:&lt;/b&gt;&lt;/span&gt;&lt;/small&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;span style="font-size: small;"&gt;Link Building can improve your
Website Ranking With Out Localizing Or Long Tail Key Phrases.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;It Is
Important When Link Building To Use Relevant Links Both In and Out.
Make Sure You Are&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;Selecting Linked Sites That Themselves Have A
&amp;nbsp;High Page Ranking. A Low Ranked Site Can&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;Weight Your Website
Down.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;Here Is A Site Link That We Recommend For Finding Great
Back Links. &lt;a href="http://7bc1cph7z72un68fqlp7t9ly5n.hop.clickbank.net/" style="color: #ea7500;"&gt;Link
Building Made Easy&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h2&gt;
&lt;span class="h2"&gt;step 10:&lt;/span&gt;&lt;/h2&gt;
&lt;h3&gt;
&lt;span style="color: #990000;"&gt;&lt;small&gt;&lt;span style="font-weight: normal;"&gt;&lt;b&gt;&lt;span style="font-size: small;"&gt;Website
1st Page Ranking Using Blogs:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/small&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;&lt;span style="font-weight: normal;"&gt;You
Can Create a Blog Website using Word Press Or Coral, Both Are Great
Blog Platforms, &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;&lt;span style="font-weight: normal;"&gt;they &amp;nbsp;offer free templates and lots
of free
plug ins including SEO plug ins. Blog website templates&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;&lt;span style="font-weight: normal;"&gt;&amp;nbsp;are search
engine friendly and help in page ranking. search engines like new
content and a blog site&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;&lt;span style="font-weight: normal;"&gt;&amp;nbsp;will give you that. down fall is once your site
reaches front page ranking your site will&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&lt;span style="font-weight: normal;"&gt;be blasted with bloggers
attaching to your blog website. this works like backing for them&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&lt;span style="font-weight: normal;"&gt;&amp;nbsp;in
their comment like spam will have their website link.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&lt;span style="font-weight: normal;"&gt;&amp;nbsp;so be prepaid to
receive allot of computer generated comments.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style="font-size: small;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: large;"&gt;&lt;a href="http://adclick.g.doubleclick.net/aclk?sa=L&amp;amp;ai=BN-32n6BPUvDrIerNige5qICYCrfRlJMEAAAAEAEg5-j6ATgAWO_YidJuYOXS5oO8DrIBDXczc2Nob29scy5jb226AQswMGdmcF9pbWFnZcgBCdoBKmh0dHA6Ly93M3NjaG9vbHMuY29tL3BocC9waHBfdmFyaWFibGVzLmFzcJgCoiqpAqrCYBXFgYY-wAIC4AIA6gIRLzE2ODMzMTc1L0xhcmdlUFP4Av_RHpADmgiYA8gGqAMB4AQBoAYW&amp;amp;num=0&amp;amp;sig=AOD64_0whLiP5iZ0KDEqPAfBzPNMzeKeEQ&amp;amp;client=ca-pub-3440800076797949&amp;amp;adurl=http://www.wix.com/eteamhtml/400?utm_campaign=ma_w3schools.com&amp;amp;experiment_id=ma_w3schools.comLPS_VER7Prof_400_TITLE" target="_blank"&gt;Create Your Own Website with Wix - No Coding Needed&lt;/a&gt;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;/td&gt;

            &lt;td style="font-family: Arial Rounded MT Bold; text-align: left; vertical-align: top; width: 125px;"&gt;&lt;small&gt; &lt;/small&gt;&lt;/td&gt;

          &lt;/tr&gt;
&lt;/tbody&gt;
      &lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4de7hj7bMMm3nGEXcmac5BiCNKa41z9mX1DPAGUXrkKhczCKFc1_32TT3NoWdM4GIWaBZZ6Bf6aDJGmci3KL_ZdR5jy5ybR3rwYm5Q5mjDCqIWPayzNd4mYsycG5NYMtr6r0bQKQAe_Ew/s72-c/website-design.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">31</thr:total></item><item><title>HOW TO READ BAR CODES</title><link>http://hamidkalu.blogspot.com/2013/10/how-to-read-bar-codes.html</link><author>noreply@blogger.com (Hamid)</author><pubDate>Tue, 1 Oct 2013 15:42:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7786780271346850842.post-8691768130261816117</guid><description>

&lt;div class="fb-like" data-href="http://hamidkalu.blogspot.in/2013/10/how-to-read-bar-codes.html" data-width="450" data-show-faces="false" data-send="true"&gt;&lt;/div&gt;



&lt;hr&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhId8fQ1e5hZR-56rzV0bkJRPtyswoS9FSZy3hiaifjsqWe0m-DWWU8HTPjT5uXz472ntSOLz8OXEeDLMmABlmrNS60IdN8FjPXkgFl4ssnbXYAaXZ1WC-mJx1RRglpNs1LDUMj7PTKpSs1/s1600/images.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhId8fQ1e5hZR-56rzV0bkJRPtyswoS9FSZy3hiaifjsqWe0m-DWWU8HTPjT5uXz472ntSOLz8OXEeDLMmABlmrNS60IdN8FjPXkgFl4ssnbXYAaXZ1WC-mJx1RRglpNs1LDUMj7PTKpSs1/s1600/images.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span style="font-size: large;"&gt;&lt;span style="color: #990000;"&gt;HOW TO READ BAR CODES...(everyone must know)&lt;/span&gt;&lt;/span&gt;&lt;span class="text_exposed_show"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h2&gt;
&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt;
 ALWAYS READ THE LABELS ON THE FOODS YOU BUY--NO MATTER WHAT THE FRONT 
OF THE BOX OR PACKAGE SAYS, TURN IT OVER AND READ THE BACK---CAREFULLY!&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt;
 With all the food and pet products now coming from China, it is best to
 make sure you read label at the supermarket and especially when buying 
food products. Many products no longer show where they were made, only 
give where the distributor is located. The whole world is concerned 
about China-made "black- hearted goods".&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; Can you differentiate which one is made in Taiwan or China ?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; The world is also concerned about GMO (Genetically Modified Organism) foods; steroid fed animals (ex: 45 days old&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; broiler chicken).&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; It is important to read the bar code to track its origin. How to read Bar Codes ....interesting !&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; If the first 3 digits of the bar code are 690, 691 or 692, the product is MADE IN CHINA. 471 is Made in Taiwan .&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; If the first 3 digits of the barcode are&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; 00-09 then it's made or sourced in USA&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt;
 This is our right to know, but the government and related departments 
never educate the public, therefore we have to RESCUE ourselves.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; Nowadays, Chinese businessmen know that consumers do not prefer products"MADE IN CHINA", so they don't show from which country it is made. However, you may now refer to the barcode - remember if the first 3 digits are:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; 890......MADE IN INDIA&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; 690, 691, 692 ... then it is MADE IN CHINA&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; 00 - 09 ... USA and CANADA&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; 30 - 37 ... FRANCE&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; 40 - 44 ... GERMANY&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; 471 ........ Taiwan&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; 49 .......... JAPAN&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;h4 style="text-align: left;"&gt;
&lt;span style="font-weight: normal;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="messageBody" data-ft="{&amp;quot;type&amp;quot;:3,&amp;quot;tn&amp;quot;:&amp;quot;K&amp;quot;}"&gt;&lt;span class="userContent"&gt;&lt;span class="text_exposed_show"&gt; 50 .......... UK&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;div id="fb-root"&gt;&lt;/div&gt;
&lt;script&gt;(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&amp;appId=327933373929598";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));&lt;/script&gt;



&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhId8fQ1e5hZR-56rzV0bkJRPtyswoS9FSZy3hiaifjsqWe0m-DWWU8HTPjT5uXz472ntSOLz8OXEeDLMmABlmrNS60IdN8FjPXkgFl4ssnbXYAaXZ1WC-mJx1RRglpNs1LDUMj7PTKpSs1/s72-c/images.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>C++ Tuorial Part-I</title><link>http://hamidkalu.blogspot.com/2013/09/c-tuorial-part-i.html</link><category>C++ Basic Syntax</category><category>C++ Overview</category><author>noreply@blogger.com (Hamid)</author><pubDate>Sun, 29 Sep 2013 12:59:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7786780271346850842.post-4685461397286655178</guid><description>
&lt;div id="fb-root"&gt;&lt;/div&gt;
&lt;script&gt;(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&amp;appId=327933373929598";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));&lt;/script&gt;

&lt;div class="fb-like" data-href="http://hamidkalu.blogspot.in/2013/09/c-tuorial-part-i.html" data-width="450" data-show-faces="false" data-send="true"&gt;&lt;/div&gt;


&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;hr /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;

&lt;link rel="stylesheet" type="text/css" href="style.css" /&gt;
&lt;script&gt;(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&amp;appId=347732715269819";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));&lt;/script&gt;


&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2ZoEQwhO9bo15opUNbA6yM77kUn-FLkQAiNkTT3-XtW4YHGm4lzNNU_2PbEqlTyNA8WFSYbvQPgTIk-mocK8BcD5yoqkyou818h6EoaXLEXSzPjfpS1eza6P_GRjvD8varob5l8bAIj1t/s1600/cpp-mini-logo.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2ZoEQwhO9bo15opUNbA6yM77kUn-FLkQAiNkTT3-XtW4YHGm4lzNNU_2PbEqlTyNA8WFSYbvQPgTIk-mocK8BcD5yoqkyou818h6EoaXLEXSzPjfpS1eza6P_GRjvD8varob5l8bAIj1t/s1600/cpp-mini-logo.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h1&gt;
&amp;nbsp;C++ Tutorial&lt;/h1&gt;
&lt;div&gt;
C++ is a middle-level programming language developed by Bjarne 
Stroustrup starting in 1979 at Bell Labs. C++ runs on a variety of 
platforms, such as Windows, Mac OS, and the various versions of UNIX.&lt;br /&gt;
This reference will take you through simple and practical approach while learning C++ Programming language.&lt;/div&gt;
&lt;h1&gt;
Audience&lt;/h1&gt;
This reference has been prepared for the beginners to help them 
understand the basic to advanced concepts related to C++ Programming 
languages.&lt;br /&gt;
&lt;h1&gt;
Prerequisites&lt;/h1&gt;
Before you start doing practice with various types of examples given 
in this reference, I'm making an assumption that you are already aware 
about what is a computer program and what is a computer programming 
language?&lt;br /&gt;
&lt;h1&gt;
Compile/Execute C++ Programs&lt;/h1&gt;
For most of the examples given in this tutorial, you will find &lt;b&gt;Try it&lt;/b&gt; option to compile and execute C++ programs online, so just make use of it and enjoy your learning.&lt;br /&gt;
Try the following example using &lt;b&gt;Try it&lt;/b&gt; option available at the top right corner of the below sample code box:&lt;br /&gt;
&lt;pre class="prettyprint tryit prettyprinted" style="cursor: default;"&gt;&lt;span class="com"&gt;#include&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;using&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;namespace&lt;/span&gt;&lt;span class="pln"&gt; std&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;()&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   cout &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Hello World"&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
C++ is a statically typed, compiled, general-purpose, case-sensitive,
 free-form programming language that supports procedural, 
object-oriented, and generic programming.&lt;br /&gt;
C++ is regarded as a &lt;b&gt;middle-level&lt;/b&gt; language, as it comprises a combination of both high-level and low-level language features.&lt;br /&gt;
C++ was developed by Bjarne Stroustrup starting in 1979 at Bell Labs 
in Murray Hill, New Jersey, as an enhancement to the C language and 
originally named C with Classes but later it was renamed C++ in 1983.&lt;br /&gt;
C++ is a superset of C, and that virtually any legal C program is a legal C++ program.&lt;br /&gt;
&lt;b&gt;Note:&lt;/b&gt; A programming language is said to use static typing when type checking is performed during compile-time as opposed to run-time.&lt;br /&gt;
&lt;h2&gt;
Object-Oriented Programming&lt;/h2&gt;
C++ fully supports object-oriented programming, including the four pillars of object-oriented development:&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;Encapsulation&lt;/li&gt;
&lt;li&gt;Data hiding&lt;/li&gt;
&lt;li&gt;Inheritance&lt;/li&gt;
&lt;li&gt;Polymorphism&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Standard Libraries&lt;/h2&gt;
Standard C++ consists of three important parts:&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;The core language giving all the building blocks including variables, data types and literals, etc.&lt;/li&gt;
&lt;li&gt;The C++ Standard Library giving a rich set of functions manipulating files, strings, etc.&lt;/li&gt;
&lt;li&gt;The Standard Template Library (STL) giving a rich set of methods manipulating data structures, etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
The ANSI Standard&lt;/h2&gt;
The ANSI standard is an attempt to ensure that C++ is portable -- 
that code you write for Microsoft's compiler will compile without 
errors, using a compiler on a Mac, UNIX, a Windows box, or an Alpha.&lt;br /&gt;
The ANSI standard has been stable for a while, and all the major C++ compiler manufacturers support the ANSI standard.&lt;br /&gt;
&lt;h2&gt;
Learning C++&lt;/h2&gt;
The most important thing to do when learning C++ is to focus on concepts and not get lost in language technical details.&lt;br /&gt;
The purpose of learning a programming language is to become a better 
programmer; that is, to become more effective at designing and 
implementing new systems and at maintaining old ones.&lt;br /&gt;
C++ supports a variety of programming styles. You can write in the 
style of Fortran, C, Smalltalk, etc., in any language. Each style can 
achieve its aims effectively while maintaining runtime and space 
efficiency.&lt;br /&gt;
&lt;h2&gt;
Use of C++&lt;/h2&gt;
C++ is used by hundreds of thousands of programmers in essentially every application domain.&lt;br /&gt;
C++ is being highly used to write device drivers and other softwares 
that rely on direct manipulation of hardware under realtime constraints.&lt;br /&gt;
C++ is widely used for teaching and research because it is clean enough for successful teaching of basic concepts.&lt;br /&gt;
Anyone who has used either an Apple Macintosh or a PC running Windows
 has indirectly used C++ because the primary user interfaces of these 
systems are written in C++.&lt;br /&gt;
&lt;h1&gt;
C++ Basic Syntax&lt;/h1&gt;
When we consider a C++ program, it can be defined as a collection of 
objects that communicate via invoking each other's methods. Let us now 
briefly look into what do class, object, methods and instant variables 
mean.&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;&lt;b&gt;Object -&lt;/b&gt; Objects have states and behaviors. Example: A dog
 has states - color, name, breed as well as behaviors - wagging, 
barking, eating. An object is an instance of a class. &lt;/li&gt;
&lt;li&gt;&lt;b&gt;Class -&lt;/b&gt; A class can be defined as a template/blueprint that describes the behaviors/states that object of its type support.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Methods -&lt;/b&gt; A method is basically a behavior. A class can 
contain many methods. It is in methods where the logics are written, 
data is manipulated and all the actions are executed.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Instant Variables -&lt;/b&gt; Each object has its unique set of 
instant variables. An object's state is created by the values assigned 
to these instant variables.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
C++ Program Structure:&lt;/h2&gt;
Let us look at a simple code that would print the words &lt;i&gt;Hello World&lt;/i&gt;.&lt;br /&gt;
&lt;pre class="prettyprint tryit prettyprinted" style="cursor: default;"&gt;&lt;span class="com"&gt;#include&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;using&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;namespace&lt;/span&gt;&lt;span class="pln"&gt; std&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

&lt;/span&gt;&lt;span class="com"&gt;// main() is where program execution begins.&lt;/span&gt;&lt;span class="pln"&gt;

&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;()&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   cout &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Hello World"&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="com"&gt;// prints Hello World&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
Let us look various parts of the above program:&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;The C++ language defines several headers, which contain 
information that is either necessary or useful to your program. For this
 program, the header &lt;b&gt;&amp;lt;iostream&amp;gt;&lt;/b&gt; is needed.&lt;/li&gt;
&lt;li&gt;The line &lt;b&gt;using namespace std;&lt;/b&gt; tells the compiler to use the std namespace. Namespaces are a relatively recent addition to C++.&lt;/li&gt;
&lt;li&gt;The next line &lt;b&gt;// main() is where program execution begins.&lt;/b&gt; is a single-line comment available in C++. Single-line comments begin with // and stop at the end of the line.&lt;/li&gt;
&lt;li&gt;The line &lt;b&gt;int main()&lt;/b&gt; is the main function where program execution begins.&lt;/li&gt;
&lt;li&gt;The next line &lt;b&gt;cout &amp;lt;&amp;lt; "This is my first C++ program.";&lt;/b&gt; causes the message "This is my first C++ program" to be displayed on the screen.&lt;/li&gt;
&lt;li&gt;The next line &lt;b&gt;return 0;&lt;/b&gt; terminates main( )function and causes it to return the value 0 to the calling process.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Compile &amp;amp; Execute C++ Program:&lt;/h2&gt;
Let's look at how to save the file, compile and run the program. Please follow the steps given below:&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;Open a text editor and add the code as above.&lt;/li&gt;
&lt;li&gt;Save the file as:  hello.cpp&lt;/li&gt;
&lt;li&gt;Open a command prompt and go to the directory where you saved the file.&lt;/li&gt;
&lt;li&gt;Type 'g++ hello.cpp ' and press enter to compile your code. If 
there are no errors in your code the command prompt will take you to the
 next line and would generate a.out executable file.&lt;/li&gt;
&lt;li&gt;Now, type ' a.out' to run your program.&lt;/li&gt;
&lt;li&gt;You will be able to see ' Hello World ' printed on the window.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="result"&gt;$ g++ hello.cpp
$ ./a.out
Hello World
&lt;/pre&gt;
Make sure that g++ is in your path and that you are running it in the directory containing file hello.cpp.&lt;br /&gt;
You can compile C/C++ programs using makefile. For more details, you can check &lt;a href="http://www.tutorialspoint.com/makefile/index.htm" target="_blank"&gt;Makefile Tutorial&lt;/a&gt;.&lt;br /&gt;
&lt;h2&gt;
Semicolons &amp;amp; Blocks in C++:&lt;/h2&gt;
In C++, the semicolon is a statement terminator. That is, each 
individual statement must be ended with a semicolon. It indicates the 
end of one logical entity.&lt;br /&gt;
For example, following are three different statements:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;x &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; y&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
y &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; y&lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="lit"&gt;1&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
add&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;x&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; y&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;/pre&gt;
A block is a set of logically connected statements that are surrounded by opening and closing braces. For example:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   cout &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Hello World"&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="com"&gt;// prints Hello World&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
C++ does not recognize the end of the line as a terminator. For this 
reason, it does not matter where on a line you put a statement. For 
example:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;x &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; y&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
y &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; y&lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="lit"&gt;1&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
add&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;x&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; y&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;/pre&gt;
is the same as&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;x &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; y&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt; y &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; y&lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="lit"&gt;1&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt; add&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;x&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; y&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
C++ Identifiers:&lt;/h2&gt;
A C++ identifier is a name used to identify a variable, function, 
class, module, or any other user-defined item. An identifier starts with
 a letter A to Z or a to z or an underscore (_) followed by zero or more
 letters, underscores, and digits (0 to 9).&lt;br /&gt;
C++ does not allow punctuation characters such as @, $, and % within 
identifiers. C++ is a case-sensitive programming language.  Thus, &lt;b&gt;Manpower&lt;/b&gt; and &lt;b&gt;manpower&lt;/b&gt; are two different identifiers in C++.&lt;br /&gt;
Here are some examples of acceptable identifiers:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;mohd       zara    abc   move_name  a_123
myname50   _temp   j     a23b9      retVal&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
C++ Keywords:&lt;/h2&gt;
The following list shows the reserved words in C++. These reserved 
words may not be used as constant or variable or any other identifier 
names.&lt;br /&gt;
&lt;table class="src"&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;asm&lt;/td&gt;&lt;td&gt;else&lt;/td&gt;&lt;td&gt;new&lt;/td&gt;&lt;td&gt;this&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;auto&lt;/td&gt;&lt;td&gt;enum&lt;/td&gt;&lt;td&gt;operator&lt;/td&gt;&lt;td&gt;throw&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;bool&lt;/td&gt;&lt;td&gt;explicit&lt;/td&gt;&lt;td&gt;private&lt;/td&gt;&lt;td&gt;true&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;break&lt;/td&gt;&lt;td&gt;export&lt;/td&gt;&lt;td&gt;protected&lt;/td&gt;&lt;td&gt;try&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;case&lt;/td&gt;&lt;td&gt;extern&lt;/td&gt;&lt;td&gt;public&lt;/td&gt;&lt;td&gt;typedef&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;catch&lt;/td&gt;&lt;td&gt;false&lt;/td&gt;&lt;td&gt;register&lt;/td&gt;&lt;td&gt;typeid&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;char&lt;/td&gt;&lt;td&gt;float&lt;/td&gt;&lt;td&gt;reinterpret_cast&lt;/td&gt;&lt;td&gt;typename&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;class&lt;/td&gt;&lt;td&gt;for&lt;/td&gt;&lt;td&gt;return&lt;/td&gt;&lt;td&gt;union&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;const&lt;/td&gt;&lt;td&gt;friend&lt;/td&gt;&lt;td&gt;short&lt;/td&gt;&lt;td&gt;unsigned&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;const_cast&lt;/td&gt;&lt;td&gt;goto&lt;/td&gt;&lt;td&gt;signed&lt;/td&gt;&lt;td&gt;using&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;continue&lt;/td&gt;&lt;td&gt;if&lt;/td&gt;&lt;td&gt;sizeof&lt;/td&gt;&lt;td&gt;virtual&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;default&lt;/td&gt;&lt;td&gt;inline&lt;/td&gt;&lt;td&gt;static&lt;/td&gt;&lt;td&gt;void&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;delete&lt;/td&gt;&lt;td&gt;int&lt;/td&gt;&lt;td&gt;static_cast&lt;/td&gt;&lt;td&gt;volatile&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;do&lt;/td&gt;&lt;td&gt;long&lt;/td&gt;&lt;td&gt;struct&lt;/td&gt;&lt;td&gt;wchar_t&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;double&lt;/td&gt;&lt;td&gt;mutable&lt;/td&gt;&lt;td&gt;switch&lt;/td&gt;&lt;td&gt;while&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;dynamic_cast&lt;/td&gt;&lt;td&gt;namespace&lt;/td&gt;&lt;td&gt;template&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h2&gt;
Trigraphs:&lt;/h2&gt;
A few characters have an alternative representation, called a 
trigraph sequence. A trigraph is a three-character sequence that 
represents a single character and the sequence always starts with two 
question marks.&lt;br /&gt;
Trigraphs are expanded anywhere they appear, including within string 
literals and character literals, in comments, and in preprocessor 
directives.&lt;br /&gt;
Following are most frequently used trigraph sequences:&lt;br /&gt;
&lt;table class="src"&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;Trigraph&lt;/th&gt;&lt;th&gt;Replacement&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;??=&lt;/td&gt;&lt;td&gt;#&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;??/&lt;/td&gt;&lt;td&gt;\&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;??'&lt;/td&gt;&lt;td&gt;^&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;??(&lt;/td&gt;&lt;td&gt;[&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;??)&lt;/td&gt;&lt;td&gt;]&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;??!&lt;/td&gt;&lt;td&gt;|&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;??&amp;lt;&lt;/td&gt;&lt;td&gt;{&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;??&amp;gt;&lt;/td&gt;&lt;td&gt;}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;??-&lt;/td&gt;&lt;td&gt;~&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
All the compilers do not support trigraphs and they are not advised to be used because of their confusing nature.&lt;br /&gt;
&lt;h2&gt;
Whitespace in C++:&lt;/h2&gt;
A line containing only whitespace, possibly with a comment, is known as a blank line, and C++ compiler totally ignores it.&lt;br /&gt;
Whitespace is the term used in C++ to describe blanks, tabs, newline 
characters and comments. Whitespace separates one part of a statement 
from another and enables the compiler to identify where one element in a
 statement, such as int, ends and the next element begins. Therefore, in
 the statement,&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; age&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;/pre&gt;
there must be at least one whitespace character (usually a space) 
between int and age for the compiler to be able to distinguish them. On 
the other hand, in the statement&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;fruit &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; apples &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; oranges&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;   &lt;/span&gt;&lt;span class="com"&gt;// Get the total fruit&lt;/span&gt;&lt;/pre&gt;
no whitespace characters are necessary between fruit and =, or 
between = and apples, although you are free to include some if you wish 
for readability purpose.&lt;br /&gt;
Click here to Learn About C++ Object Oriented Part&amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2 style="text-align: center;"&gt;
&lt;span style="color: #990000;"&gt;&lt;b&gt;&lt;a href="http://hamidkalu.blogspot.in/2013/09/c-tutorial-part-ii.html"&gt;C++ Object Oriented&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h1&gt;
&amp;nbsp;&lt;/h1&gt;
&lt;br /&gt;
&lt;pre class="prettyprint tryit prettyprinted" style="cursor: default;"&gt;&lt;span class="pun"&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2ZoEQwhO9bo15opUNbA6yM77kUn-FLkQAiNkTT3-XtW4YHGm4lzNNU_2PbEqlTyNA8WFSYbvQPgTIk-mocK8BcD5yoqkyou818h6EoaXLEXSzPjfpS1eza6P_GRjvD8varob5l8bAIj1t/s72-c/cpp-mini-logo.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>C++ Tutorial Part-II</title><link>http://hamidkalu.blogspot.com/2013/09/c-tutorial-part-ii.html</link><category>Abstract class in C++</category><category>Inheritence</category><category>Object Oriented</category><category>Polymorphism</category><author>noreply@blogger.com (Hamid)</author><pubDate>Sun, 29 Sep 2013 12:58:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7786780271346850842.post-397218014722547516</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;h1&gt;
C++ Classes and Objects&lt;/h1&gt;
The main purpose of C++ programming is to add object orientation to 
the C programming language and classes are the central feature of C++ 
that supports object-oriented programming and are often called 
user-defined types.&lt;br /&gt;

A class is used to specify the form of an object and it combines data
 representation and methods for manipulating that data into one neat 
package. The data and functions within a class are called members of the
 class.&lt;br /&gt;

&lt;h2&gt;
C++ Class Definitions:&lt;/h2&gt;
When you define a class, you define a blueprint for a data type. This
 doesn't actually define any data, but it does define what the class 
name means, that is, what an object of the class will consist of and 
what operations can be performed on such an object.&lt;br /&gt;

A class definition starts with the keyword &lt;b&gt;class&lt;/b&gt; followed by 
the class name; and the class body, enclosed by a pair of curly braces. A
 class definition must be followed either by a semicolon or a list of 
declarations. For example, we defined the Box data type using the 
keyword &lt;b&gt;class&lt;/b&gt; as follows:&lt;br /&gt;

&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; length&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;   &lt;/span&gt;&lt;span class="com"&gt;// Length of a box&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; breadth&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;  &lt;/span&gt;&lt;span class="com"&gt;// Breadth of a box&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; height&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;   &lt;/span&gt;&lt;span class="com"&gt;// Height of a box&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;/pre&gt;
The keyword &lt;b&gt;public&lt;/b&gt; determines the access attributes of the 
members of the class that follow it. A public member can be accessed 
from outside the class anywhere within the scope of the class object. 
You can also specify the members of a class as &lt;b&gt;private&lt;/b&gt; or &lt;b&gt;protected&lt;/b&gt; which we will discuss in a sub-section.&lt;br /&gt;

&lt;h2&gt;
Define C++ Objects:&lt;/h2&gt;
A class provides the blueprints for objects, so basically an object 
is created from a class. We declare objects of a class with exactly the 
same sort of declaration that we declare variables of basic types. 
Following statements declare two objects of class Box:&lt;br /&gt;

&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="typ"&gt;Box&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box1&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;          &lt;/span&gt;&lt;span class="com"&gt;// Declare Box1 of type Box&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="typ"&gt;Box&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box2&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;          &lt;/span&gt;&lt;span class="com"&gt;// Declare Box2 of type Box&lt;/span&gt;&lt;/pre&gt;
Both of the objects Box1 and Box2 will have their own copy of data members.&lt;br /&gt;

&lt;h2&gt;
Accessing the Data Members:&lt;/h2&gt;
The public data members of objects of a class can be accessed using 
the direct member access operator (.). Let us try the following example 
to make the things clear:&lt;br /&gt;

&lt;pre class="prettyprint tryit prettyprinted" style="cursor: default;"&gt;&lt;span class="com"&gt;#include&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;span class="pln"&gt;

&lt;/span&gt;&lt;span class="kwd"&gt;using&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;namespace&lt;/span&gt;&lt;span class="pln"&gt; std&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

&lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; length&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;   &lt;/span&gt;&lt;span class="com"&gt;// Length of a box&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; breadth&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;  &lt;/span&gt;&lt;span class="com"&gt;// Breadth of a box&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; height&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;   &lt;/span&gt;&lt;span class="com"&gt;// Height of a box&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;span class="pln"&gt;

&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;Box&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box1&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;        &lt;/span&gt;&lt;span class="com"&gt;// Declare Box1 of type Box&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;Box&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box2&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;        &lt;/span&gt;&lt;span class="com"&gt;// Declare Box2 of type Box&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; volume &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0.0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;     &lt;/span&gt;&lt;span class="com"&gt;// Store the volume of a box here&lt;/span&gt;&lt;span class="pln"&gt;
 
   &lt;/span&gt;&lt;span class="com"&gt;// box 1 specification&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;Box1&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;height &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;5.0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt; 
   &lt;/span&gt;&lt;span class="typ"&gt;Box1&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;length &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;6.0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt; 
   &lt;/span&gt;&lt;span class="typ"&gt;Box1&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;breadth &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;7.0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="com"&gt;// box 2 specification&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;Box2&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;height &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;10.0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;Box2&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;length &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;12.0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;Box2&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;breadth &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;13.0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;// volume of box 1&lt;/span&gt;&lt;span class="pln"&gt;
   volume &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box1&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;height &lt;/span&gt;&lt;span class="pun"&gt;*&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box1&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;length &lt;/span&gt;&lt;span class="pun"&gt;*&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box1&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;breadth&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   cout &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Volume of Box1 : "&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; volume &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt;endl&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="com"&gt;// volume of box 2&lt;/span&gt;&lt;span class="pln"&gt;
   volume &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box2&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;height &lt;/span&gt;&lt;span class="pun"&gt;*&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box2&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;length &lt;/span&gt;&lt;span class="pun"&gt;*&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box2&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;breadth&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   cout &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Volume of Box2 : "&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; volume &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt;endl&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
When the above code is compiled and executed, it produces the following result:&lt;br /&gt;

&lt;pre class="result"&gt;Volume of Box1 : 210
Volume of Box2 : 1560
&lt;/pre&gt;
It is important to note that private and protected members can not be
 accessed directly using direct member access operator (.). We will 
learn how private and protected members can be accessed.&lt;br /&gt;

&lt;h1 id="detail"&gt;
Classes &amp;amp; Objects in Detail:&lt;/h1&gt;
So far, you have got very basic idea about C++ Classes and Objects. 
There are further interesting concepts related to C++ Classes and 
Objects which we will discuss in various sub-sections listed below:&lt;br /&gt;


&lt;table class="src"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th width="40%"&gt;Concept&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;a href="http://www.tutorialspoint.com/cplusplus/cpp_class_member_functions.htm" title="C++ Class Member Functions"&gt;Class member functions&lt;/a&gt;&lt;/td&gt;&lt;td&gt;A
 member function of a class is a function that has its definition or its
 prototype within the class definition like any other variable.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;a href="http://www.tutorialspoint.com/cplusplus/cpp_class_access_modifiers.htm" title="C++ Class Access Modifiers"&gt;Class access modifiers&lt;/a&gt;&lt;/td&gt;&lt;td&gt;A class member can be defined as public, private or protected. By default members would be assumed as private.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;a href="http://www.tutorialspoint.com/cplusplus/cpp_constructor_destructor.htm" title="C++ Constructor &amp;amp; Destructor"&gt;Constructor &amp;amp; destructor&lt;/a&gt;&lt;/td&gt;&lt;td&gt;A
 class constructor is a special function in a class that is called when a
 new object of the class is created. A destructor is also a special 
function which is called when created object is deleted.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;a href="http://www.tutorialspoint.com/cplusplus/cpp_copy_constructor.htm" title="C++ Copy Constructor"&gt;C++ copy constructor&lt;/a&gt;&lt;/td&gt;&lt;td&gt;The
 copy constructor is a constructor which creates an object by 
initializing it with an object of the same class, which has been created
 previously.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;a href="http://www.tutorialspoint.com/cplusplus/cpp_friend_functions.htm" title="C++ Friend Functions"&gt;C++ friend functions&lt;/a&gt;&lt;/td&gt;&lt;td&gt;A &lt;b&gt;friend&lt;/b&gt; function is permitted full access to private and protected members of a class.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;a href="http://www.tutorialspoint.com/cplusplus/cpp_inline_functions.htm" title="C++ Inline Functions"&gt;C++ inline functions&lt;/a&gt;&lt;/td&gt;&lt;td&gt;With an inline function, the compiler tries to expand the code in the body of the function in place of a call to the function.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;a href="http://www.tutorialspoint.com/cplusplus/cpp_this_pointer.htm" title="The this Pointer in C++"&gt;The this pointer in C++&lt;/a&gt;&lt;/td&gt;&lt;td&gt;Every object has a special pointer &lt;b&gt;this&lt;/b&gt; which points to the object itself.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;a href="http://www.tutorialspoint.com/cplusplus/cpp_pointer_to_class.htm" title="Pointer to C++ Classes"&gt;Pointer to C++ classes&lt;/a&gt;&lt;/td&gt;&lt;td&gt;A
 pointer to a class is done exactly the same way a pointer to a 
structure is. In fact a class is really just a structure with functions 
in it.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;&lt;td&gt; &lt;a href="http://www.tutorialspoint.com/cplusplus/cpp_static_members.htm" title="Static members of a class"&gt;Static members of a class&lt;/a&gt;&lt;/td&gt;&lt;td&gt;Both data members and function members of a class can be declared as static.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h1&gt;
&amp;nbsp;C++ Inheritance&lt;/h1&gt;
One of the most important concepts in object-oriented programming is 
that of inheritance. Inheritance allows us to define a class in terms of
 another class, which makes it easier to create and maintain an 
application. This also provides an opportunity to reuse the code 
functionality and fast implementation time.&lt;br /&gt;

When creating a class, instead of writing completely new data members
 and member functions, the programmer can designate that the new class 
should inherit the members of an existing class. This existing class is 
called the &lt;b&gt;base&lt;/b&gt; class, and the new class is referred to as the &lt;b&gt;derived&lt;/b&gt; class.&lt;br /&gt;

The idea of inheritance implements the &lt;b&gt;is a&lt;/b&gt; relationship. For example, mammal IS-A animal, dog IS-A mammal hence dog IS-A animal as well and so on.&lt;br /&gt;

&lt;h2&gt;
Base &amp;amp; Derived Classes:&lt;/h2&gt;
A class can be derived from more than one classes, which means it can
 inherit data and functions from multiple base classes. To define a 
derived class, we use a class derivation list to specify the base 
class(es). A class derivation list names one or more base classes and 
has the form:&lt;br /&gt;

&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; derived&lt;/span&gt;&lt;span class="pun"&gt;-&lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; access&lt;/span&gt;&lt;span class="pun"&gt;-&lt;/span&gt;&lt;span class="pln"&gt;specifier &lt;/span&gt;&lt;span class="kwd"&gt;base&lt;/span&gt;&lt;span class="pun"&gt;-&lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;/pre&gt;
Where access-specifier is one of &lt;b&gt;public, protected,&lt;/b&gt; or &lt;b&gt;private&lt;/b&gt;, and base-class is the name of a previously defined class. If the access-specifier is not used, then it is private by default.&lt;br /&gt;

Consider a base class &lt;b&gt;Shape&lt;/b&gt; and its derived class &lt;b&gt;Rectangle&lt;/b&gt; as follows:&lt;br /&gt;

&lt;pre class="prettyprint tryit prettyprinted" style="cursor: default;"&gt;&lt;span class="com"&gt;#include&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;span class="pln"&gt;
 
&lt;/span&gt;&lt;span class="kwd"&gt;using&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;namespace&lt;/span&gt;&lt;span class="pln"&gt; std&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

&lt;/span&gt;&lt;span class="com"&gt;// Base class&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Shape&lt;/span&gt;&lt;span class="pln"&gt; 
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; setWidth&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; w&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
         width &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; w&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; setHeight&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; h&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
         height &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; h&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;protected&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; width&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; height&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;span class="pln"&gt;

&lt;/span&gt;&lt;span class="com"&gt;// Derived class&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Rectangle&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Shape&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; getArea&lt;/span&gt;&lt;span class="pun"&gt;()&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt; 
         &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;width &lt;/span&gt;&lt;span class="pun"&gt;*&lt;/span&gt;&lt;span class="pln"&gt; height&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt; 
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;span class="pln"&gt;

&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;Rectangle&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Rect&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
 
   &lt;/span&gt;&lt;span class="typ"&gt;Rect&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;setWidth&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;5&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;Rect&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;setHeight&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;7&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="com"&gt;// Print the area of the object.&lt;/span&gt;&lt;span class="pln"&gt;
   cout &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Total area: "&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Rect&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;getArea&lt;/span&gt;&lt;span class="pun"&gt;()&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; endl&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
When the above code is compiled and executed, it produces the following result:&lt;br /&gt;

&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="typ"&gt;Total&lt;/span&gt;&lt;span class="pln"&gt; area&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;35&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
Access Control and Inheritance:&lt;/h2&gt;
A derived class can access all the non-private members of its base 
class. Thus base-class members that should not be accessible to the 
member functions of derived classes should be declared private in the 
base class.&lt;br /&gt;

We can summarize the different access types according to who can access them in the following way: &lt;br /&gt;

&lt;table class="src"&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;th width="25%"&gt;Access&lt;/th&gt;&lt;th width="25%"&gt;public&lt;/th&gt;&lt;th width="25%"&gt;protected&lt;/th&gt;&lt;th width="25%"&gt;private&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Same class&lt;/td&gt;&lt;td&gt;yes&lt;/td&gt;&lt;td&gt;yes&lt;/td&gt;&lt;td&gt;yes&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Derived classes&lt;/td&gt;&lt;td&gt;yes&lt;/td&gt;&lt;td&gt;yes&lt;/td&gt;&lt;td&gt;no&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Outside classes&lt;/td&gt;&lt;td&gt;yes&lt;/td&gt;&lt;td&gt;no&lt;/td&gt;&lt;td&gt;no&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
A derived class inherits all base class methods with the following exceptions:&lt;br /&gt;

&lt;ul class="list"&gt;
&lt;li&gt;Constructors, destructors and copy constructors of the base class.&lt;/li&gt;
&lt;li&gt;Overloaded operators of the base class.&lt;/li&gt;
&lt;li&gt;The friend functions of the base class.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Type of Inheritance:&lt;/h2&gt;
When deriving a class from a base class, the base class may be inherited through &lt;b&gt;public, protected&lt;/b&gt; or &lt;b&gt; private&lt;/b&gt; inheritance. The type of inheritance is specified by the access-specifier as explained above.&lt;br /&gt;

We hardly use &lt;b&gt;protected&lt;/b&gt; or &lt;b&gt; private&lt;/b&gt; inheritance, but &lt;b&gt;public&lt;/b&gt; inheritance is commonly used. While using different type of inheritance, following rules are applied:&lt;br /&gt;

&lt;ul class="list"&gt;
&lt;li&gt;&lt;b&gt;Public Inheritance:&lt;/b&gt; When deriving a class from a &lt;b&gt;public&lt;/b&gt; base class, &lt;b&gt;public&lt;/b&gt; members of the base class become &lt;b&gt;public&lt;/b&gt; members of the derived class and &lt;b&gt;protected&lt;/b&gt; members of the base class become &lt;b&gt;protected&lt;/b&gt; members of the derived class. A base class's &lt;b&gt;private&lt;/b&gt; members are never accessible directly from a derived class, but can be accessed through calls to the &lt;b&gt;public&lt;/b&gt; and &lt;b&gt;protected&lt;/b&gt; members of the base class.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Protected Inheritance:&lt;/b&gt;  When deriving from a &lt;b&gt;protected&lt;/b&gt; base class, &lt;b&gt;public&lt;/b&gt; and &lt;b&gt;protected &lt;/b&gt; members of the base class become &lt;b&gt;protected&lt;/b&gt; members of the derived class.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Private Inheritance:&lt;/b&gt; When deriving from a &lt;b&gt;private&lt;/b&gt; base class, &lt;b&gt;public&lt;/b&gt; and &lt;b&gt;protected&lt;/b&gt; members of the base class become &lt;b&gt;private&lt;/b&gt; members of the derived class.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Multiple Inheritances:&lt;/h2&gt;
A C++ class can inherit members from more than one class and here is the extended syntax:&lt;br /&gt;

&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; derived&lt;/span&gt;&lt;span class="pun"&gt;-&lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; access baseA&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; access baseB&lt;/span&gt;&lt;span class="pun"&gt;....&lt;/span&gt;&lt;/pre&gt;
Where access is one of &lt;b&gt;public, protected,&lt;/b&gt; or &lt;b&gt;private&lt;/b&gt; and would be given for every base class and they will be separated by comma as shown above. Let us try the following example:&lt;br /&gt;

&lt;pre class="prettyprint tryit prettyprinted" style="cursor: default;"&gt;&lt;span class="com"&gt;#include&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;span class="pln"&gt;
 
&lt;/span&gt;&lt;span class="kwd"&gt;using&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;namespace&lt;/span&gt;&lt;span class="pln"&gt; std&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

&lt;/span&gt;&lt;span class="com"&gt;// Base class Shape&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Shape&lt;/span&gt;&lt;span class="pln"&gt; 
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; setWidth&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; w&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
         width &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; w&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; setHeight&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; h&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
         height &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; h&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;protected&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; width&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; height&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;span class="pln"&gt;

&lt;/span&gt;&lt;span class="com"&gt;// Base class PaintCost&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;PaintCost&lt;/span&gt;&lt;span class="pln"&gt; 
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; getCost&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; area&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; area &lt;/span&gt;&lt;span class="pun"&gt;*&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;70&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;span class="pln"&gt;

&lt;/span&gt;&lt;span class="com"&gt;// Derived class&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Rectangle&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Shape&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;PaintCost&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; getArea&lt;/span&gt;&lt;span class="pun"&gt;()&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt; 
         &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;width &lt;/span&gt;&lt;span class="pun"&gt;*&lt;/span&gt;&lt;span class="pln"&gt; height&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt; 
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;span class="pln"&gt;

&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;Rectangle&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Rect&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; area&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
 
   &lt;/span&gt;&lt;span class="typ"&gt;Rect&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;setWidth&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;5&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;Rect&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;setHeight&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;7&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;

   area &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Rect&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;getArea&lt;/span&gt;&lt;span class="pun"&gt;();&lt;/span&gt;&lt;span class="pln"&gt;
   
   &lt;/span&gt;&lt;span class="com"&gt;// Print the area of the object.&lt;/span&gt;&lt;span class="pln"&gt;
   cout &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Total area: "&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Rect&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;getArea&lt;/span&gt;&lt;span class="pun"&gt;()&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; endl&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="com"&gt;// Print the total cost of painting&lt;/span&gt;&lt;span class="pln"&gt;
   cout &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Total paint cost: $"&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Rect&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;getCost&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;area&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; endl&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
When the above code is compiled and executed, it produces the following result:&lt;br /&gt;

&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="typ"&gt;Total&lt;/span&gt;&lt;span class="pln"&gt; area&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;35&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="typ"&gt;Total&lt;/span&gt;&lt;span class="pln"&gt; paint cost&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; $2450&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;h1&gt;
C++ Overloading (Operator and Function)&lt;/h1&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
C++ allows you to specify more than one definition for a &lt;b&gt;function&lt;/b&gt; name or an &lt;b&gt;operator&lt;/b&gt; in the same scope, which is called &lt;b&gt;function overloading&lt;/b&gt; and &lt;b&gt;operator overloading&lt;/b&gt; respectively.&lt;br /&gt;

An overloaded declaration is a declaration that had been declared 
with the same name as a previously declared declaration in the same 
scope, except that both declarations have different arguments and 
obviously different definition (implementation).&lt;br /&gt;

When you call an overloaded &lt;b&gt;function&lt;/b&gt; or &lt;b&gt;operator&lt;/b&gt;, the 
compiler determines the most appropriate definition to use by comparing 
the argument types you used to call the function or operator with the 
parameter types specified in the definitions. The process of selecting 
the most appropriate overloaded function or operator is called &lt;b&gt;overload resolution&lt;/b&gt;.&lt;br /&gt;

&lt;h2&gt;
Function overloading in C++:&lt;/h2&gt;
You can have multiple definitions for the same function name in the 
same scope. The definition of the function must differ from each other 
by the types and/or the number of arguments in the argument list. You 
can not overload function declarations that differ only by return type.&lt;br /&gt;

Following is the example where same function &lt;b&gt;print()&lt;/b&gt; is being used to print different data types:&lt;br /&gt;

&lt;span class="com"&gt;#include&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;using&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;namespace&lt;/span&gt;&lt;span class="pln"&gt; std&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
 
&lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; printData 
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; i&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
        cout &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Printing int: "&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; i &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; endl&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;

      &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt;  f&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
        cout &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Printing float: "&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; f &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; endl&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;

      &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;char&lt;/span&gt;&lt;span class="pun"&gt;*&lt;/span&gt;&lt;span class="pln"&gt; c&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
        cout &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Printing character: "&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; c &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; endl&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;span class="pln"&gt;

&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   printData pd&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
 
   &lt;/span&gt;&lt;span class="com"&gt;// Call print to print integer&lt;/span&gt;&lt;span class="pln"&gt;
   pd&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;5&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;// Call print to print float&lt;/span&gt;&lt;span class="pln"&gt;
   pd&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;500.263&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;// Call print to print character&lt;/span&gt;&lt;span class="pln"&gt;
   pd&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Hello C++"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
 
   &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;
When the above code is compiled and executed, it produces the following result:&lt;br /&gt;

&lt;span class="typ"&gt;Printing&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;5&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="typ"&gt;Printing&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;float&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;500.263&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="typ"&gt;Printing&lt;/span&gt;&lt;span class="pln"&gt; character&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Hello&lt;/span&gt;&lt;span class="pln"&gt; C&lt;/span&gt;&lt;span class="pun"&gt;++&lt;/span&gt;
&lt;h2&gt;
Operators overloading in C++:&lt;/h2&gt;
You can redefine or overload most of the built-in operators available
 in C++. Thus a programmer can use operators with user-defined types as 
well.&lt;br /&gt;

Overloaded operators are functions with special names the keyword 
operator followed by the symbol for the operator being defined. Like any
 other function, an overloaded operator has a return type and a 
parameter list.&lt;br /&gt;

&lt;span class="typ"&gt;Box&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;operator&lt;/span&gt;&lt;span class="pun"&gt;+(&lt;/span&gt;&lt;span class="kwd"&gt;const&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box&lt;/span&gt;&lt;span class="pun"&gt;&amp;amp;);&lt;/span&gt;
declares the addition operator that can be used to &lt;b&gt;add&lt;/b&gt; two Box
 objects and returns final Box object. Most overloaded operators may be 
defined as ordinary non-member functions or as class member functions. 
In case we define above function as non-member function of a class then 
we would have to pass two arguments for each operand as follows:&lt;br /&gt;

&lt;span class="typ"&gt;Box&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;operator&lt;/span&gt;&lt;span class="pun"&gt;+(&lt;/span&gt;&lt;span class="kwd"&gt;const&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box&lt;/span&gt;&lt;span class="pun"&gt;&amp;amp;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;const&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box&lt;/span&gt;&lt;span class="pun"&gt;&amp;amp;);&lt;/span&gt;
Following is the example to show the concept of operator over loading
 using a member function. Here an object is passed as an argument whose 
properties will be accessed using this object, the object which will 
call this operator can be accessed using &lt;b&gt;this&lt;/b&gt; operator as explained below:&lt;br /&gt;

&lt;span class="com"&gt;#include&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;using&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;namespace&lt;/span&gt;&lt;span class="pln"&gt; std&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

&lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;

      &lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; getVolume&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; length &lt;/span&gt;&lt;span class="pun"&gt;*&lt;/span&gt;&lt;span class="pln"&gt; breadth &lt;/span&gt;&lt;span class="pun"&gt;*&lt;/span&gt;&lt;span class="pln"&gt; height&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; setLength&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; len &lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
          length &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; len&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;

      &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; setBreadth&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; bre &lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
          breadth &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; bre&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;

      &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; setHeight&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; hei &lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
          height &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; hei&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="com"&gt;// Overload + operator to add two Box objects.&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;Box&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;operator&lt;/span&gt;&lt;span class="pun"&gt;+(&lt;/span&gt;&lt;span class="kwd"&gt;const&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box&lt;/span&gt;&lt;span class="pun"&gt;&amp;amp;&lt;/span&gt;&lt;span class="pln"&gt; b&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="typ"&gt;Box&lt;/span&gt;&lt;span class="pln"&gt; box&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
         box&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;length &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;this&lt;/span&gt;&lt;span class="pun"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="pln"&gt;length &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; b&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;length&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
         box&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;breadth &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;this&lt;/span&gt;&lt;span class="pun"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="pln"&gt;breadth &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; b&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;breadth&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
         box&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;height &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;this&lt;/span&gt;&lt;span class="pun"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="pln"&gt;height &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; b&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;height&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; box&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;private&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; length&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;      &lt;/span&gt;&lt;span class="com"&gt;// Length of a box&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; breadth&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;     &lt;/span&gt;&lt;span class="com"&gt;// Breadth of a box&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; height&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;      &lt;/span&gt;&lt;span class="com"&gt;// Height of a box&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="com"&gt;// Main function for the program&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;Box&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box1&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;                &lt;/span&gt;&lt;span class="com"&gt;// Declare Box1 of type Box&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;Box&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box2&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;                &lt;/span&gt;&lt;span class="com"&gt;// Declare Box2 of type Box&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;Box&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box3&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;                &lt;/span&gt;&lt;span class="com"&gt;// Declare Box3 of type Box&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; volume &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0.0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;     &lt;/span&gt;&lt;span class="com"&gt;// Store the volume of a box here&lt;/span&gt;&lt;span class="pln"&gt;
 
   &lt;/span&gt;&lt;span class="com"&gt;// box 1 specification&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;Box1&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;setLength&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;6.0&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt; 
   &lt;/span&gt;&lt;span class="typ"&gt;Box1&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;setBreadth&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;7.0&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt; 
   &lt;/span&gt;&lt;span class="typ"&gt;Box1&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;setHeight&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;5.0&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
 
   &lt;/span&gt;&lt;span class="com"&gt;// box 2 specification&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;Box2&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;setLength&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;12.0&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt; 
   &lt;/span&gt;&lt;span class="typ"&gt;Box2&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;setBreadth&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;13.0&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt; 
   &lt;/span&gt;&lt;span class="typ"&gt;Box2&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;setHeight&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;10.0&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
 
   &lt;/span&gt;&lt;span class="com"&gt;// volume of box 1&lt;/span&gt;&lt;span class="pln"&gt;
   volume &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box1&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;getVolume&lt;/span&gt;&lt;span class="pun"&gt;();&lt;/span&gt;&lt;span class="pln"&gt;
   cout &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Volume of Box1 : "&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; volume &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt;endl&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
 
   &lt;/span&gt;&lt;span class="com"&gt;// volume of box 2&lt;/span&gt;&lt;span class="pln"&gt;
   volume &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box2&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;getVolume&lt;/span&gt;&lt;span class="pun"&gt;();&lt;/span&gt;&lt;span class="pln"&gt;
   cout &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Volume of Box2 : "&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; volume &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt;endl&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="com"&gt;// Add two object as follows:&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;Box3&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box1&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box2&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="com"&gt;// volume of box 3&lt;/span&gt;&lt;span class="pln"&gt;
   volume &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box3&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;getVolume&lt;/span&gt;&lt;span class="pun"&gt;();&lt;/span&gt;&lt;span class="pln"&gt;
   cout &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Volume of Box3 : "&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; volume &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt;endl&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;
When the above code is compiled and executed, it produces the following result:&lt;br /&gt;

&lt;span class="typ"&gt;Volume&lt;/span&gt;&lt;span class="pln"&gt; of &lt;/span&gt;&lt;span class="typ"&gt;Box1&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;210&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="typ"&gt;Volume&lt;/span&gt;&lt;span class="pln"&gt; of &lt;/span&gt;&lt;span class="typ"&gt;Box2&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;1560&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="typ"&gt;Volume&lt;/span&gt;&lt;span class="pln"&gt; of &lt;/span&gt;&lt;span class="typ"&gt;Box3&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;5400&lt;/span&gt;
&lt;h2&gt;
Overloadable/Non-overloadableOperators:&lt;/h2&gt;
Following is the list of operators which can be overloaded:&lt;br /&gt;

&lt;table class="src"&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td width="16.6%"&gt;+&lt;/td&gt;&lt;td width="16.6%"&gt;-&lt;/td&gt;&lt;td width="16.6%"&gt;*&lt;/td&gt;&lt;td width="16.6%"&gt;/&lt;/td&gt;&lt;td width="16.6%"&gt;%&lt;/td&gt;&lt;td width="16.6%"&gt;^&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;amp;&lt;/td&gt;&lt;td&gt;|&lt;/td&gt;&lt;td&gt;~&lt;/td&gt;&lt;td&gt;!&lt;/td&gt;&lt;td&gt;,&lt;/td&gt;&lt;td&gt;=&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;lt;&lt;/td&gt;&lt;td&gt;&amp;gt;&lt;/td&gt;&lt;td&gt;&amp;lt;=&lt;/td&gt;&lt;td&gt;&amp;gt;=&lt;/td&gt;&lt;td&gt;++&lt;/td&gt;&lt;td&gt;--&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&amp;lt;&amp;lt;&lt;/td&gt;&lt;td&gt;&amp;gt;&amp;gt;&lt;/td&gt;&lt;td&gt;==&lt;/td&gt;&lt;td&gt;!=&lt;/td&gt;&lt;td&gt;&amp;amp;&amp;amp;&lt;/td&gt;&lt;td&gt;||&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;+=&lt;/td&gt;&lt;td&gt;-=&lt;/td&gt;&lt;td&gt;/=&lt;/td&gt;&lt;td&gt;%=&lt;/td&gt;&lt;td&gt;^=&lt;/td&gt;&lt;td&gt;&amp;amp;=&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;|=&lt;/td&gt;&lt;td&gt;*=&lt;/td&gt;&lt;td&gt;&amp;lt;&amp;lt;=&lt;/td&gt;&lt;td&gt;&amp;gt;&amp;gt;=&lt;/td&gt;&lt;td&gt;[]&lt;/td&gt;&lt;td&gt;()&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;-&amp;gt;&lt;/td&gt;&lt;td&gt;-&amp;gt;*&lt;/td&gt;&lt;td&gt;new&lt;/td&gt;&lt;td&gt;new []&lt;/td&gt;&lt;td&gt;delete&lt;/td&gt;&lt;td&gt;delete []&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Following is the list of operators, which can not be overloaded:&lt;br /&gt;
&lt;h1&gt;
Polymorphism in C++&lt;/h1&gt;
The word &lt;b&gt;polymorphism&lt;/b&gt; means having many forms. Typically, 
polymorphism occurs when there is a hierarchy of classes and they are 
related by inheritance.&lt;br /&gt;

C++ polymorphism means that a call to a member function will cause a 
different function to be executed depending on the type of object that 
invokes the function.&lt;br /&gt;

Consider the following example where a base class has been derived by other two classes:&lt;br /&gt;

&lt;pre class="prettyprint tryit prettyprinted" style="cursor: default;"&gt;&lt;span class="com"&gt;#include&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;span class="pln"&gt; 
&lt;/span&gt;&lt;span class="kwd"&gt;using&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;namespace&lt;/span&gt;&lt;span class="pln"&gt; std&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
 
&lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Shape&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;protected&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; width&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; height&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;Shape&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; a&lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; b&lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
         width &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; a&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
         height &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; b&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; area&lt;/span&gt;&lt;span class="pun"&gt;()&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
         cout &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Parent class area :"&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt;endl&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Rectangle&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Shape&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;Rectangle&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; a&lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; b&lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
        &lt;/span&gt;&lt;span class="typ"&gt;Shape&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;a&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; b&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt; 
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; area &lt;/span&gt;&lt;span class="pun"&gt;()&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt; 
         cout &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Rectangle class area :"&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt;endl&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;width &lt;/span&gt;&lt;span class="pun"&gt;*&lt;/span&gt;&lt;span class="pln"&gt; height&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt; 
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Triangle&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Shape&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;Triangle&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; a&lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; b&lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
        &lt;/span&gt;&lt;span class="typ"&gt;Shape&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;a&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; b&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt; 
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; area &lt;/span&gt;&lt;span class="pun"&gt;()&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt; 
         cout &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Rectangle class area :"&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt;endl&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;width &lt;/span&gt;&lt;span class="pun"&gt;*&lt;/span&gt;&lt;span class="pln"&gt; height &lt;/span&gt;&lt;span class="pun"&gt;/&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;2&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt; 
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="com"&gt;// Main function for the program&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;Shape&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;*&lt;/span&gt;&lt;span class="pln"&gt;shape&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;Rectangle&lt;/span&gt;&lt;span class="pln"&gt; rec&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;10&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="lit"&gt;7&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;Triangle&lt;/span&gt;&lt;span class="pln"&gt;  tri&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;10&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="lit"&gt;5&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="com"&gt;// store the address of Rectangle&lt;/span&gt;&lt;span class="pln"&gt;
   shape &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;amp;&lt;/span&gt;&lt;span class="pln"&gt;rec&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;// call rectangle area.&lt;/span&gt;&lt;span class="pln"&gt;
   shape&lt;/span&gt;&lt;span class="pun"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="pln"&gt;area&lt;/span&gt;&lt;span class="pun"&gt;();&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="com"&gt;// store the address of Triangle&lt;/span&gt;&lt;span class="pln"&gt;
   shape &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;amp;&lt;/span&gt;&lt;span class="pln"&gt;tri&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;// call triangle area.&lt;/span&gt;&lt;span class="pln"&gt;
   shape&lt;/span&gt;&lt;span class="pun"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="pln"&gt;area&lt;/span&gt;&lt;span class="pun"&gt;();&lt;/span&gt;&lt;span class="pln"&gt;
   
   &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
When the above code is compiled and executed, it produces the following result:&lt;br /&gt;

&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="typ"&gt;Parent&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; area
&lt;/span&gt;&lt;span class="typ"&gt;Parent&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; area&lt;/span&gt;&lt;/pre&gt;
The reason for the incorrect output is that the call of the function 
area() is being set once by the compiler as the version defined in the 
base class. This is called &lt;b&gt;static resolution&lt;/b&gt; of the function call, or &lt;b&gt;static linkage&lt;/b&gt; - the function call is fixed before the program is executed. This is also sometimes called &lt;b&gt;early binding&lt;/b&gt; because the area() function is set during the compilation of the program.&lt;br /&gt;

But now, let's make a slight modification in our program and precede 
the declaration of area() in the Shape class with the keyword &lt;b&gt;virtual&lt;/b&gt; so that it  looks like this:&lt;br /&gt;

&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Shape&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;protected&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; width&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; height&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;Shape&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; a&lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; b&lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
         width &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; a&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
         height &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; b&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;virtual&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; area&lt;/span&gt;&lt;span class="pun"&gt;()&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
         cout &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Parent class area :"&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt;endl&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;/pre&gt;
After this slight modification, when the previous example code is compiled and executed, it produces the following result:&lt;br /&gt;

&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="typ"&gt;Rectangle&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; area
&lt;/span&gt;&lt;span class="typ"&gt;Triangle&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; area&lt;/span&gt;&lt;/pre&gt;
This time, the compiler looks at the contents of the pointer instead 
of it's type. Hence, since addresses of objects of tri and rec classes 
are stored in *shape the respective area() function is called.&lt;br /&gt;

As you can see, each of the child classes has a separate implementation for the function area(). This is how &lt;b&gt;polymorphism&lt;/b&gt;
 is generally used. You have different classes with a function of the 
same name, and even the same parameters, but with different 
implementations.&lt;br /&gt;

&lt;h2&gt;
Virtual Function:&lt;/h2&gt;
A &lt;b&gt;virtual&lt;/b&gt; function is a function in a base class that is declared using the keyword &lt;b&gt;virtual&lt;/b&gt;.
 Defining in a base class a virtual function, with another version in a 
derived class, signals to the compiler that we don't want static linkage
 for this function.&lt;br /&gt;

What we do want is the selection of the function to be called at any 
given point in the program to be based on the kind of object for which 
it is called.  This sort of operation is referred to as &lt;b&gt;dynamic linkage&lt;/b&gt;, or &lt;b&gt;late binding&lt;/b&gt;.&lt;br /&gt;

&lt;h2&gt;
Pure Virtual Functions:&lt;/h2&gt;
It's possible that you'd want to include a virtual function in a base
 class so that it may be redefined in a derived class to suit the 
objects of that class, but that there is no meaningful definition you 
could give for the function in the base class.&lt;br /&gt;

We can change the virtual function area() in the base class to the following:&lt;br /&gt;

&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Shape&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;protected&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; width&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; height&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;Shape&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; a&lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; b&lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
         width &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; a&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
         height &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; b&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="com"&gt;// pure virtual function&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;virtual&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; area&lt;/span&gt;&lt;span class="pun"&gt;()&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;/pre&gt;
The = 0 tells the compiler that the function has no body  and above virtual function will be called &lt;b&gt;pure virtual function&lt;/b&gt;.&lt;br /&gt;
&lt;h1&gt;
Data Abstraction in C++&lt;/h1&gt;
&lt;hr /&gt;
Data abstraction refers to, providing only essential information to 
the outside world and hiding their background details, i.e., to 
represent the needed information in program without presenting the 
details.&lt;br /&gt;

Data abstraction is a programming (and design) technique that relies on the separation of interface and implementation.&lt;br /&gt;

Let's take one real life example of a TV, which you can turn on and 
off, change the channel, adjust the volume, and add external components 
such as speakers, VCRs, and DVD players, BUT you do not know its 
internal details, that is, you do not know how it receives signals over 
the air or through a cable, how it translates them, and  finally 
displays them on the screen.&lt;br /&gt;

Thus, we can say a television clearly separates its internal 
implementation from its external interface and you can play with its 
interfaces like the power button, channel changer, and volume control 
without having zero knowledge of its internals.&lt;br /&gt;

Now, if we talk in terms of C++ Programming, C++ classes provides great level of &lt;b&gt;data abstraction&lt;/b&gt;.
 They provide sufficient public methods to the outside world to play 
with the functionality of the object and to manipulate object data, 
i.e., state without actually knowing how class has been implemented 
internally.&lt;br /&gt;

For example, your program can make a call to the &lt;b&gt;sort()&lt;/b&gt; 
function without knowing what algorithm the function actually uses to 
sort the given values. In fact, the underlying implementation of the 
sorting functionality could change between releases of the library, and 
as long as the interface stays the same, your function call will still 
work.&lt;br /&gt;

In C++, we use &lt;b&gt;classes&lt;/b&gt; to define our own abstract data types (ADT). You can use the &lt;b&gt;cout&lt;/b&gt; object of class &lt;b&gt;ostream&lt;/b&gt; to stream data to standard output like this:&lt;br /&gt;

&lt;pre class="prettyprint tryit prettyprinted" style="cursor: default;"&gt;&lt;span class="com"&gt;#include&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;using&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;namespace&lt;/span&gt;&lt;span class="pln"&gt; std&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   cout &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Hello C++"&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt;endl&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
Here, you don't need to understand how &lt;b&gt;cout&lt;/b&gt; displays the text 
on the user's screen. You need to only know the public interface and the
 underlying implementation of cout is free to change.&lt;br /&gt;

&lt;h2&gt;
Access Labels Enforce Abstraction:&lt;/h2&gt;
In C++, we use access labels to define the abstract interface to the class. A class may contain zero or more access labels:&lt;br /&gt;

&lt;ul class="list"&gt;
&lt;li&gt;Members defined with a public label are accessible to all parts 
of the program. The data-abstraction view of a type is defined by its 
public members.&lt;/li&gt;
&lt;li&gt;Members defined with a private label are not accessible to code 
that uses the class. The private sections hide the implementation from 
code that uses the type.&lt;/li&gt;
&lt;/ul&gt;
There are no restrictions on how often an access label may appear. 
Each access label specifies the access level of the succeeding member 
definitions. The specified access level remains in effect until the next
 access label is encountered or the closing right brace of the class 
body is seen.&lt;br /&gt;

&lt;h2&gt;
Benefits of Data Abstraction:&lt;/h2&gt;
Data abstraction provides two important advantages:&lt;br /&gt;

&lt;ul class="list"&gt;
&lt;li&gt;Class internals are protected from inadvertent user-level errors, which might corrupt the state of the object.&lt;/li&gt;
&lt;li&gt;The class implementation may evolve over time in response to 
changing requirements or bug reports without requiring change in 
user-level code.&lt;/li&gt;
&lt;/ul&gt;
By defining data members only in the private section of the class, 
the class author is free to make changes in the data. If the 
implementation changes, only the class code needs to be examined to see 
what affect the change may have. If data are public, then any function 
that directly accesses the data members of the old representation might 
be broken.&lt;br /&gt;

&lt;h2&gt;
Data Abstraction Example:&lt;/h2&gt;
Any C++ program where you implement a class with public and private 
members is an example of data abstraction. Consider the following 
example:&lt;br /&gt;

&lt;pre class="prettyprint tryit prettyprinted" style="cursor: default;"&gt;&lt;span class="com"&gt;#include&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;using&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;namespace&lt;/span&gt;&lt;span class="pln"&gt; std&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

&lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Adder&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="com"&gt;// constructor&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;Adder&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; i &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
        total &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; i&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="com"&gt;// interface to outside world&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; addNum&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; number&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
          total &lt;/span&gt;&lt;span class="pun"&gt;+=&lt;/span&gt;&lt;span class="pln"&gt; number&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="com"&gt;// interface to outside world&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; getTotal&lt;/span&gt;&lt;span class="pun"&gt;()&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
          &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; total&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;private&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="com"&gt;// hidden data from outside world&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; total&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;Adder&lt;/span&gt;&lt;span class="pln"&gt; a&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   
   a&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;addNum&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;10&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
   a&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;addNum&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;20&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
   a&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;addNum&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;30&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;

   cout &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Total "&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; a&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;getTotal&lt;/span&gt;&lt;span class="pun"&gt;()&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt;endl&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
When the above code is compiled and executed, it produces the following result:&lt;br /&gt;

&lt;pre class="result"&gt;Total 60
&lt;/pre&gt;
Above class adds numbers together, and returns the sum. The public members &lt;b&gt;addNum&lt;/b&gt; and &lt;b&gt;getTotal&lt;/b&gt; are the interfaces to the outside world and a user needs to know them to use the class. The private member &lt;b&gt;total&lt;/b&gt; is something that the user doesn't need to know about, but is needed for the class to operate properly.&lt;br /&gt;

&lt;h2&gt;
Designing Strategy:&lt;/h2&gt;
Abstraction separates code into interface and implementation. So 
while designing your component, you must keep interface independent of 
the implementation so that if you change underlying implementation then 
interface would remain intact.&lt;br /&gt;

In this case whatever programs are using these interfaces, they would
 not be impacted and would just need a recompilation with the latest 
implementation.&lt;br /&gt;
&lt;h1&gt;
Interfaces in C++ (Abstract Classes)&lt;/h1&gt;
An interface describes the behavior or capabilities of a C++ class 
without committing to a particular implementation of that class.&lt;br /&gt;

The C++ interfaces are implemented using &lt;b&gt;abstract classes&lt;/b&gt; and 
these abstract classes should not be confused with data abstraction 
which is a concept of keeping implementation details separate from 
associated data.&lt;br /&gt;

A class is made abstract by declaring at least one of its functions as &lt;b&gt;pure virtual&lt;/b&gt; function. A pure virtual function is specified by placing "= 0" in its declaration as follows:&lt;br /&gt;

&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Box&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="com"&gt;// pure virtaul function&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;virtual&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; getVolume&lt;/span&gt;&lt;span class="pun"&gt;()&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;private&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; length&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;      &lt;/span&gt;&lt;span class="com"&gt;// Length of a box&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; breadth&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;     &lt;/span&gt;&lt;span class="com"&gt;// Breadth of a box&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; height&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;      &lt;/span&gt;&lt;span class="com"&gt;// Height of a box&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;/pre&gt;
The purpose of an &lt;b&gt;abstract class&lt;/b&gt; (often referred to as an ABC)
 is to provide an appropriate base class from which other classes can 
inherit. Abstract classes cannot be used to instantiate objects and 
serves only as an &lt;b&gt;interface&lt;/b&gt;. Attempting to instantiate an object of an abstract class causes a compilation error.&lt;br /&gt;

Thus, if a subclass of an ABC needs to be instantiated, it has to 
implement each of the virtual functions, which means that it supports 
the interface declared by the ABC.  Failure to override a pure virtual 
function in a derived class, then attempting to instantiate objects of 
that class, is a compilation error.&lt;br /&gt;

Classes that can be used to instantiate objects are called &lt;b&gt;concrete classes&lt;/b&gt;.&lt;br /&gt;

&lt;h2&gt;
Abstract Class Example:&lt;/h2&gt;
Consider the following example where parent class provides an interface to the base class  to implement a function called &lt;b&gt;getArea()&lt;/b&gt;:&lt;br /&gt;

&lt;pre class="prettyprint tryit prettyprinted"&gt;&lt;span class="com"&gt;#include&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;span class="pln"&gt;
 
&lt;/span&gt;&lt;span class="kwd"&gt;using&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;namespace&lt;/span&gt;&lt;span class="pln"&gt; std&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
 
&lt;/span&gt;&lt;span class="com"&gt;// Base class&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Shape&lt;/span&gt;&lt;span class="pln"&gt; 
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;// pure virtual function providing interface framework.&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;virtual&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; getArea&lt;/span&gt;&lt;span class="pun"&gt;()&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; setWidth&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; w&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
      width &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; w&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; setHeight&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; h&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
      height &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; h&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;protected&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; width&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; height&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;span class="pln"&gt;
 
&lt;/span&gt;&lt;span class="com"&gt;// Derived classes&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Rectangle&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Shape&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; getArea&lt;/span&gt;&lt;span class="pun"&gt;()&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt; 
      &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;width &lt;/span&gt;&lt;span class="pun"&gt;*&lt;/span&gt;&lt;span class="pln"&gt; height&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt; 
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Triangle&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Shape&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; getArea&lt;/span&gt;&lt;span class="pun"&gt;()&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt; 
      &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;width &lt;/span&gt;&lt;span class="pun"&gt;*&lt;/span&gt;&lt;span class="pln"&gt; height&lt;/span&gt;&lt;span class="pun"&gt;)/&lt;/span&gt;&lt;span class="lit"&gt;2&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt; 
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;span class="pln"&gt;
 
&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;Rectangle&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Rect&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;Triangle&lt;/span&gt;&lt;span class="pln"&gt;  &lt;/span&gt;&lt;span class="typ"&gt;Tri&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
 
   &lt;/span&gt;&lt;span class="typ"&gt;Rect&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;setWidth&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;5&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;Rect&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;setHeight&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;7&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;// Print the area of the object.&lt;/span&gt;&lt;span class="pln"&gt;
   cout &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Total Rectangle area: "&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Rect&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;getArea&lt;/span&gt;&lt;span class="pun"&gt;()&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; endl&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="typ"&gt;Tri&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;setWidth&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;5&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;Tri&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;setHeight&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;7&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;// Print the area of the object.&lt;/span&gt;&lt;span class="pln"&gt;
   cout &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Total Triangle area: "&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Tri&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;getArea&lt;/span&gt;&lt;span class="pun"&gt;()&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; endl&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt; 

   &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
When the above code is compiled and executed, it produces the following result:&lt;br /&gt;

&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="typ"&gt;Total&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Rectangle&lt;/span&gt;&lt;span class="pln"&gt; area&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;35&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="typ"&gt;Total&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Triangle&lt;/span&gt;&lt;span class="pln"&gt; area&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;17&lt;/span&gt;&lt;/pre&gt;
You can see how an abstract class defined an interface in terms of 
getArea() and two other classes implemented same function but with 
different algorithm to calculate the area specific to the shape.&lt;br /&gt;

&lt;h2&gt;
Designing Strategy:&lt;/h2&gt;
An object-oriented system might use an abstract base class to provide
 a common and standardized interface appropriate for all the external 
applications. Then, through inheritance from that abstract base class, 
derived classes are formed that all operate similarly.&lt;br /&gt;

The capabilities (i.e., the public functions) offered by the external
 applications are provided as pure virtual functions in the abstract 
base class. The implementations of these pure virtual functions are 
provided in the derived classes that correspond to the specific types of
 the application.&lt;br /&gt;

This architecture also allows new applications to be added to a system easily, even after the system has been defined.&lt;br /&gt;

&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;h1&gt;
&amp;nbsp;&lt;/h1&gt;
&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title> Hacking Tools</title><link>http://hamidkalu.blogspot.com/2013/09/hacking-tools.html</link><category>Hacking Tools</category><author>noreply@blogger.com (Hamid)</author><pubDate>Sat, 28 Sep 2013 16:01:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7786780271346850842.post-5963908113092750673</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;br /&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;span style="color: #45818e;"&gt;&lt;span style="background-color: white;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;b&gt;winAUTOPWN v3.0 Released - System vulnerability exploitation Framework&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="background-color: white;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="color: #0c343d;"&gt;&lt;b&gt;&lt;span style="font-size: xx-small;"&gt;&lt;br style="font-family: georgia,serif;" /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style="text-align: left;"&gt;
&lt;span style="color: blue;"&gt;&lt;span style="background-color: white;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="color: #0c343d;"&gt;&lt;b&gt;&lt;span style="font-size: xx-small;"&gt;&lt;span style="font-family: georgia,serif;"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="color: #45818e; font-size: small;"&gt;&lt;span style="font-family: georgia,serif;"&gt;&lt;span style="font-weight: normal;"&gt;WINAUTOPWN ACTIVE SYSTEMS TRANSGRESSOR GUI [ C4 - WAST ] is a Systems 
and Network Exploitation Framework built on the famous winAUTOPWN as a 
backend.&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;h3 style="text-align: left;"&gt;
&lt;span style="color: #45818e; font-size: small;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="background-color: white;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-family: georgia,serif;"&gt;C4 - WAST gives users the freedom to select individual exploits and use them.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;h3 style="text-align: left;"&gt;
&lt;span style="color: #45818e; font-size: small;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="background-color: white;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;span style="font-family: georgia,serif;"&gt;
BSDAUTOPWN has been compiled, like always for various flavours and has 
been upgraded to version 1.8 alongwith all applicable exploits&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;h3 style="text-align: left;"&gt;
&lt;span style="color: #45818e; font-size: small;"&gt;&lt;span style="background-color: white;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-family: georgia,serif;"&gt;
&lt;span style="font-weight: normal;"&gt;WINAUTOPWN requires 
PERL,PHP,PYTHON,RUBY and its dependencies alongwith a few others' too 
for smooth working of exploits included in it.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;h3 style="text-align: left;"&gt;
&lt;span style="background-color: white;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;b&gt;&lt;span style="font-size: xx-small;"&gt;&lt;span style="font-family: georgia,serif;"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://winautopwn.co.nr/" target="_blank"&gt;&lt;img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMQ2Oo87N3gROSFBK6y-Zjr8bBRKaAN7zSaumai6PXctp3ceCi9mwd7283N7fr4VHYU7H0z4c9mhg3bhEyu00A8FoM0doG8wI7vDLlrqzWgzyidqrTfHJuVa8cKG1OrjbxgXrhU04Gkikx/s1600/DownloadButton1.png" title="" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;span style="color: blue;"&gt;&lt;span style="background-color: white;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="color: #0c343d;"&gt;&lt;b&gt;&lt;span style="font-size: xx-small;"&gt;&lt;span style="font-family: georgia,serif;"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;span style="background-color: black; color: lime; font-family: georgia,serif; font-size: xx-small;"&gt;&lt;b&gt;&lt;span style="background-color: white;"&gt;&lt;span style="color: black;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;span style="font-size: medium;"&gt;&lt;span style="color: #45818e;"&gt;&lt;span style="background-color: white;"&gt;&lt;span style="font-family: georgia,serif;"&gt;&lt;b&gt;ARPwner – ARP &amp;amp; DNS Poisoning Attack Tool&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style="text-align: left;"&gt;
&lt;span style="color: #45818e; font-size: small;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="background-color: white;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="font-family: georgia,serif;"&gt;&lt;span style="background-color: black; font-family: georgia,serif;"&gt;&lt;span style="background-color: white;"&gt;ARPwner is a tool to do ARP poisoning and DNS poisoning attacks, with a simple GUI and &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: black; font-family: georgia,serif;"&gt;&lt;span style="background-color: white;"&gt;a plugin system to do filtering of the information gathered,&amp;nbsp;also has a implementation of SSLstrip and is coded in python.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;h3 style="text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;
&lt;span style="color: #45818e;"&gt;&lt;span style="background-color: white;"&gt;&lt;span style="font-family: georgia,serif;"&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;span style="color: blue;"&gt;&lt;span style="background-color: white;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="color: #0c343d;"&gt;&lt;b&gt;&lt;span style="font-size: xx-small;"&gt;&lt;span style="font-family: georgia,serif;"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;span style="background-color: black; color: lime; font-family: georgia,serif; font-size: xx-small;"&gt;&lt;b&gt;&lt;span style="background-color: white;"&gt;&lt;span style="color: black;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="background-color: white;"&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="background-color: black; color: lime; font-family: georgia,serif; font-size: xx-small;"&gt;&lt;span style="background-color: white;"&gt;&lt;span style="color: black;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="background-color: white;"&gt;&lt;span style="color: black;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span id="goog_733317331"&gt;&lt;/span&gt;&lt;span id="goog_733317332"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="background-color: white;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="color: #0c343d;"&gt;&lt;b&gt;&lt;span style="font-size: xx-small;"&gt;&lt;span style="font-family: georgia,serif;"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://github.com/ntrippar/ARPwner/archive/master.zip" target="_blank"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjt62kcMTVj_LlrSZExT40nhxjrz5BsJ6TCPvMELYqjAz0ZwyvW1M6tEhdG7wzJ59DmgE3gKZLbhSQiCclgYlekAhCwM6KMZy52aqju4lJwybob4IrZijNjthQJtdAHsT4JSyayrsj9Wz_h/s1600/DownloadButton1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;span style="color: blue;"&gt;&lt;span style="background-color: white;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="color: #0c343d;"&gt;&lt;b&gt;&lt;span style="font-size: xx-small;"&gt;&lt;span style="font-family: georgia,serif;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="background-color: white;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="color: #0c343d;"&gt;&lt;b&gt;&lt;span style="font-size: xx-small;"&gt;&lt;span style="font-family: georgia,serif;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;span style="font-size: xx-small;"&gt;
&lt;span style="font-size: medium;"&gt;&lt;span style="color: #45818e;"&gt;&lt;span style="background-color: white;"&gt;&lt;b style="font-family: georgia,serif;"&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: medium;"&gt;&lt;span style="color: #45818e;"&gt;&lt;span style="background-color: white;"&gt;&lt;b style="font-family: georgia,serif;"&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #45818e;"&gt;&lt;span style="background-color: white;"&gt;&lt;b style="font-family: georgia,serif;"&gt;The Mole: Automatic SQL Injection Exploitation Tool &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;span style="color: blue;"&gt;&lt;span style="background-color: white;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="color: #0c343d;"&gt;&lt;b&gt;&lt;span style="font-size: xx-small;"&gt;&lt;span style="font-family: georgia,serif;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;span style="color: blue;"&gt;&lt;span style="background-color: white;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="color: #0c343d;"&gt;&lt;b&gt;&lt;span style="font-size: xx-small;"&gt;&lt;span style="font-family: georgia,serif;"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;span style="font-size: xx-small;"&gt;
&lt;br style="font-family: georgia,serif;" /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;div style="color: white; display: block; margin-left: auto; margin-right: auto; text-align: center;"&gt;
&lt;span style="font-size: xx-small;"&gt;&lt;img border="0" height="220" src="http://www.hackersonlineclub.com/_/rsrc/1331478587882/hacking-tools/new_mole.png.jpg?height=221&amp;amp;width=400" width="400" /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h3 style="text-align: left;"&gt;
&lt;span style="font-size: xx-small;"&gt;
&lt;span style="color: #45818e; font-size: small;"&gt;&lt;span style="font-family: georgia,serif;"&gt;Mole is an automatic SQL 
Injection exploitation tool. Only by providing a vulnerable URL and a 
valid string on the site it can detect the injection and exploit it, 
either by using the union technique or a Boolean query based technique.&lt;/span&gt; &lt;span style="font-family: georgia,serif;"&gt;The Mole uses a command based interface, allowing the user to indicate the action he wants to perform easily.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://themole.nasel.com.ar/?q=downloads" target="_blank"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjt62kcMTVj_LlrSZExT40nhxjrz5BsJ6TCPvMELYqjAz0ZwyvW1M6tEhdG7wzJ59DmgE3gKZLbhSQiCclgYlekAhCwM6KMZy52aqju4lJwybob4IrZijNjthQJtdAHsT4JSyayrsj9Wz_h/s1600/DownloadButton1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style="font-size: xx-small;"&gt;&lt;span style="font-family: georgia,serif;"&gt;&lt;span style="font-family: georgia,serif;"&gt;&lt;span style="font-size: xx-small;"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;span style="font-size: xx-small;"&gt;&lt;span style="font-family: georgia,serif;"&gt;&lt;span style="font-family: georgia,serif;"&gt;&lt;span style="font-size: xx-small;"&gt;
&lt;/span&gt;&lt;span style="font-size: medium;"&gt;&lt;span style="color: #134f5c;"&gt;&lt;span style="background-color: white;"&gt;&lt;b&gt;&lt;span style="font-family: georgia,serif;"&gt;Havij v1.15 Advanced SQL Injection&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h3 style="text-align: left;"&gt;
&lt;span style="font-size: xx-small;"&gt;&lt;span style="font-family: georgia,serif;"&gt;&lt;span style="font-family: georgia,serif;"&gt;&lt;span style="color: #45818e; font-size: x-small;"&gt;&amp;nbsp;&lt;span style="font-size: small;"&gt;Havij is an automated SQL Injection tool that helps penetration testers 
to find and exploit SQL Injection vulnerabilities on a web page.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="font-family: georgia,serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;div style="display: block; text-align: left;"&gt;
&lt;span style="font-size: xx-small;"&gt;&lt;b&gt;&lt;img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNq-gz6zaiLeFa63y1Qgj__dFU-mxjVhuKQiGfJrewvHl2w-iAByLufUNkaDVt-CBLpfd7xateFHwftMIJRkmNn5_nons8bXbLppErXv7ZkDEtrfce71SpV2nr5jMsjq3tOsjZQc8Wiz9K/s400/havij.png" style="display: block; margin-left: auto; margin-right: auto; text-align: center;" width="364" /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;span style="font-size: xx-small;"&gt;&lt;a href="http://itsecteam.com/files/havij/Havij1.15Free.rar" target="_blank"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoCF-GwqR9iDavhhh0x2WS9s39g-RF5vZTPCKtSIzONCNQTBEIaWiNYVjCIVMxa6YkmwcwjXEQ3K6BeqAYdQyp0e4GQyOHp-O01u3elvFJg7W0DCMwPl6SpvIyJy6XeTYJhx740bLk2P-P/s1600/DownloadButton1.png" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-size: xx-small;"&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;span style="color: blue;"&gt;&lt;span style="background-color: white;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="color: #0c343d;"&gt;&lt;b&gt;&lt;span style="font-size: xx-small;"&gt;&lt;span style="font-family: georgia,serif;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;div style="text-align: left;"&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;span style="font-size: medium;"&gt;&lt;span style="color: #134f5c;"&gt;&lt;span style="background-color: white;"&gt;&lt;span style="font-family: georgia,serif;"&gt;&lt;b&gt;Sqlninja 0.2.6&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;span style="font-size: xx-small;"&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style="display: block; text-align: left;"&gt;
&lt;span style="font-size: xx-small;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgj4YAhte2qgwzTPP6aWoy5uriCwTOQkKfMJi3HccVbVySjpEauzOi9-USyV_t03iYJD_BdKtMuF_IBozU616gWp5IdXdSnK4Ave0lP25DSE85YB9IVJ-3O9vUbJ5Qncb01rprBcqmJ3f2d/s320/Untitled.png" style="display: block; margin-left: auto; margin-right: auto; text-align: center;" /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="display: block; text-align: left;"&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #45818e; font-size: small;"&gt;&lt;b&gt;Features:&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #45818e; font-size: small;"&gt;
&amp;nbsp;&amp;gt;&amp;gt; Fingerprint of the remote SQL Server (version, user performing
 the queries, user privileges, xp_cmdshell availability, DB 
authentication mode)&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #45818e; font-size: small;"&gt;
&amp;gt;&amp;gt;&amp;nbsp; Bruteforce of 'sa' password (in 2 flavors: dictionary-based and incremental).&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #45818e; font-size: small;"&gt;
&amp;gt;&amp;gt; Creation of a custom xp_cmdshell if the original one has been removed&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #45818e; font-size: small;"&gt;
&amp;gt;&amp;gt; Upload of netcat (or any other executable) using only normal HTTP requests (no FTP/TFTP needed).&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #45818e; font-size: small;"&gt;
&amp;gt;&amp;gt; TCP/UDP portscan from the target SQL Server to the attacking machine, in order &lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #45818e; font-size: small;"&gt;
to find a port that is allowed by the firewall of the target network &lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #45818e; font-size: small;"&gt;
and use it for a reverse shell.&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #45818e; font-size: small;"&gt;
&amp;gt;&amp;gt; Direct and reverse bindshell, both TCP and UDP&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #45818e; font-size: small;"&gt;
&amp;gt;&amp;gt; ICMP-tunneled shell, when no TCP/UDP ports are available for a direct/reverse &lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #45818e; font-size: small;"&gt;
shell but the DB can ping your box.&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #45818e; font-size: small;"&gt;&lt;span style="font-family: georgia,serif;"&gt;&amp;gt;&amp;gt;&lt;/span&gt;
 DNS-tunneled pseudo-shell, when no TCP/UDP ports are available for&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #45818e; font-size: small;"&gt;
&amp;nbsp;a direct/reverse shell, but the DB server can resolve external hostnames&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #45818e; font-size: small;"&gt;
&amp;nbsp;(check the documentation for details about how this works).&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #45818e; font-size: small;"&gt;&lt;span style="font-family: georgia,serif;"&gt;&amp;gt;&amp;gt;&lt;/span&gt;
 Evasion techniques to confuse a few IDS/IPS/WAF.&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #45818e; font-size: small;"&gt;
&amp;gt;&amp;gt; Integration with Metasploit3, to obtain a graphical access to the remote DB&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="color: #45818e; font-size: small;"&gt;
&amp;nbsp;server through a VNC server injection.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;span style="font-size: xx-small;"&gt;&lt;a href="http://sqlninja.sourceforge.net/download.html" target="_blank"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoCF-GwqR9iDavhhh0x2WS9s39g-RF5vZTPCKtSIzONCNQTBEIaWiNYVjCIVMxa6YkmwcwjXEQ3K6BeqAYdQyp0e4GQyOHp-O01u3elvFJg7W0DCMwPl6SpvIyJy6XeTYJhx740bLk2P-P/s1600/DownloadButton1.png" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-size: xx-small;"&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h2 style="text-align: left;"&gt;
&lt;span style="color: blue;"&gt;&lt;span style="background-color: white;"&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;span style="color: #0c343d;"&gt;&lt;b&gt;&lt;span style="font-size: xx-small;"&gt;&lt;span style="font-family: georgia,serif;"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;span style="background-color: black; color: lime; font-family: georgia,serif; font-size: xx-small;"&gt;&lt;b&gt;&lt;span style="background-color: white;"&gt;&lt;span style="color: black;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="background-color: black; color: lime; font-family: georgia,serif; font-size: xx-small;"&gt;&lt;b&gt;&lt;span style="background-color: white;"&gt;&lt;span style="color: black;"&gt;&lt;span id="goog_733317329"&gt;&lt;/span&gt;&lt;span id="goog_733317330"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMQ2Oo87N3gROSFBK6y-Zjr8bBRKaAN7zSaumai6PXctp3ceCi9mwd7283N7fr4VHYU7H0z4c9mhg3bhEyu00A8FoM0doG8wI7vDLlrqzWgzyidqrTfHJuVa8cKG1OrjbxgXrhU04Gkikx/s72-c/DownloadButton1.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><enclosure length="-1" type="application/zip" url="https://github.com/ntrippar/ARPwner/archive/master.zip"/><itunes:explicit>no</itunes:explicit><itunes:subtitle>winAUTOPWN v3.0 Released - System vulnerability exploitation Framework WINAUTOPWN ACTIVE SYSTEMS TRANSGRESSOR GUI [ C4 - WAST ] is a Systems and Network Exploitation Framework built on the famous winAUTOPWN as a backend.&amp;nbsp; C4 - WAST gives users the freedom to select individual exploits and use them. BSDAUTOPWN has been compiled, like always for various flavours and has been upgraded to version 1.8 alongwith all applicable exploits WINAUTOPWN requires PERL,PHP,PYTHON,RUBY and its dependencies alongwith a few others' too for smooth working of exploits included in it. ARPwner – ARP &amp;amp; DNS Poisoning Attack Tool ARPwner is a tool to do ARP poisoning and DNS poisoning attacks, with a simple GUI and a plugin system to do filtering of the information gathered,&amp;nbsp;also has a implementation of SSLstrip and is coded in python. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;The Mole: Automatic SQL Injection Exploitation Tool Mole is an automatic SQL Injection exploitation tool. Only by providing a vulnerable URL and a valid string on the site it can detect the injection and exploit it, either by using the union technique or a Boolean query based technique. The Mole uses a command based interface, allowing the user to indicate the action he wants to perform easily.&amp;nbsp; Havij v1.15 Advanced SQL Injection &amp;nbsp;Havij is an automated SQL Injection tool that helps penetration testers to find and exploit SQL Injection vulnerabilities on a web page. Sqlninja 0.2.6 Features: &amp;nbsp;&amp;gt;&amp;gt; Fingerprint of the remote SQL Server (version, user performing the queries, user privileges, xp_cmdshell availability, DB authentication mode) &amp;gt;&amp;gt;&amp;nbsp; Bruteforce of 'sa' password (in 2 flavors: dictionary-based and incremental). &amp;gt;&amp;gt; Creation of a custom xp_cmdshell if the original one has been removed &amp;gt;&amp;gt; Upload of netcat (or any other executable) using only normal HTTP requests (no FTP/TFTP needed). &amp;gt;&amp;gt; TCP/UDP portscan from the target SQL Server to the attacking machine, in order to find a port that is allowed by the firewall of the target network and use it for a reverse shell. &amp;gt;&amp;gt; Direct and reverse bindshell, both TCP and UDP &amp;gt;&amp;gt; ICMP-tunneled shell, when no TCP/UDP ports are available for a direct/reverse shell but the DB can ping your box. &amp;gt;&amp;gt; DNS-tunneled pseudo-shell, when no TCP/UDP ports are available for &amp;nbsp;a direct/reverse shell, but the DB server can resolve external hostnames &amp;nbsp;(check the documentation for details about how this works). &amp;gt;&amp;gt; Evasion techniques to confuse a few IDS/IPS/WAF. &amp;gt;&amp;gt; Integration with Metasploit3, to obtain a graphical access to the remote DB &amp;nbsp;server through a VNC server injection.</itunes:subtitle><itunes:author>noreply@blogger.com (Hamid)</itunes:author><itunes:summary>winAUTOPWN v3.0 Released - System vulnerability exploitation Framework WINAUTOPWN ACTIVE SYSTEMS TRANSGRESSOR GUI [ C4 - WAST ] is a Systems and Network Exploitation Framework built on the famous winAUTOPWN as a backend.&amp;nbsp; C4 - WAST gives users the freedom to select individual exploits and use them. BSDAUTOPWN has been compiled, like always for various flavours and has been upgraded to version 1.8 alongwith all applicable exploits WINAUTOPWN requires PERL,PHP,PYTHON,RUBY and its dependencies alongwith a few others' too for smooth working of exploits included in it. ARPwner – ARP &amp;amp; DNS Poisoning Attack Tool ARPwner is a tool to do ARP poisoning and DNS poisoning attacks, with a simple GUI and a plugin system to do filtering of the information gathered,&amp;nbsp;also has a implementation of SSLstrip and is coded in python. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;The Mole: Automatic SQL Injection Exploitation Tool Mole is an automatic SQL Injection exploitation tool. Only by providing a vulnerable URL and a valid string on the site it can detect the injection and exploit it, either by using the union technique or a Boolean query based technique. The Mole uses a command based interface, allowing the user to indicate the action he wants to perform easily.&amp;nbsp; Havij v1.15 Advanced SQL Injection &amp;nbsp;Havij is an automated SQL Injection tool that helps penetration testers to find and exploit SQL Injection vulnerabilities on a web page. Sqlninja 0.2.6 Features: &amp;nbsp;&amp;gt;&amp;gt; Fingerprint of the remote SQL Server (version, user performing the queries, user privileges, xp_cmdshell availability, DB authentication mode) &amp;gt;&amp;gt;&amp;nbsp; Bruteforce of 'sa' password (in 2 flavors: dictionary-based and incremental). &amp;gt;&amp;gt; Creation of a custom xp_cmdshell if the original one has been removed &amp;gt;&amp;gt; Upload of netcat (or any other executable) using only normal HTTP requests (no FTP/TFTP needed). &amp;gt;&amp;gt; TCP/UDP portscan from the target SQL Server to the attacking machine, in order to find a port that is allowed by the firewall of the target network and use it for a reverse shell. &amp;gt;&amp;gt; Direct and reverse bindshell, both TCP and UDP &amp;gt;&amp;gt; ICMP-tunneled shell, when no TCP/UDP ports are available for a direct/reverse shell but the DB can ping your box. &amp;gt;&amp;gt; DNS-tunneled pseudo-shell, when no TCP/UDP ports are available for &amp;nbsp;a direct/reverse shell, but the DB server can resolve external hostnames &amp;nbsp;(check the documentation for details about how this works). &amp;gt;&amp;gt; Evasion techniques to confuse a few IDS/IPS/WAF. &amp;gt;&amp;gt; Integration with Metasploit3, to obtain a graphical access to the remote DB &amp;nbsp;server through a VNC server injection.</itunes:summary><itunes:keywords>Hacking Tools</itunes:keywords></item><item><title>Facebook Security </title><link>http://hamidkalu.blogspot.com/2013/09/facebook-security.html</link><category>facebook security</category><author>noreply@blogger.com (Hamid)</author><pubDate>Thu, 26 Sep 2013 17:42:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7786780271346850842.post-3631901806893186844</guid><description>




&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;h3 class="post-title entry-title" itemprop="name"&gt;
&lt;/h3&gt;


&lt;div class="post-header"&gt;
&lt;/div&gt;
&lt;div dir="ltr" style="text-align: left;"&gt;
&lt;h1&gt;
How To Keep Facebook Account 100 % Safe From Hackers:&lt;/h1&gt;
&lt;h1&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKVPf8ApN0DTqajU4duYBYILMER_TIW4kd2PyfcTBxcxsacjw0W89M7DzBjp4bXWBzCyUiSPuc5NgnitfVp1sVOGHxHoUvF02-H0JyvlWwKkuFrUDGY4qARczuKxw_avGLT2vs4qmrI9M4/s1600/How-To-Protect-Your-New-Facebook-Account-1.jpg" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="265" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKVPf8ApN0DTqajU4duYBYILMER_TIW4kd2PyfcTBxcxsacjw0W89M7DzBjp4bXWBzCyUiSPuc5NgnitfVp1sVOGHxHoUvF02-H0JyvlWwKkuFrUDGY4qARczuKxw_avGLT2vs4qmrI9M4/s400/How-To-Protect-Your-New-Facebook-Account-1.jpg" width="400" /&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="font-weight: normal;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;As far as Social Media is concerned Facebook is the best media to connect with people.
We all are having facebook account,But,is your account safe from hackers ?
&lt;br /&gt;The best answer is NO !You might be thinking that,how you can say 
this so confidently.Okk dear ! But I have so many proofs for my 
statement.&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-size: small;"&gt;
&lt;/span&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;But how you can say that your account is safe from hacker 
?&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-size: small;"&gt;
&lt;/span&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;Simple answer of above question can be found in following discussion !!&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-size: small;"&gt;
&lt;/span&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;After reading entire post you can learn "Techniques Used By Hacker" &amp;amp;"How you can secure your account"&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-size: small;"&gt;
&lt;/span&gt;&lt;/h1&gt;
&lt;ul style="text-align: left;"&gt;&lt;span style="font-size: small;"&gt;
&lt;/span&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;Create A Strong Password.Take 
password with combination of at least six numbers, letters, and 
punctuation marks (like ! and &amp;amp;)&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;span style="font-size: small;"&gt;
&lt;/span&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;Change password regularly.&lt;/span&gt;&lt;/li&gt;
&lt;span style="font-size: small;"&gt;
&lt;/span&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;Hide Email.If your email is hacked,then your account can be hacked.For this reason you must hide your email from facebook.&lt;/span&gt;&lt;/li&gt;
&lt;span style="font-size: small;"&gt;
&lt;/span&gt;
&lt;li&gt;&lt;span style="font-size: small;"&gt;Dont Click On Phishing Link .&lt;/span&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;span style="font-size: small; font-weight: normal;"&gt;Phishing
 is a page where you can find fake login page of Facebook.So never enter
 your password in this page.Ex. Of phishing page see below image !&lt;/span&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;span style="font-size: x-small;"&gt;&lt;span style="font-weight: normal;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://tukoast.herobo.com/wp-content/themes/twentyeleven/images/fb-phishing.gif"&gt;&lt;img border="0" height="235" src="http://tukoast.herobo.com/wp-content/themes/twentyeleven/images/fb-phishing.gif" width="400" /&gt;&lt;/a&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;Logout From Public Devices :&lt;/b&gt;Log out of Facebook when you use a computer you share with other people.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Enable Secure Browsing: &lt;/b&gt;To change your secure browsing (https) setting:
1. Go to your Security Settings page (&amp;gt;Account Settings&amp;gt;Security)
2. Click on the Secure Browsing section
3. Check the box provided and save your changes
When you have secure browsing turned on, the address bar in your browser should begin with"https" .&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Enable Login Notification: &lt;/b&gt;Login
 notifications are an extra security feature. When you turn on login 
notifications, Facebook will send you an alert each time someone logs 
into your acccount from a new place.
To turn on login notifications: Feature phones
1. Click Settings &amp;amp; Privacy (bottom of every page)
2. Click Security
3. Click Enable next to Text Message Login Notifications or Email Login 
Notifications to turn them on&lt;b&gt;.&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Use Security Questions: &lt;/b&gt;A security question helps you verify you own your account in case you ever lose access to it or your account has been hacked.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Use Anti-Virus In Browser: &lt;/b&gt;Run
 anti-virus software on computers you use to log in.&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&amp;nbsp;&lt;/li&gt;
&lt;li&gt;After Following Above
 Steps Your Account Will Be 100%  Secure ! For Trick &amp;amp; Tips Join Our
 Fb Page.&amp;nbsp;&amp;nbsp; &lt;a href="http://facebook.com/sharer.php?u=http://hamidkalu.blogspot.in/p/blog-page_3964.html" target="_blank"&gt;Shocking Fb Tricks&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhD-N2eEbMocdjUSVuLYJdJ5bYhTetYSuvJZPi4_ggmJCWAEMcdBTxDH2_4EA4KiGfNcS6uK61dScmVZjL3mzxsrPWW77MpCTpEQFUOgaP-PIl4nxgVMQ0KAXJ4kNQVGQVMf_QXQHOoJ5pt/s1600/995501-facebook-share.gif" title="" /&gt;&lt;/div&gt;
&lt;/a&gt;&lt;a href="http://facebook.com/sharer.php?u=http://hamidkalu.blogspot.in/p/blog-page_3964.html" target="_blank"&gt; &lt;/a&gt;&lt;h1&gt;
&lt;span id="goog_310280830"&gt;&lt;/span&gt;&lt;span id="goog_310280831"&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;ol&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div id="fb-root"&gt;&lt;/div&gt;
&lt;script&gt;(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&amp;appId=327933373929598";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));&lt;/script&gt;
&lt;div class="fb-like" data-href="http://hamidkalu.blogspot.in/2013/09/facebook-security.html" data-width="450" data-show-faces="false" data-send="true"&gt;&lt;/div&gt;

&lt;/div&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKVPf8ApN0DTqajU4duYBYILMER_TIW4kd2PyfcTBxcxsacjw0W89M7DzBjp4bXWBzCyUiSPuc5NgnitfVp1sVOGHxHoUvF02-H0JyvlWwKkuFrUDGY4qARczuKxw_avGLT2vs4qmrI9M4/s72-c/How-To-Protect-Your-New-Facebook-Account-1.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Learn Unix In Seven Simple Tutorials </title><link>http://hamidkalu.blogspot.com/2013/09/learn-unix-in-seven-simple-tutorials.html</link><category>Unix in Seven TUtorials</category><author>noreply@blogger.com (Hamid)</author><pubDate>Mon, 23 Sep 2013 12:21:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7786780271346850842.post-6345291180315695727</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;h1&gt;
UNIX Tutorial One &lt;/h1&gt;
&lt;h2&gt;
1.1 Listing files and directories &lt;/h2&gt;
&lt;h3&gt;
ls (list) &lt;/h3&gt;
When you first login, your current working directory is your home directory. 
  Your home directory has the same name as your user-name, for example, &lt;b&gt;ee91ab&lt;/b&gt;, 
  and it is where your personal files and subdirectories are saved. &lt;br /&gt;
To find out what is in your home directory, type &lt;br /&gt;
&lt;div class="cli"&gt;
% ls &lt;/div&gt;
The &lt;span class="command"&gt;ls&lt;/span&gt; command ( lowercase L and lowercase S ) lists the contents of your current working directory.&lt;br /&gt;
&lt;div align="center"&gt;
&lt;img alt="Unix Terminal - running the ls command" height="269" src="http://www.ee.surrey.ac.uk/Teaching/Unix/media/unix-xterm1.gif" width="491" /&gt;&lt;/div&gt;
There may be no files visible in your home directory, in which case, the UNIX 
  prompt will be returned. Alternatively, there may already be some files inserted 
  by the System Administrator when your account was created. &lt;br /&gt;
&lt;span class="command"&gt;ls&lt;/span&gt; does not, in fact, cause all the files in your home directory 
  to be listed, but only those ones whose name does not begin with a dot (.) Files 
  beginning with a dot (.) are known as hidden files and usually contain important 
  program configuration information. They are hidden because you should not change 
  them unless you are very familiar with UNIX!!! &lt;br /&gt;
To list all files in your home directory including those whose names begin 
  with a dot, type &lt;br /&gt;
&lt;div class="cli"&gt;
% ls -a&lt;/div&gt;
As you can see, &lt;span class="command"&gt;ls -a&lt;/span&gt; lists  files that are normally hidden. &lt;br /&gt;
&lt;div align="center"&gt;
&lt;img alt="Unix Terminal - running the ls command" height="269" src="http://www.ee.surrey.ac.uk/Teaching/Unix/media/unix-xterm2.gif" width="491" /&gt; &lt;/div&gt;
&lt;span class="command"&gt;ls&lt;/span&gt; is an example of a command which can take options: &lt;b&gt;-a&lt;/b&gt; 
  is an example of an option. The options change the behaviour of the command. 
  There are online manual pages that tell you which options a particular command 
  can take, and how each option modifies the behaviour of the command. (See later 
  in this tutorial) &lt;br /&gt;
&lt;h2&gt;
1.2 Making Directories &lt;/h2&gt;
&lt;h3&gt;
mkdir (make directory) &lt;/h3&gt;
We will now make a subdirectory in your home directory to hold the files you 
  will be creating and using in the course of this tutorial. To make a subdirectory 
  called unixstuff in your current working directory type &lt;br /&gt;
&lt;div class="cli"&gt;
% mkdir unixstuff &lt;/div&gt;
To see the directory you have just created, type &lt;br /&gt;
&lt;div class="cli"&gt;
% ls &lt;/div&gt;
&lt;h2&gt;
1.3 Changing to a different directory&amp;nbsp;&lt;/h2&gt;
&lt;h3&gt;
cd (change directory)&lt;/h3&gt;
The command &lt;span class="command"&gt;cd &lt;var&gt;directory&lt;/var&gt;&lt;/span&gt; means change the current 
  working directory to &lt;i&gt;'directory'&lt;/i&gt;. The current working directory may be thought 
  of as the directory you are in, i.e. your current position in the file-system 
  tree. &lt;br /&gt;
To change to the directory you have just made, type &lt;br /&gt;
&lt;div class="cli"&gt;
% cd unixstuff &lt;/div&gt;
Type &lt;span class="command"&gt;ls&lt;/span&gt; to see the contents (which should be empty) &lt;br /&gt;
&lt;h3&gt;
Exercise 1a&lt;/h3&gt;
Make another directory inside the &lt;b&gt;unixstuff&lt;/b&gt; directory called 
  &lt;b&gt;backups&lt;/b&gt; &lt;br /&gt;
&lt;h2&gt;
1.4 The directories . and .. &lt;/h2&gt;
Still in the &lt;b&gt;unixstuff&lt;/b&gt; directory, type &lt;br /&gt;
&lt;div class="cli"&gt;
% ls -a &lt;/div&gt;
As you can see, in the &lt;b&gt;unixstuff&lt;/b&gt; directory (and in all other 
  directories), there are two special directories called (&lt;b&gt;.&lt;/b&gt;) 
  and (&lt;b&gt;..&lt;/b&gt;)&lt;br /&gt;
&lt;h3&gt;
The current directory (.) &lt;/h3&gt;
In UNIX, (&lt;b&gt;.&lt;/b&gt;) means the current directory, so typing &lt;br /&gt;
&lt;div class="cli"&gt;
% cd . &lt;/div&gt;
&lt;div class="hint"&gt;
NOTE: there is a space between cd and the dot&lt;/div&gt;
means stay where you are (the &lt;b&gt;unixstuff&lt;/b&gt; directory). &lt;br /&gt;
This may not seem very useful at first, but using (&lt;b&gt;.&lt;/b&gt;) as the 
  name of the current directory will save a lot of typing, as we shall see later 
  in the tutorial. &lt;br /&gt;
&lt;h3&gt;
The parent directory (..) &lt;/h3&gt;
(&lt;b&gt;..&lt;/b&gt;) means the parent of the current directory, so typing 
&lt;br /&gt;
&lt;div class="cli"&gt;
% cd .. &lt;/div&gt;
will take you one directory up the hierarchy (back to your home directory). 
  Try it now. &lt;br /&gt;
Note: typing &lt;span class="command"&gt;cd&lt;/span&gt; with no argument always returns you to your home 
  directory. This is very useful if you are lost in the file system. &lt;br /&gt;
&lt;h2&gt;
1.5 Pathnames &lt;/h2&gt;
&lt;h3&gt;
pwd (print working directory) &lt;/h3&gt;
Pathnames enable you to work out where you are in relation to the whole file-system. 
  For example, to find out the absolute pathname of your home-directory, type 
  &lt;span class="command"&gt;cd&lt;/span&gt; to get back to your home-directory and then type &lt;br /&gt;
&lt;div class="cli"&gt;
% pwd &lt;/div&gt;
The full pathname will look something like this - &lt;br /&gt;
&lt;div class="output"&gt;
&lt;b&gt;/home/its/ug1/ee51vn&lt;/b&gt;&lt;/div&gt;
which means that &lt;b&gt;ee51vn&lt;/b&gt; (your home directory) is in the sub-directory &lt;b&gt;ug1&lt;/b&gt;  (the group directory),which in turn is  located in the &lt;b&gt;its&lt;/b&gt;  sub-directory, which is in the &lt;b&gt;home&lt;/b&gt; sub-directory, which is in the top-level root directory called " &lt;i&gt;/ " &lt;/i&gt;. &lt;br /&gt;
&lt;div align="center"&gt;
&lt;img alt="Unix File structure" height="316" src="http://www.ee.surrey.ac.uk/Teaching/Unix/media/unix-tree.png" width="560" /&gt;&lt;/div&gt;
&lt;h3&gt;
Exercise 1b&lt;/h3&gt;
Use the commands &lt;span class="command"&gt;cd,&lt;/span&gt; &lt;span class="command"&gt;ls&lt;/span&gt; and &lt;span class="command"&gt;pwd&lt;/span&gt; to explore 
  the file system. &lt;br /&gt;
(Remember, if you get lost, type &lt;span class="command"&gt;cd&lt;/span&gt; by itself to return to your 
  home-directory) &lt;br /&gt;
&lt;h2&gt;
1.6 More about home directories and pathnames &lt;/h2&gt;
&lt;h3&gt;
Understanding pathnames&lt;/h3&gt;
First type cd to get back to your home-directory, then type&lt;br /&gt;
&lt;div class="cli"&gt;
% ls unixstuff&lt;/div&gt;
to list the conents of your unixstuff directory.&lt;br /&gt;
Now type &lt;br /&gt;
&lt;div class="cli"&gt;
% ls backups&lt;/div&gt;
You will get a message like this - &lt;br /&gt;
&lt;div class="output"&gt;
backups: No such file or directory &lt;/div&gt;
The reason is, &lt;b&gt;backups&lt;/b&gt; is not in your current working directory. 
  To use a command on a file (or directory) not in the current working directory 
  (the directory you are currently in), you must either &lt;span class="command"&gt;cd&lt;/span&gt; to the 
  correct directory, or specify its full pathname. To list the contents of your 
  backups directory, you must type &lt;br /&gt;
&lt;div class="cli"&gt;
% ls unixstuff/backups &lt;/div&gt;
&lt;br /&gt;
&lt;h3&gt;
~ (your home directory) &lt;/h3&gt;
Home directories can also be referred to by the tilde &lt;b&gt;~&lt;/b&gt; character. 
  It can be used to specify paths starting at your home directory. So typing &lt;br /&gt;
&lt;div class="cli"&gt;
% ls ~/unixstuff&lt;/div&gt;
will list the contents of your unixstuff directory, no matter where you currently 
  are in the file system. &lt;br /&gt;
What do you think &lt;br /&gt;
&lt;div class="cli"&gt;
% ls ~&lt;/div&gt;
would list? &lt;br /&gt;
What do you think &lt;br /&gt;
&lt;div class="cli"&gt;
% ls ~/.. &lt;/div&gt;
would list? &lt;br /&gt;
&lt;h2&gt;
Summary &lt;/h2&gt;
&lt;table align="center" border="1" cellpadding="5" cellspacing="0"&gt;
  &lt;tbody&gt;
&lt;tr&gt;
    &lt;th&gt;Command&lt;/th&gt;
    &lt;th&gt;Meaning&lt;/th&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;ls&lt;/td&gt;
    &lt;td&gt;list files and directories&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;ls -a&lt;/td&gt;
    &lt;td&gt;list all files and directories&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;mkdir&lt;/td&gt;
    &lt;td&gt;make a directory&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;cd &lt;i&gt;directory&lt;/i&gt;&lt;/td&gt;
    &lt;td&gt;change to named directory&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;cd&lt;/td&gt;
    &lt;td&gt;change to home-directory&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;cd ~&lt;/td&gt;
    &lt;td&gt;change to home-directory&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;cd ..&lt;/td&gt;
    &lt;td&gt;change to parent directory&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;pwd&lt;/td&gt;
    &lt;td&gt;display the path of the current directory&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div align="center" class="navbar"&gt;
&lt;/div&gt;
&lt;div class="date"&gt;
&lt;/div&gt;
&lt;h1&gt;
UNIX Tutorial Two &lt;/h1&gt;
&lt;h2&gt;
2.1 Copying Files&lt;/h2&gt;
&lt;h3&gt;
cp (copy)&lt;/h3&gt;
&lt;span class="command"&gt;cp &lt;i&gt;file1 file2&lt;/i&gt;&lt;/span&gt; is the command which makes a copy of &lt;b&gt;file1&lt;/b&gt; in the current working directory and calls it &lt;b&gt;file2&lt;/b&gt; &lt;br /&gt;
What we are going to do now, is to take a file stored in an open access area 
  of the file system, and use the &lt;span class="command"&gt;cp&lt;/span&gt; command to copy it to your unixstuff 
  directory. &lt;br /&gt;
First, &lt;span class="command"&gt;cd&lt;/span&gt; to your &lt;b&gt;unixstuff&lt;/b&gt; directory.&lt;br /&gt;
&lt;div class="cli"&gt;
% cd ~/unixstuff&lt;/div&gt;
Then at the UNIX prompt, type, &lt;br /&gt;
&lt;div class="cli"&gt;
% cp /vol/examples/tutorial/science.txt . &lt;/div&gt;
&lt;div class="hint"&gt;
Note: Don't forget the dot &lt;b&gt;.&lt;/b&gt; at the end. Remember, in UNIX, 
  the dot means the current directory.&lt;/div&gt;
The above command means copy the file &lt;b&gt;science.txt&lt;/b&gt; to the 
  current directory, keeping the name the same. &lt;br /&gt;
&lt;div class="hint"&gt;
(Note: The directory &lt;b&gt;/vol/examples/tutorial/&lt;/b&gt; is an area to 
  which everyone in the school has read and copy access. If you are from outside 
  the University, you can grab a copy of the file 
  &lt;a href="http://www.ee.surrey.ac.uk/Teaching/Unix/science.txt"&gt;here&lt;/a&gt;. 
  
  Use 'File/Save As..' from the menu bar to save it 
  into your &lt;b&gt;unixstuff&lt;/b&gt; directory.)&lt;/div&gt;
&lt;h3&gt;
Exercise 2a&lt;/h3&gt;
Create a backup of your &lt;b&gt;science.txt&lt;/b&gt; file by copying it to 
  a file called &lt;b&gt;science.bak&lt;/b&gt; &lt;br /&gt;
&lt;h2&gt;
2.2 Moving files&lt;/h2&gt;
&lt;h3&gt;
mv (move)&lt;/h3&gt;
&lt;span class="command"&gt;mv &lt;i&gt;file1 file2&lt;/i&gt;&lt;/span&gt; 
moves (or renames) &lt;b&gt;file1&lt;/b&gt; 
  to &lt;b&gt;file2&lt;/b&gt; &lt;br /&gt;
To move a file from one place to another, use the mv command. 
  This has the effect of moving rather than copying the file, so you end up with 
  only one file rather than two. &lt;br /&gt;
It can also be used to rename a file, by moving the file to the same directory, 
  but giving it a different name. &lt;br /&gt;
We are now going to move the file science.bak to your backup directory. &lt;br /&gt;
First, change directories to your unixstuff directory (can you remember how?). 
  Then, inside the &lt;b&gt;unixstuff&lt;/b&gt; directory, type&lt;br /&gt;
&lt;div class="cli"&gt;
% mv science.bak backups/.&lt;/div&gt;
Type ls and ls backups to see if it has worked.&lt;br /&gt;
&lt;h2&gt;
2.3 Removing files and directories &lt;/h2&gt;
&lt;h3&gt;
rm (remove), rmdir (remove directory)&lt;/h3&gt;
To delete (remove) a file, use the &lt;span class="command"&gt;rm&lt;/span&gt; command. As an example, 
  we are going to create a copy of the &lt;b&gt;science.txt&lt;/b&gt; file then 
  delete it. &lt;br /&gt;
Inside your &lt;b&gt;unixstuff&lt;/b&gt; directory, type&lt;br /&gt;
&lt;div class="cli"&gt;
% cp science.txt tempfile.txt&lt;br /&gt;
% ls&lt;br /&gt;
% rm tempfile.txt &lt;br /&gt;
% ls&lt;/div&gt;
You can use the &lt;span class="command"&gt;rmdir&lt;/span&gt; command to remove a directory (make sure 
  it is empty first). Try to remove the &lt;b&gt;backups&lt;/b&gt; directory. You 
  will not be able to since UNIX will not let you remove a non-empty directory.&lt;br /&gt;
&lt;h3&gt;
Exercise 2b&lt;/h3&gt;
Create a directory called &lt;b&gt;tempstuff&lt;/b&gt; using &lt;span class="command"&gt;mkdir&lt;/span&gt; , then remove it using the &lt;span class="command"&gt;rmdir&lt;/span&gt; command.&lt;br /&gt;
&lt;h2&gt;
2.4 Displaying the contents of a file on the screen &lt;/h2&gt;
&lt;h3&gt;
clear (clear screen)&lt;/h3&gt;
Before you start the next section, you may like to clear the terminal window 
  of the previous commands so the output of the following commands can be clearly 
  understood. &lt;br /&gt;
At the prompt, type &lt;br /&gt;
&lt;div class="cli"&gt;
% clear &lt;/div&gt;
This will clear all text and leave you with the % prompt at the top of the 
  window. &lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
cat (concatenate)&lt;/h3&gt;
The command cat can be used to display the contents of a file 
  on the screen. Type: &lt;br /&gt;
&lt;div class="cli"&gt;
% cat science.txt &lt;/div&gt;
As you can see, the file is longer than than the size of the window, so it 
  scrolls past making it unreadable. &lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
less&lt;/h3&gt;
The command less writes the contents of a file onto the screen 
  a page at a time. Type &lt;br /&gt;
&lt;div class="cli"&gt;
% less science.txt &lt;/div&gt;
Press the [&lt;b&gt;space-bar&lt;/b&gt;] if you want to see another page, and type [&lt;b&gt;q&lt;/b&gt;] 
  if you want to quit reading. As you can see, 
    &lt;span class="command"&gt;less&lt;/span&gt; is used in preference 
  to &lt;span class="command"&gt;cat&lt;/span&gt; for long files. &lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
head&lt;/h3&gt;
The &lt;span class="command"&gt;head&lt;/span&gt; command writes the first ten lines of a file to the screen. &lt;br /&gt;
First clear the screen then type &lt;br /&gt;
&lt;div class="cli"&gt;
% head science.txt &lt;/div&gt;
Then type &lt;br /&gt;
&lt;div class="cli"&gt;
% head -5 science.txt &lt;/div&gt;
What difference did the -5 do to the head command? &lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
tail&lt;/h3&gt;
The &lt;span class="command"&gt;tail&lt;/span&gt; command writes the last ten lines of a file to the screen. &lt;br /&gt;
Clear the screen and type &lt;br /&gt;
&lt;div class="cli"&gt;
% tail science.txt &lt;/div&gt;
Q. How can you view the last 15 lines of the file? &lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
2.5 Searching the contents of a file &lt;/h2&gt;
&lt;h3&gt;
Simple searching using less&lt;/h3&gt;
Using &lt;span class="command"&gt;less&lt;/span&gt;, you can search though a text file for a keyword (pattern). 
  For example, to search through &lt;b&gt;science.txt&lt;/b&gt; for the word &lt;b&gt;'science'&lt;/b&gt;, 
  type &lt;br /&gt;
&lt;div class="cli"&gt;
% less science.txt &lt;/div&gt;
then, still in &lt;span class="command"&gt;less&lt;/span&gt;,  type a forward 
  slash [&lt;b&gt;/&lt;/b&gt;] followed by the word to search&lt;br /&gt;
&lt;div class="cli"&gt;
/science&lt;/div&gt;
As you can see, &lt;span class="command"&gt;less&lt;/span&gt; finds and highlights the keyword. Type [&lt;b&gt;n&lt;/b&gt;] 
  to search for the next occurrence of the word. &lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
grep (don't ask why it is called grep)&lt;/h3&gt;
&lt;span class="command"&gt;grep&lt;/span&gt; is one of many standard UNIX utilities. It searches files 
  for specified words or patterns. First clear the screen, then type &lt;br /&gt;
&lt;div class="cli"&gt;
% grep science science.txt &lt;/div&gt;
As you can see, &lt;span class="command"&gt;grep&lt;/span&gt; has printed out each line containg the word 
  &lt;b&gt;science&lt;/b&gt;. &lt;br /&gt;
Or has it ???? &lt;br /&gt;
Try typing &lt;br /&gt;
&lt;div class="cli"&gt;
% grep Science science.txt &lt;/div&gt;
The &lt;span class="command"&gt;grep&lt;/span&gt; command is case sensitive; it distinguishes between 
  Science and science. &lt;br /&gt;
To ignore upper/lower case distinctions, use the -i option, i.e. type &lt;br /&gt;
&lt;div class="cli"&gt;
% grep -i science science.txt &lt;/div&gt;
To search for a phrase or pattern, you must enclose it in single quotes (the 
  apostrophe symbol). For example to search for spinning top, type &lt;br /&gt;
&lt;div class="cli"&gt;
% grep -i 'spinning top' science.txt &lt;/div&gt;
Some of the other options of grep are: &lt;br /&gt;
&lt;b&gt;-v &lt;/b&gt;display those lines that do NOT match &lt;br /&gt;
&lt;b&gt;-n&lt;/b&gt; precede each matching line with the line number &lt;br /&gt;
&lt;b&gt;-c &lt;/b&gt;print only the total count of matched lines &lt;br /&gt;
&lt;br /&gt;
Try some of them and see the different results. Don't forget, you can use 
  more than one option at a time. For example, the number of lines without the 
  words science or Science is&lt;br /&gt;
&lt;div class="cli"&gt;
% grep -ivc science science.txt &lt;/div&gt;
&lt;br /&gt;
&lt;h3&gt;
wc (word count)&lt;/h3&gt;
A handy little utility is the &lt;span class="command"&gt;wc&lt;/span&gt; command, short for word count. 
  To do a word count on &lt;b&gt;science.txt&lt;/b&gt;, type &lt;br /&gt;
&lt;div class="cli"&gt;
% wc -w science.txt &lt;/div&gt;
To find out how many lines the file has, type &lt;br /&gt;
&lt;div class="cli"&gt;
% wc -l science.txt &lt;/div&gt;
&lt;h2&gt;
Summary &lt;/h2&gt;
&lt;table align="center" border="1" cellpadding="5" cellspacing="0"&gt;
  &lt;tbody&gt;
&lt;tr&gt;
    &lt;th&gt;Command&lt;/th&gt;
    &lt;th&gt;Meaning&lt;/th&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;cp &lt;i&gt;file1 file2&lt;/i&gt;&lt;/td&gt;
    &lt;td&gt;copy file1 and call it file2&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;mv &lt;i&gt;file1 file2&lt;/i&gt;&lt;/td&gt;
    &lt;td&gt;move or rename file1 to file2&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;rm &lt;i&gt;file&lt;/i&gt;&lt;/td&gt;
    &lt;td&gt;remove a file&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;rmdir &lt;i&gt;directory&lt;/i&gt;&lt;/td&gt;
    &lt;td&gt;remove a directory&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;cat &lt;i&gt;file&lt;/i&gt;&lt;/td&gt;
    &lt;td&gt;display a file&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;less &lt;i&gt;file&lt;/i&gt;&lt;/td&gt;
    &lt;td&gt;display a file a page at a time&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;head &lt;i&gt;file&lt;/i&gt;&lt;/td&gt;
    &lt;td&gt;display the first few lines of a file&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;tail &lt;i&gt;file&lt;/i&gt;&lt;/td&gt;
    &lt;td&gt;display the last few lines of a file&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;grep &lt;i&gt;'keyword' file&lt;/i&gt;&lt;/td&gt;
    &lt;td&gt;search a file for keywords&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;wc &lt;i&gt;file&lt;/i&gt;&lt;/td&gt;
    &lt;td&gt;count number of lines/words/characters in file&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div align="center"&gt;
&lt;a href="http://www.ee.surrey.ac.uk/Teaching/Unix/unix3.html"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div align="center"&gt;
&lt;/div&gt;
&lt;div class="date"&gt;
&lt;/div&gt;
&lt;h1&gt;
UNIX Tutorial Three &lt;/h1&gt;
&lt;h2&gt;
3.1 Redirection &amp;nbsp; &lt;/h2&gt;
Most processes initiated by UNIX commands write to the standard output (that 
  is, they write to the terminal screen), and many take their input from the standard 
  input (that is, they read it from the keyboard). There is also the standard 
  error, where processes write their error messages, by default, to the terminal 
  screen. &lt;br /&gt;
We have already seen one use of the &lt;span class="command"&gt;cat&lt;/span&gt; command to write the 
  contents of a file to the screen. &lt;br /&gt;
Now type &lt;span class="command"&gt;cat&lt;/span&gt; without specifing a file to read &lt;br /&gt;
&lt;div class="cli"&gt;
% cat&lt;/div&gt;
Then type a few words on the keyboard and press the [&lt;b&gt;Return&lt;/b&gt;] key.  &lt;br /&gt;
Finally hold the [&lt;b&gt;Ctrl&lt;/b&gt;] key down and press [&lt;b&gt;d&lt;/b&gt;] (written 
  as &lt;b&gt;^D&lt;/b&gt; for short) to end the input. &lt;br /&gt;
What has happened? &lt;br /&gt;
If you run the &lt;span class="command"&gt;cat&lt;/span&gt; command without specifing a file to read, 
  it reads the standard input (the keyboard), and on receiving the 'end of file' 
  (&lt;b&gt;^D&lt;/b&gt;), copies it to the standard output (the screen). &lt;br /&gt;
In UNIX, we can redirect both the input and the output of commands. &lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
3.2 Redirecting the Output &amp;nbsp; &lt;/h2&gt;
We use the &amp;gt; symbol to redirect the output of a command. For example, to 
  create a file called &lt;b&gt;list1&lt;/b&gt; containing a list of fruit, type 
  &amp;nbsp; &lt;br /&gt;
&lt;div class="cli"&gt;
% cat &amp;gt; list1&lt;/div&gt;
Then type in the names of some fruit. Press [&lt;b&gt;Return&lt;/b&gt;] after each 
  one. &lt;br /&gt;
&lt;div class="cli"&gt;
pear&lt;br /&gt;
banana&lt;br /&gt;
apple&lt;br /&gt;
^D    {this means press [Ctrl] and [d] to stop}&lt;/div&gt;
What happens is the cat command reads the standard input (the    
keyboard) and the &amp;gt; redirects the output, which normally goes to the 
screen,    into a file called &lt;b&gt;list1&lt;/b&gt; &lt;br /&gt;
To read the contents of the file, type &lt;br /&gt;
&lt;div class="cli"&gt;
% cat list1&lt;/div&gt;
&lt;h3&gt;
Exercise 3a&lt;/h3&gt;
Using the above method, create another file called &lt;b&gt;list2&lt;/b&gt; containing 
  the following fruit: orange, plum, mango, grapefruit. Read the contents of &lt;b&gt;list2&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
3.2.1 Appending to a file &lt;/h3&gt;
The form &amp;gt;&amp;gt; appends standard output to a file. So to add more items to 
  the file &lt;b&gt;list1&lt;/b&gt;, type &lt;br /&gt;
&lt;div class="cli"&gt;
% cat &amp;gt;&amp;gt; list1&lt;/div&gt;
Then type in the names of more fruit &lt;br /&gt;
&lt;div class="cli"&gt;
peach&lt;br /&gt;
grape&lt;br /&gt;
orange&lt;br /&gt;
^D (Control D to stop)&lt;/div&gt;
To read the contents of the file, type &lt;br /&gt;
&lt;div class="cli"&gt;
% cat list1&lt;/div&gt;
You should now have two files. One contains six fruit, the other contains four 
  fruit. &lt;br /&gt;
We will now use the cat command to join (concatenate) &lt;b&gt;list1&lt;/b&gt; and &lt;b&gt;list2&lt;/b&gt; into a new file called &lt;b&gt;biglist&lt;/b&gt;. 
  Type &lt;br /&gt;
&lt;div class="cli"&gt;
% cat list1 list2 &amp;gt; biglist&lt;/div&gt;
What this is doing is reading the contents of &lt;b&gt;list1&lt;/b&gt; and &lt;b&gt;list2&lt;/b&gt; 
  in turn, then outputing the text to the file &lt;b&gt;biglist&lt;/b&gt; &lt;br /&gt;
To read the contents of the new file, type &lt;br /&gt;
&lt;div class="cli"&gt;
% cat biglist&lt;/div&gt;
&lt;h2&gt;
3.3 Redirecting the Input &amp;nbsp; &lt;/h2&gt;
We use the &amp;lt; symbol to redirect the input of a command. &lt;br /&gt;
The command sort alphabetically or numerically sorts a list. 
  Type &lt;br /&gt;
&lt;div class="cli"&gt;
% sort &lt;/div&gt;
Then type in the names of some animals. Press [Return] after 
  each one. &lt;br /&gt;
&lt;div class="cli"&gt;
dog&lt;br /&gt;
cat&lt;br /&gt;
bird&lt;br /&gt;
ape&lt;br /&gt;
^D (control d to stop)&lt;/div&gt;
The output will be &lt;br /&gt;
&lt;div class="output"&gt;
ape&lt;br /&gt;
bird &lt;br /&gt;
cat &lt;br /&gt;
dog &lt;/div&gt;
Using &amp;lt; you can redirect the input to come from a file rather than the 
  keyboard. For example, to sort the list of fruit, type &lt;br /&gt;
&lt;div class="cli"&gt;
% sort &amp;lt; biglist &lt;/div&gt;
and the sorted list will be output to the screen. &lt;br /&gt;
To output the sorted list to a file, type, &lt;br /&gt;
&lt;div class="cli"&gt;
% sort &amp;lt; biglist &amp;gt; slist &lt;/div&gt;
Use cat to read the contents of the file &lt;b&gt;slist&lt;/b&gt;&lt;br /&gt;
&lt;h2&gt;
3.4 Pipes&lt;/h2&gt;
To see who is on the system with you, type &lt;br /&gt;
&lt;div class="cli"&gt;
% who &lt;/div&gt;
One method to get a sorted list of names is to type, &lt;br /&gt;
&lt;div class="cli"&gt;
% who &amp;gt; names.txt&lt;br /&gt;
% sort &amp;lt; names.txt &lt;/div&gt;
This is a bit slow and you have to remember to remove the temporary file called 
  names when you have finished. What you really want to do is connect the output 
  of the who command directly to the input of the sort 
  command. This is exactly what pipes do. The symbol for a pipe is the vertical 
  bar | &lt;br /&gt;
For example, typing &lt;br /&gt;
&lt;div class="cli"&gt;
% who | sort &lt;/div&gt;
will give the same result as above, but quicker and cleaner. &lt;br /&gt;
To find out how many users are logged on, type &lt;br /&gt;
&lt;div class="cli"&gt;
% who | wc -l&lt;/div&gt;
&lt;h3&gt;
Exercise 3b&lt;/h3&gt;
Using pipes, display all lines of &lt;b&gt;list1&lt;/b&gt; and &lt;b&gt;list2&lt;/b&gt; 
  containing the letter 'p', and sort the result.&lt;br /&gt;
&lt;a href="http://www.ee.surrey.ac.uk/Teaching/Unix/pipeanswer.html"&gt;Answer available here&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;
Summary &lt;/h2&gt;
&lt;table align="center" border="1" cellpadding="5" cellspacing="0"&gt;
  &lt;tbody&gt;
&lt;tr&gt;
    &lt;th&gt;Command&lt;/th&gt;
    &lt;th&gt;Meaning&lt;/th&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;&lt;var&gt;command&lt;/var&gt; &amp;gt; &lt;var&gt;file&lt;/var&gt;&lt;/td&gt;
    &lt;td&gt;redirect standard output to a file&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;&lt;var&gt;command&lt;/var&gt; &amp;gt;&amp;gt; &lt;var&gt;file&lt;/var&gt;&lt;/td&gt;
    &lt;td&gt;append standard output to a file &lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;&lt;var&gt;command&lt;/var&gt; &amp;lt; &lt;var&gt;file&lt;/var&gt;&lt;/td&gt;
    &lt;td&gt;redirect standard input from a file&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;&lt;var&gt;command1&lt;/var&gt; | &lt;var&gt;command2&lt;/var&gt;&lt;/td&gt;
    &lt;td&gt;pipe the output of command1 to the input of command2&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;cat &lt;var&gt;file1 file2&lt;/var&gt; &amp;gt; &lt;var&gt;file0&lt;/var&gt;&lt;/td&gt;
    &lt;td&gt;concatenate file1 and file2 to file0&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;sort&lt;/td&gt;
    &lt;td&gt;sort data&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;who&lt;/td&gt;
    &lt;td&gt;list users currently logged in&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h1&gt;
UNIX Tutorial Four &lt;/h1&gt;
&lt;h2&gt;
4.1 Wildcards&lt;/h2&gt;
&lt;h3&gt;
The  * wildcard &lt;/h3&gt;
The character &lt;b class="command"&gt;*&lt;/b&gt; is called a wildcard, and will match against none or more character(s) 
  in a file (or directory) name. For example, in your &lt;b&gt;unixstuff&lt;/b&gt; 
  directory, type &lt;br /&gt;
&lt;div class="cli"&gt;
% ls list*&lt;/div&gt;
This will list all files in the current directory starting with &lt;b&gt;list....&lt;/b&gt; 
&lt;br /&gt;
Try typing &lt;br /&gt;
&lt;div class="cli"&gt;
% ls *list&lt;/div&gt;
This will list all files in the current directory ending with &lt;b&gt;....list&lt;/b&gt;&lt;br /&gt;
&lt;h3&gt;
The  ? wildcard &lt;/h3&gt;
The character &lt;span class="command"&gt;?&lt;/span&gt; will match exactly one character.&lt;br /&gt;
So &lt;b&gt;?ouse&lt;/b&gt; will match files like &lt;b&gt;house&lt;/b&gt; and &lt;b&gt;mouse&lt;/b&gt;, 
  but not &lt;b&gt;grouse&lt;/b&gt;. &lt;br /&gt;
Try typing &lt;br /&gt;
&lt;div class="cli"&gt;
% ls ?list&lt;/div&gt;
&lt;br /&gt;
&lt;h2&gt;
4.2 Filename conventions &lt;/h2&gt;
We should note here that a directory is merely a special type of file. So the 
  rules and conventions for naming files apply also to directories. &lt;br /&gt;
In naming files, characters with special meanings such as &lt;b&gt;/ * &amp;amp; 
  %&lt;/b&gt; , should be avoided. Also, avoid using spaces within names. The safest 
  way to name a file is to use only alphanumeric characters, that is, letters 
  and numbers, together with _ (underscore) and . (dot). &lt;br /&gt;
&lt;table align="center" border="1" cellpadding="4" cellspacing="0"&gt;
  &lt;tbody&gt;
&lt;tr&gt;
    &lt;th scope="col"&gt;Good filenames&lt;/th&gt;
    &lt;th scope="col"&gt;Bad filenames &lt;/th&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td&gt;project.txt&lt;/td&gt;
    &lt;td&gt;project&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td&gt;my_big_program.c&lt;/td&gt;
    &lt;td&gt;my big program.c &lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td&gt;fred_dave.doc&lt;/td&gt;
    &lt;td&gt;fred &amp;amp; dave.doc &lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
File names conventionally start with a lower-case letter, and may end with 
  a dot followed by a group of letters indicating the contents of the file. For 
  example, all files consisting of C code may be named with the ending &lt;b&gt;.c&lt;/b&gt;, for 
  example, &lt;b&gt;prog1.c&lt;/b&gt; . Then in order to list all files containing C code in your 
  home directory, you need only type &lt;span class="command"&gt;ls&amp;nbsp;*.c&lt;/span&gt; in that directory. &lt;br /&gt;
&lt;h2&gt;
4.3 Getting Help&lt;/h2&gt;
&lt;h3&gt;
On-line Manuals&lt;/h3&gt;
There are on-line manuals which gives information about most commands. The 
  manual pages tell you which options a particular command can take, and how each 
  option modifies the behaviour of the command. Type &lt;span class="command"&gt;man&amp;nbsp;&lt;i&gt;command&lt;/i&gt;&lt;/span&gt; to read the manual 
  page for a particular command. &lt;br /&gt;
For example, to find out more about the &lt;b class="command"&gt;wc&lt;/b&gt; (word count) command, 
  type &lt;br /&gt;
&lt;div class="cli"&gt;
% man wc &lt;/div&gt;
Alternatively &lt;br /&gt;
&lt;div class="cli"&gt;
% whatis wc &lt;/div&gt;
gives a one-line description of the command, but omits any information about 
  options etc. &lt;br /&gt;
&lt;h3&gt;
Apropos&lt;/h3&gt;
When you are not sure of the exact name of a command, &lt;br /&gt;
&lt;div class="cli"&gt;
% apropos keyword &lt;/div&gt;
will give you the commands with keyword in their manual page header. For example, 
  try typing &lt;br /&gt;
&lt;div class="cli"&gt;
% apropos copy &lt;/div&gt;
&lt;h2&gt;
Summary &lt;/h2&gt;
&lt;table align="center" border="1" cellpadding="4" cellspacing="0"&gt;
  &lt;tbody&gt;
&lt;tr&gt;
    &lt;th&gt;Command&lt;/th&gt;
    &lt;th&gt;Meaning&lt;/th&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;*&lt;/td&gt;
    &lt;td&gt;match any number of characters&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;?&lt;/td&gt;
    &lt;td&gt;match one character&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;man &lt;var&gt;command&lt;/var&gt;&lt;/td&gt;
    &lt;td&gt;read the online manual page for a command&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;whatis &lt;var&gt;command&lt;/var&gt;&lt;/td&gt;
    &lt;td&gt;brief description of a command&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;apropos &lt;var&gt;keyword &lt;/var&gt; &lt;/td&gt;
    &lt;td&gt;match commands with keyword in their man pages&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div align="center"&gt;
&amp;nbsp;
&lt;/div&gt;
&lt;h1&gt;
UNIX Tutorial Five &lt;/h1&gt;
&lt;h2&gt;
5.1 File system security (access rights) &lt;/h2&gt;
In your &lt;b&gt;unixstuff&lt;/b&gt; directory, type &lt;br /&gt;
&lt;div class="cli"&gt;
% ls -l (l for long listing!)&lt;/div&gt;
You will see that you now get lots of details about the contents of your directory, 
  similar to the example below. &lt;br /&gt;
&lt;img alt="File and directory access rights" src="http://www.ee.surrey.ac.uk/Teaching/Unix/file1.gif" /&gt; &lt;br /&gt;
Each file (and directory) has associated access rights, which may be found 
  by typing &lt;span class="command"&gt;ls -l&lt;/span&gt;. Also, &lt;span class="command"&gt;ls -lg&lt;/span&gt; gives additional information 
  as to which group owns the file (beng95 in the following example): &lt;br /&gt;
&lt;div class="output"&gt;
-rwxrw-r-- 1 ee51ab beng95 
  2450 Sept29 11:52 file1&lt;/div&gt;
In the left-hand column is a 10 symbol string consisting of the symbols d, 
  r, w, x, -, and, occasionally, s or S. If d is present, it will be at the left 
  hand end of the string, and indicates a directory: otherwise - will be the starting 
  symbol of the string. &lt;br /&gt;
The 9 remaining symbols indicate the permissions, or access rights, and are 
  taken as three groups of 3. &lt;br /&gt;
&lt;ul&gt;
&lt;li&gt; The left group of 3 gives the file permissions for the user that owns the 
    file (or directory) (ee51ab in the above example); &lt;br /&gt;
  &lt;/li&gt;
&lt;li&gt; the middle group gives the permissions for the group of people to whom 
    the file (or directory) belongs (eebeng95 in the above example);&lt;br /&gt;
  &lt;/li&gt;
&lt;li&gt; the rightmost group gives the permissions for all others.&lt;/li&gt;
&lt;/ul&gt;
The symbols r, w, etc., have slightly different meanings depending on whether 
  they refer to a simple file or to a directory. &lt;br /&gt;
&lt;h3&gt;
Access rights on files.&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt; r (or -), indicates read permission (or otherwise), that is, the presence 
    or absence of permission to read and copy the file &lt;br /&gt;
  &lt;/li&gt;
&lt;li&gt; w (or -), indicates write permission (or otherwise), that is, the permission 
    (or otherwise) to change a file &lt;br /&gt;
  &lt;/li&gt;
&lt;li&gt; x (or -), indicates execution permission (or otherwise), that is, the permission 
    to execute a file, where appropriate &lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
Access rights on directories.&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt; r allows users to list files in the directory; &lt;/li&gt;
&lt;li&gt; w means that users may delete files from the directory or move files into 
    it; &lt;/li&gt;
&lt;li&gt; x means the right to access files in the directory. This implies that you 
    may read files in the directory provided you have read permission on the individual 
    files. &lt;/li&gt;
&lt;/ul&gt;
So, in order to read a file, you must have execute permission on the directory 
  containing that file, and hence on any directory containing that directory as 
  a subdirectory, and so on, up the tree. &lt;br /&gt;
&lt;h3&gt;
Some examples&lt;/h3&gt;
&lt;table align="center" border="1" cellpadding="5" cellspacing="0"&gt;
  &lt;tbody&gt;
&lt;tr&gt;
    &lt;td&gt;-rwxrwxrwx&lt;/td&gt;
    &lt;td&gt;a file that everyone can read, write and execute (and delete).&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td&gt;-rw-------&lt;/td&gt;
    &lt;td&gt;a file that only the owner can read and write - no-one else &lt;br /&gt;
can read or write and no-one has execution rights (e.g. your &lt;br /&gt;
mailbox file).&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h2&gt;
5.2 Changing access rights&lt;/h2&gt;
&lt;h3&gt;
chmod (changing a file mode)&lt;/h3&gt;
Only the owner of a file can use chmod to change the permissions 
  of a file. The options of chmod are as follows &lt;br /&gt;
&lt;table align="center" border="1" cellpadding="3" cellspacing="0"&gt;
  &lt;tbody&gt;
&lt;tr&gt; 
    &lt;th&gt;Symbol&lt;/th&gt;
    &lt;th&gt;Meaning&lt;/th&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td&gt;&lt;div align="center"&gt;
u&lt;/div&gt;
&lt;/td&gt;
    &lt;td&gt;user&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td&gt;&lt;div align="center"&gt;
g&lt;/div&gt;
&lt;/td&gt;
    &lt;td&gt;group&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td&gt;&lt;div align="center"&gt;
o&lt;/div&gt;
&lt;/td&gt;
    &lt;td&gt;other&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td&gt;&lt;div align="center"&gt;
a&lt;/div&gt;
&lt;/td&gt;
    &lt;td&gt;all&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td&gt;&lt;div align="center"&gt;
r&lt;/div&gt;
&lt;/td&gt;
    &lt;td&gt;read&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td&gt;&lt;div align="center"&gt;
w&lt;/div&gt;
&lt;/td&gt;
    &lt;td&gt;write (and delete)&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td&gt;&lt;div align="center"&gt;
x&lt;/div&gt;
&lt;/td&gt;
    &lt;td&gt;execute (and access directory) &lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td&gt;&lt;div align="center"&gt;
+&lt;/div&gt;
&lt;/td&gt;
    &lt;td&gt;add permission&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td&gt;&lt;div align="center"&gt;
-&lt;/div&gt;
&lt;/td&gt;
    &lt;td&gt;take away permission&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
For example, to remove read write and execute permissions on the file &lt;b&gt;biglist&lt;/b&gt; 
  for the group and others, type &lt;br /&gt;
&lt;div class="cli"&gt;
% chmod go-rwx biglist &lt;/div&gt;
This will leave the other permissions unaffected. &lt;br /&gt;
To give read and write permissions on the file &lt;b&gt;biglist&lt;/b&gt; to 
  all, &lt;br /&gt;
&lt;div class="cli"&gt;
% chmod a+rw biglist &lt;/div&gt;
&lt;h3&gt;
Exercise 5a&lt;/h3&gt;
Try changing access permissions on the file &lt;b&gt;science.txt&lt;/b&gt; and 
  on the directory &lt;b&gt;backups&lt;/b&gt;&lt;br /&gt;
Use &lt;span class="command"&gt;ls -l&lt;/span&gt; to check that the permissions have changed. &lt;br /&gt;
&lt;h2&gt;
5.3 Processes and Jobs  &lt;/h2&gt;
A process is an executing program identified by a unique PID (process identifier). 
  To see information about your processes, with their associated PID and status, 
  type &lt;br /&gt;
&lt;div class="cli"&gt;
% ps &lt;/div&gt;
A process may be in the foreground, in the background, or be suspended. In 
  general the shell does not return the UNIX prompt until the current process 
  has finished executing. &lt;br /&gt;
Some processes take a long time to run and hold up the terminal. Backgrounding 
  a long process has the effect that the UNIX prompt is returned immediately, 
  and other tasks can be carried out while the original process continues executing.&lt;br /&gt;
&lt;h3&gt;
Running background processes&lt;/h3&gt;
To background a process, type an &lt;b&gt;&amp;amp;&lt;/b&gt; at the end of the command 
  line. For example, the command &lt;span class="command"&gt;sleep&lt;/span&gt; waits a given number of seconds 
  before continuing. Type &lt;br /&gt;
&lt;div class="cli"&gt;
% sleep 10 &lt;/div&gt;
This will wait 10 seconds before returning the command prompt %. Until the 
  command prompt is returned, you can do nothing except wait. &lt;br /&gt;
To run sleep in the background, type &lt;br /&gt;
&lt;div class="cli"&gt;
% sleep 10 &amp;amp;&lt;/div&gt;
&lt;div class="output"&gt;
[1] 6259 &lt;/div&gt;
The &lt;b&gt;&amp;amp;&lt;/b&gt; runs the job in the background and returns the prompt 
  straight away, allowing you do run other programs while waiting for that one 
  to finish. &lt;br /&gt;
The first line in the above example is typed in by the user; the next line, 
  indicating job number and PID, is returned by the machine. The user is be notified 
  of a job number (numbered from 1) enclosed in square brackets, together with 
  a PID and is notified when a background process is finished. Backgrounding is 
  useful for jobs which will take a long time to complete. &lt;br /&gt;
&lt;h3&gt;
Backgrounding a current foreground process&lt;/h3&gt;
At the prompt, type &lt;br /&gt;
&lt;div class="cli"&gt;
% sleep 1000 &lt;/div&gt;
You can suspend the process running in the foreground by typing &lt;b&gt;^Z&lt;/b&gt;, i.e.hold down the [&lt;b&gt;Ctrl&lt;/b&gt;] 
  key and type [&lt;b&gt;z&lt;/b&gt;]. Then to put 
  it in the background, type &lt;br /&gt;
&lt;div class="cli"&gt;
% bg &lt;/div&gt;
&lt;div class="hint"&gt;
Note: do not background programs that require user interaction 
  e.g. vi &lt;/div&gt;
&lt;h2&gt;
5.4 Listing suspended and background processes &lt;/h2&gt;
When a process is running, backgrounded or suspended, it will be entered onto 
  a list along with a job number. To examine this list, type &lt;br /&gt;
&lt;div class="cli"&gt;
% jobs &lt;/div&gt;
An example of a job list could be &lt;br /&gt;
&lt;div class="output"&gt;
[1] Suspended sleep 1000&lt;br /&gt;
[2] Running netscape&lt;br /&gt;
[3] Running matlab &lt;/div&gt;
To restart (foreground) a suspended processes, type &lt;br /&gt;
&lt;div class="cli"&gt;
% fg %&lt;i&gt;jobnumber&lt;/i&gt; &lt;/div&gt;
For example, to restart sleep 1000, type &lt;br /&gt;
&lt;div class="cli"&gt;
% fg %1 &lt;/div&gt;
Typing &lt;span class="command"&gt;fg&lt;/span&gt; with no job number foregrounds the last suspended process.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
5.5 Killing a process &lt;/h2&gt;
&lt;h3&gt;
kill (terminate or signal a process)&lt;/h3&gt;
It is sometimes necessary to kill a process (for example, when an executing 
  program is in an infinite loop) &lt;br /&gt;
To kill a job running in the foreground, type &lt;b&gt;^C&lt;/b&gt; (control c). 
  For example, run &lt;br /&gt;
&lt;div class="cli"&gt;
% sleep 100&lt;br /&gt;
^C &lt;/div&gt;
To kill a suspended or background process, type &lt;br /&gt;
&lt;div class="cli"&gt;
% kill %&lt;i&gt;jobnumber&lt;/i&gt; &lt;/div&gt;
For example, run &lt;br /&gt;
&lt;div class="cli"&gt;
% sleep 100 &amp;amp;&lt;br /&gt;
% jobs&lt;/div&gt;
If it is job number 4, type &lt;br /&gt;
&lt;div class="cli"&gt;
% kill %4 &lt;/div&gt;
To check whether this has worked, examine the job list again to see if the 
  process has been removed. &lt;br /&gt;
&lt;h3&gt;
ps (process status)&lt;/h3&gt;
Alternatively, processes can be killed by finding their process numbers (PIDs) 
  and using kill &lt;var&gt;PID_number&lt;/var&gt;&lt;br /&gt;
&lt;div class="cli"&gt;
% sleep 1000 &amp;amp;&lt;br /&gt;
% ps&lt;/div&gt;
&lt;div class="output"&gt;
PID TT S TIME COMMAND&lt;br /&gt;
20077 pts/5 S 0:05 sleep 1000&lt;br /&gt;
21563 pts/5 T 0:00 netscape&lt;br /&gt;
21873 pts/5 S 0:25 nedit &lt;/div&gt;
To kill off the process &lt;b&gt;sleep 1000&lt;/b&gt;, type &lt;br /&gt;
&lt;div class="cli"&gt;
% kill 20077 &lt;/div&gt;
and then type &lt;span class="command"&gt;ps&lt;/span&gt; again to see if it has been removed from the 
  list. &lt;br /&gt;
If a process refuses to be killed, uses the &lt;b&gt;-9&lt;/b&gt; option, i.e. 
  type &lt;br /&gt;
&lt;div class="cli"&gt;
% kill -9 20077 &lt;/div&gt;
&lt;div class="hint"&gt;
Note: It is not possible to kill off other users' processes !!!&lt;/div&gt;
&lt;h2&gt;
Summary &lt;/h2&gt;
&lt;table align="center" border="1" cellpadding="5" cellspacing="0"&gt;
  &lt;tbody&gt;
&lt;tr&gt;
    &lt;th&gt;Command&lt;/th&gt;
    &lt;th&gt;Meaning&lt;/th&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;ls -lag&lt;/td&gt;
    &lt;td&gt;list access rights for all files&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;chmod [&lt;var&gt;options&lt;/var&gt;] &lt;var&gt;file&lt;/var&gt;&lt;/td&gt;
    &lt;td&gt;change access rights for named file&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;&lt;var&gt;command&lt;/var&gt; &amp;amp;&lt;/td&gt;
    &lt;td&gt;run command in background&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;^C&lt;/td&gt;
    &lt;td&gt;kill the job running in the foreground&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;^Z&lt;/td&gt;
    &lt;td&gt;suspend the job running in the foreground&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;bg&lt;/td&gt;
    &lt;td&gt;background the suspended job&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;jobs&lt;/td&gt;
    &lt;td&gt;list current jobs&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;fg %1&lt;/td&gt;
    &lt;td&gt;foreground job number 1&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;kill %1&lt;/td&gt;
    &lt;td&gt;kill job number 1&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;ps&lt;/td&gt;
    &lt;td&gt;list current processes&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td class="command"&gt;kill 26152&lt;/td&gt;
    &lt;td&gt;kill process number 26152&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h1&gt;
UNIX Tutorial Six &lt;/h1&gt;
&lt;h2&gt;
Other useful UNIX commands &amp;nbsp; &lt;/h2&gt;
&lt;h3&gt;
quota&lt;/h3&gt;
All students are allocated a certain amount of disk space on the file system 
  for their personal files, usually about 100Mb. If you go over your quota, you are given 7 days to remove excess files.&lt;br /&gt;
To check your current quota and how much of it you have used, type &lt;br /&gt;
&lt;div class="cli"&gt;
% quota -v &lt;/div&gt;
&lt;h3&gt;
df&lt;/h3&gt;
The &lt;span class="command"&gt;df&lt;/span&gt; command reports on the space left on the file system. For example, to 
  find out how much space is left on the fileserver, type &lt;br /&gt;
&lt;div class="cli"&gt;
% df . &lt;/div&gt;
&lt;h3&gt;
du&lt;/h3&gt;
The &lt;span class="command"&gt;du&lt;/span&gt; command outputs the number of kilobyes used by each subdirectory. Useful 
  if you have gone over quota and you want to find out which directory has the 
  most files. In your home-directory, type &lt;br /&gt;
&lt;div class="cli"&gt;
% du -s *&lt;/div&gt;
The &lt;b&gt;-s&lt;/b&gt; flag will display only a summary (total size) and the * means all files and directories.  &lt;br /&gt;
&lt;h3&gt;
gzip&lt;/h3&gt;
This reduces the size of a file, thus freeing valuable disk space. For example, 
  type &lt;br /&gt;
&lt;div class="cli"&gt;
% ls -l science.txt &lt;/div&gt;
and note the size of the file using  &lt;span class="command"&gt;ls -l&lt;/span&gt; . Then to compress science.txt, type &lt;br /&gt;
&lt;div class="cli"&gt;
% gzip science.txt &lt;/div&gt;
This will compress the file and place it in a file called &lt;b&gt;science.txt.gz&lt;/b&gt; &lt;br /&gt;
To see the change in size, type &lt;span class="command"&gt;ls -l&lt;/span&gt; again. &lt;br /&gt;
To expand the file, use the &lt;span class="command"&gt;gunzip&lt;/span&gt; command. &lt;br /&gt;
&lt;div class="cli"&gt;
% gunzip science.txt.gz &lt;/div&gt;
&lt;h3&gt;
zcat&lt;/h3&gt;
&lt;span class="command"&gt;zcat&lt;/span&gt; will read gzipped files without needing to uncompress them first.&lt;br /&gt;
&lt;div class="cli"&gt;
% zcat  science.txt.gz&lt;/div&gt;
If the text scrolls too fast for you, pipe the output though &lt;span class="command"&gt;less&lt;/span&gt; . &lt;br /&gt;
&lt;div class="cli"&gt;
% zcat  science.txt.gz | less &lt;/div&gt;
&lt;h3&gt;
file&lt;/h3&gt;
&lt;span class="command"&gt;file&lt;/span&gt; classifies the named files according to the type of data they contain, 
  for example ascii (text), pictures, compressed data, etc.. To report on all 
  files in your home directory, type &lt;br /&gt;
&lt;div class="cli"&gt;
% file * &lt;/div&gt;
&lt;h3&gt;
diff&lt;/h3&gt;
This command compares the contents of two files and displays the differences. Suppose you have a file called &lt;b&gt;file1 &lt;/b&gt;and you edit some part of it and save it as &lt;b&gt;file2&lt;/b&gt;.  To see the differences type&lt;br /&gt;
&lt;div class="cli"&gt;
% diff file1 file2 &lt;/div&gt;
Lines beginning with a &lt;b&gt;&amp;lt;&lt;/b&gt; denotes file1, while lines beginning with a &lt;b&gt;&amp;gt;&lt;/b&gt; denotes file2. &lt;br /&gt;
&lt;h3&gt;
find&lt;/h3&gt;
This searches through the directories for files and directories with a
 given name, date, size, or any other attribute you care to specify. It 
is a simple command but with many options - you can read the manual by 
typing &lt;span class="command"&gt;man&amp;nbsp;find&lt;/span&gt;. &lt;br /&gt;
To search for all fies with the extention &lt;b&gt;.txt&lt;/b&gt;, starting at 
the current directory (.) and working through all sub-directories, then 
printing the name of the file to the screen, type&lt;br /&gt;
&lt;div class="cli"&gt;
% find .  -name "*.txt" -print &lt;/div&gt;
To find files over 1Mb in size, and display the result as a long listing, type&lt;br /&gt;
&lt;div class="cli"&gt;
% find . -size +1M -ls  &lt;/div&gt;
&lt;h3&gt;
history&lt;/h3&gt;
The C shell keeps an ordered list of all the commands that you have entered. 
  Each command is given a number according to the order it was entered.&lt;br /&gt;
&lt;div class="cli"&gt;
% history (show command history list)&lt;/div&gt;
If you are using the C shell, you can use the exclamation character (&lt;b&gt;!&lt;/b&gt;) to 
  recall commands easily.&lt;br /&gt;
&lt;div class="cli"&gt;
% !! (recall last command)&lt;/div&gt;
&lt;div class="cli"&gt;
% !-3 (recall third most recent command) &lt;/div&gt;
&lt;div class="cli"&gt;
% !5 (recall 5th command in list) &lt;/div&gt;
&lt;div class="cli"&gt;
% !grep (recall last command starting with grep) &lt;/div&gt;
You can increase the size of the history buffer by typing&lt;br /&gt;
&lt;div class="cli"&gt;
% set history=100 &lt;/div&gt;
&lt;br /&gt;
&lt;div align="center" class="navbar"&gt;
&amp;nbsp; &lt;/div&gt;
&lt;div align="center"&gt;
&lt;/div&gt;
&lt;div class="date"&gt;
&lt;/div&gt;
&lt;h1&gt;
UNIX Tutorial Seven &lt;/h1&gt;
&lt;h2&gt;
7.1 Compiling UNIX software packages &amp;nbsp; &lt;/h2&gt;
We have many public domain and commercial software packages installed on our 
  systems, which are available to all users. However, students are allowed to 
  download and install small software packages in their own home directory, software 
  usually only useful to them personally. &lt;br /&gt;
There are a number of steps needed to install the software.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt; Locate and download the source code (which is usually compressed)&lt;/li&gt;
&lt;li&gt; Unpack the source code&lt;/li&gt;
&lt;li&gt; Compile the code &lt;/li&gt;
&lt;li&gt; Install the resulting executable&lt;/li&gt;
&lt;li&gt; Set paths to the installation directory &lt;/li&gt;
&lt;/ul&gt;
Of the above steps, probably the most difficult is the compilation stage.&lt;br /&gt;
&lt;h3&gt;
Compiling Source Code&lt;/h3&gt;
All high-level language code must be converted into a form the computer understands. 
  For example, C language source code is converted into a lower-level language 
  called assembly language. The assembly language code made by the previous stage 
  is then converted into object code which are fragments of code which the computer 
  understands directly. The final stage in compiling a program involves linking 
  the object code to code libraries which contain certain built-in functions. 
  This final stage produces an executable program.&lt;br /&gt;
To do all these steps by hand is complicated and beyond the capability of the 
  ordinary user. A number of utilities and tools have been developed for programmers 
  and end-users to simplify these steps.&lt;br /&gt;
&lt;h3&gt;
make and the Makefile&lt;/h3&gt;
The &lt;span class="command"&gt;make&lt;/span&gt; command allows programmers to manage large programs or 
  groups of programs. It aids in developing large programs by keeping track of 
  which portions of the entire program have been changed, compiling only those 
  parts of the program which have changed since the last compile. &lt;br /&gt;
The &lt;span class="command"&gt;make&lt;/span&gt; program gets its set of compile rules from a text file 
  called &lt;b&gt;Makefile&lt;/b&gt; which resides in the same directory as the 
  source files. It contains information on how to compile the software, e.g. the 
  optimisation level, whether to include debugging info in the executable. It 
  also contains information on where to install the finished compiled binaries 
  (executables), manual pages, data files, dependent library files, configuration 
  files, etc.&lt;br /&gt;
Some packages require you to edit the Makefile by hand to set the final installation 
  directory and any other parameters. However, many packages are now being distributed 
  with the GNU configure utility.&lt;br /&gt;
&lt;h3&gt;
configure&lt;/h3&gt;
As the number of UNIX variants increased, it became harder to write programs 
  which could run on all variants. Developers frequently did not have access to 
  every system, and the characteristics of some systems changed from version to 
  version. The GNU configure and build system simplifies the building of programs 
  distributed as source code. All programs are built using a simple, standardised, 
  two step process. The program builder need not install any special tools in 
  order to build the program. &lt;br /&gt;
The &lt;span class="command"&gt;configure&lt;/span&gt; shell script attempts to guess correct values for 
  various system-dependent variables used during compilation. It uses those values 
  to create a &lt;b&gt;Makefile&lt;/b&gt; in each directory of the package. &lt;br /&gt;
The simplest way to compile a package is:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt; &lt;span class="command"&gt;cd&lt;/span&gt; to the directory containing the package's source code.&lt;br /&gt;
  &lt;/li&gt;
&lt;li&gt; Type &lt;span class="command"&gt;./configure&lt;/span&gt; to configure the package for your system.&lt;br /&gt;
  &lt;/li&gt;
&lt;li&gt; Type &lt;span class="command"&gt;make&lt;/span&gt; to compile the package.&lt;br /&gt;
  &lt;/li&gt;
&lt;li&gt; Optionally, type &lt;span class="command"&gt;make check&lt;/span&gt; to run any self-tests that come 
    with the package.&lt;br /&gt;
  &lt;/li&gt;
&lt;li&gt; Type &lt;span class="command"&gt;make install&lt;/span&gt; to install the programs and any data files 
    and documentation.&lt;br /&gt;
  &lt;/li&gt;
&lt;li&gt; Optionally, type &lt;span class="command"&gt;make clean&lt;/span&gt; to remove the program binaries 
    and object files from the source code directory&amp;nbsp; &lt;br /&gt;
  &lt;/li&gt;
&lt;/ol&gt;
The configure utility supports a wide variety of options. You can usually use 
  the &lt;b&gt;--help&lt;/b&gt; option to get a list of interesting options for a particular 
  configure script. &lt;br /&gt;
The only generic options you are likely to use are the&lt;b&gt; --prefix&lt;/b&gt;  
  and &lt;b&gt;--exec-prefix&lt;/b&gt; options. These options are used to specify the 
  installation directories. &amp;nbsp; &lt;br /&gt;
The directory named by the &lt;b&gt;--prefix&lt;/b&gt; option will hold machine independent 
  files such as documentation, data and configuration files. &lt;br /&gt;
The directory named by the &lt;b&gt;--exec-prefix&lt;/b&gt; option, (which is normally 
  a subdirectory of the &lt;b&gt;--prefix&lt;/b&gt; directory), will hold machine dependent files 
  such as executables. &lt;br /&gt;
&lt;h2&gt;
7.2 Downloading source code&lt;/h2&gt;
For this example, we will download a piece of free software that converts between 
  different units of measurements. &lt;br /&gt;
First create a download directory&amp;nbsp; &lt;br /&gt;
&lt;div class="cli"&gt;
% mkdir download &lt;/div&gt;
&lt;a href="http://www.ee.surrey.ac.uk/Teaching/Unix/units-1.74.tar.gz"&gt;Download the software here&lt;/a&gt; and 
  save it to your new download directory.&lt;br /&gt;
&lt;h2&gt;
7.3 Extracting the source code &amp;nbsp; &lt;/h2&gt;
Go into your &lt;b&gt;download&lt;/b&gt; directory and list the contents.&lt;br /&gt;
&lt;div class="cli"&gt;
% cd download &lt;br /&gt;
% ls -l &lt;/div&gt;
As you can see, the filename ends in tar.gz. The tar command turns 
  several files and directories into one single tar file. This is then compressed 
  using the gzip command (to create a tar.gz file). &lt;br /&gt;
First unzip the file using the gunzip command. This will create 
  a .tar file.&amp;nbsp; &lt;br /&gt;
&lt;div class="cli"&gt;
% gunzip units-1.74.tar.gz &lt;/div&gt;
Then extract the contents of the tar file. &amp;nbsp; &lt;br /&gt;
&lt;div class="cli"&gt;
% tar -xvf units-1.74.tar &lt;/div&gt;
Again, list the contents of the &lt;b&gt;download&lt;/b&gt; directory, then go 
  to the &lt;b&gt;units-1.74&lt;/b&gt; sub-directory.&amp;nbsp; &lt;br /&gt;
&lt;div class="cli"&gt;
% cd units-1.74 &lt;/div&gt;
&lt;h2&gt;
7.4 Configuring and creating the Makefile &amp;nbsp; &lt;/h2&gt;
The first thing to do is carefully read the &lt;b&gt;README&lt;/b&gt; and &lt;b&gt;INSTALL&lt;/b&gt; 
  text files (use the less command). These contain important information 
  on how to compile and run the software.&lt;br /&gt;
The units package uses the GNU configure system to compile the source code. 
  We will need to specify the installation directory, since the default will be 
  the main system area which you will not have write permissions for. We need 
  to create an install directory in your home directory. &amp;nbsp; &lt;br /&gt;
&lt;div class="cli"&gt;
% mkdir ~/units174&lt;/div&gt;
Then run the configure utility setting the installation path to this.&lt;br /&gt;
&lt;div class="cli"&gt;
% ./configure --prefix=$HOME/units174&lt;/div&gt;
&lt;div class="hint"&gt;
NOTE: 
  The &lt;b&gt;$HOME&lt;/b&gt; variable is an example of an environment variable. 
  
  The value of &lt;b&gt;$HOME&lt;/b&gt; is the path to your home directory. Just 
  type &lt;br /&gt;
&lt;br /&gt;
&lt;span class="command"&gt;% echo $HOME &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
to show the contents of this variable. We will learn more about environment 
  variables in a later chapter.&lt;/div&gt;
If &lt;span class="command"&gt;configure&lt;/span&gt; has run correctly, it will have created a Makefile with all necessary 
  options. You can view the Makefile if you wish (use the &lt;span class="command"&gt;less&lt;/span&gt; command), 
  but do not edit the contents of this. &lt;br /&gt;
&lt;h2&gt;
7.5 Building the package&amp;nbsp; &lt;/h2&gt;
Now you can go ahead and build the package by running the make 
  command.&amp;nbsp; &lt;br /&gt;
&lt;div class="cli"&gt;
% make&lt;/div&gt;
After a minute or two (depending on the speed of the computer), the executables 
  will be created. You can check to see everything compiled successfully by typing&lt;br /&gt;
&lt;div class="cli"&gt;
% make check&lt;/div&gt;
If everything is okay, you can now install the package. &amp;nbsp; &lt;br /&gt;
&lt;div class="cli"&gt;
% make install&lt;/div&gt;
This will install the files into the &lt;b&gt;~/units174&lt;/b&gt; directory 
  you created earlier.&lt;br /&gt;
&lt;h2&gt;
7.6 Running the software&lt;/h2&gt;
You are now ready to run the software (assuming everything worked).&amp;nbsp; &lt;br /&gt;
&lt;div class="cli"&gt;
% cd ~/units174&lt;/div&gt;
If you list the contents of the units directory, you will see a number of subdirectories.&lt;br /&gt;
&lt;table align="center" border="1" cellpadding="4" cellspacing="0"&gt;
  &lt;tbody&gt;
&lt;tr&gt; 
    &lt;td&gt;bin&lt;/td&gt;
    &lt;td&gt;The binary executables&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td&gt;info&lt;/td&gt;
    &lt;td&gt;GNU info formatted documentation&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td&gt;man&lt;/td&gt;
    &lt;td&gt;Man pages&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt; 
    &lt;td&gt;share&lt;/td&gt;
    &lt;td&gt;Shared data files&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
To run the program, change to the &lt;b&gt;bin&lt;/b&gt; directory and type&lt;br /&gt;
&lt;div class="cli"&gt;
% ./units &lt;/div&gt;
As an example, convert 6 feet to metres.&amp;nbsp; &lt;br /&gt;
&lt;div class="cli"&gt;
You have: 6 feet&lt;br /&gt;
You want: metres&amp;nbsp; &lt;/div&gt;
&lt;div class="output"&gt;
* 1.8288 &lt;/div&gt;
If you get the answer 1.8288, congratulations, it worked.&lt;br /&gt;
To view what units it can convert between, view the data file in the share 
  directory (the list is quite comprehensive).&lt;br /&gt;
To read the full documentation, change into the &lt;b&gt;info&lt;/b&gt; directory 
  and type&amp;nbsp; &lt;br /&gt;
&lt;div class="cli"&gt;
% info --file=units.info&lt;/div&gt;
&lt;h2&gt;
7.7 Stripping unnecessary code&lt;/h2&gt;
When a piece of software is being developed, it is useful for the programmer 
  to include debugging information into the resulting executable. This way, if 
  there are problems encountered when running the executable, the programmer can 
  load the executable into a debugging software package and track down any software 
  bugs.&lt;br /&gt;
This is useful for the programmer, but unnecessary for the user. We can assume 
  that the package, once finished and available for download has already been 
  tested and debugged. However, when we compiled the software above, debugging 
  information was still compiled into the final executable. Since it is unlikey 
  that we are going to need this debugging information, we can strip it out of 
  the final executable. One of the advantages of this is a much smaller executable, 
  which should run slightly faster.&lt;br /&gt;
What we are going to do is look at the before and after size of the binary 
  file. First change into the &lt;b&gt;bin&lt;/b&gt; directory of the units installation 
  directory.&amp;nbsp; &lt;br /&gt;
&lt;div class="cli"&gt;
% cd ~/units174/bin&lt;br /&gt;
% ls -l &lt;/div&gt;
As you can see, the file is over 100 kbytes in size. You can get more information 
  on the type of file by using the file command.&amp;nbsp; &lt;br /&gt;
&lt;div class="cli"&gt;
% file units&lt;/div&gt;
&lt;div class="output"&gt;
units: ELF 32-bit LSB executable, Intel 80386, version 1, dynamically 
  linked (uses shared libs), not stripped&lt;/div&gt;
To strip all the debug and line numbering information out of the binary file, 
  use the strip command&amp;nbsp; &lt;br /&gt;
&lt;div class="cli"&gt;
% strip units&lt;br /&gt;
% ls -l &lt;/div&gt;
As you can see, the file is now 36 kbytes - a third of its original size. Two 
  thirds of the binary file was debug code!!!&lt;br /&gt;
Check the file information again.&amp;nbsp; &lt;br /&gt;
&lt;div class="cli"&gt;
% file units&lt;/div&gt;
&lt;div class="output"&gt;
units: ELF 32-bit LSB executable, Intel 80386, version 1, dynamically 
  linked (uses shared libs), stripped&lt;/div&gt;
Sometimes you can use the &lt;span class="command"&gt;make&lt;/span&gt; command to install pre-stripped copies 
  of all the binary files when you install the package. 
  
  Instead of typing &lt;span class="command"&gt;make install&lt;/span&gt;, simply type &lt;span class="command"&gt;make install-strip&lt;/span&gt;&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><enclosure length="178224" type="application/x-gzip" url="http://www.ee.surrey.ac.uk/Teaching/Unix/units-1.74.tar.gz"/><itunes:explicit>no</itunes:explicit><itunes:subtitle>UNIX Tutorial One 1.1 Listing files and directories ls (list) When you first login, your current working directory is your home directory. Your home directory has the same name as your user-name, for example, ee91ab, and it is where your personal files and subdirectories are saved. To find out what is in your home directory, type % ls The ls command ( lowercase L and lowercase S ) lists the contents of your current working directory. There may be no files visible in your home directory, in which case, the UNIX prompt will be returned. Alternatively, there may already be some files inserted by the System Administrator when your account was created. ls does not, in fact, cause all the files in your home directory to be listed, but only those ones whose name does not begin with a dot (.) Files beginning with a dot (.) are known as hidden files and usually contain important program configuration information. They are hidden because you should not change them unless you are very familiar with UNIX!!! To list all files in your home directory including those whose names begin with a dot, type % ls -a As you can see, ls -a lists files that are normally hidden. ls is an example of a command which can take options: -a is an example of an option. The options change the behaviour of the command. There are online manual pages that tell you which options a particular command can take, and how each option modifies the behaviour of the command. (See later in this tutorial) 1.2 Making Directories mkdir (make directory) We will now make a subdirectory in your home directory to hold the files you will be creating and using in the course of this tutorial. To make a subdirectory called unixstuff in your current working directory type % mkdir unixstuff To see the directory you have just created, type % ls 1.3 Changing to a different directory&amp;nbsp; cd (change directory) The command cd directory means change the current working directory to 'directory'. The current working directory may be thought of as the directory you are in, i.e. your current position in the file-system tree. To change to the directory you have just made, type % cd unixstuff Type ls to see the contents (which should be empty) Exercise 1a Make another directory inside the unixstuff directory called backups 1.4 The directories . and .. Still in the unixstuff directory, type % ls -a As you can see, in the unixstuff directory (and in all other directories), there are two special directories called (.) and (..) The current directory (.) In UNIX, (.) means the current directory, so typing % cd . NOTE: there is a space between cd and the dot means stay where you are (the unixstuff directory). This may not seem very useful at first, but using (.) as the name of the current directory will save a lot of typing, as we shall see later in the tutorial. The parent directory (..) (..) means the parent of the current directory, so typing % cd .. will take you one directory up the hierarchy (back to your home directory). Try it now. Note: typing cd with no argument always returns you to your home directory. This is very useful if you are lost in the file system. 1.5 Pathnames pwd (print working directory) Pathnames enable you to work out where you are in relation to the whole file-system. For example, to find out the absolute pathname of your home-directory, type cd to get back to your home-directory and then type % pwd The full pathname will look something like this - /home/its/ug1/ee51vn which means that ee51vn (your home directory) is in the sub-directory ug1 (the group directory),which in turn is located in the its sub-directory, which is in the home sub-directory, which is in the top-level root directory called " / " . Exercise 1b Use the commands cd, ls and pwd to explore the file system. (Remember, if you get lost, type cd by itself to return to your home-directory) 1.6 More about home directories and pathnames Understanding pathnames First type cd to get back to your home-directory, then type % ls unixstuff to list the conents of your unixstuff directory. Now type % ls backups You will get a message like this - backups: No such file or directory The reason is, backups is not in your current working directory. To use a command on a file (or directory) not in the current working directory (the directory you are currently in), you must either cd to the correct directory, or specify its full pathname. To list the contents of your backups directory, you must type % ls unixstuff/backups ~ (your home directory) Home directories can also be referred to by the tilde ~ character. It can be used to specify paths starting at your home directory. So typing % ls ~/unixstuff will list the contents of your unixstuff directory, no matter where you currently are in the file system. What do you think % ls ~ would list? What do you think % ls ~/.. would list? Summary Command Meaning ls list files and directories ls -a list all files and directories mkdir make a directory cd directory change to named directory cd change to home-directory cd ~ change to home-directory cd .. change to parent directory pwd display the path of the current directory UNIX Tutorial Two 2.1 Copying Files cp (copy) cp file1 file2 is the command which makes a copy of file1 in the current working directory and calls it file2 What we are going to do now, is to take a file stored in an open access area of the file system, and use the cp command to copy it to your unixstuff directory. First, cd to your unixstuff directory. % cd ~/unixstuff Then at the UNIX prompt, type, % cp /vol/examples/tutorial/science.txt . Note: Don't forget the dot . at the end. Remember, in UNIX, the dot means the current directory. The above command means copy the file science.txt to the current directory, keeping the name the same. (Note: The directory /vol/examples/tutorial/ is an area to which everyone in the school has read and copy access. If you are from outside the University, you can grab a copy of the file here. Use 'File/Save As..' from the menu bar to save it into your unixstuff directory.) Exercise 2a Create a backup of your science.txt file by copying it to a file called science.bak 2.2 Moving files mv (move) mv file1 file2 moves (or renames) file1 to file2 To move a file from one place to another, use the mv command. This has the effect of moving rather than copying the file, so you end up with only one file rather than two. It can also be used to rename a file, by moving the file to the same directory, but giving it a different name. We are now going to move the file science.bak to your backup directory. First, change directories to your unixstuff directory (can you remember how?). Then, inside the unixstuff directory, type % mv science.bak backups/. Type ls and ls backups to see if it has worked. 2.3 Removing files and directories rm (remove), rmdir (remove directory) To delete (remove) a file, use the rm command. As an example, we are going to create a copy of the science.txt file then delete it. Inside your unixstuff directory, type % cp science.txt tempfile.txt % ls % rm tempfile.txt % ls You can use the rmdir command to remove a directory (make sure it is empty first). Try to remove the backups directory. You will not be able to since UNIX will not let you remove a non-empty directory. Exercise 2b Create a directory called tempstuff using mkdir , then remove it using the rmdir command. 2.4 Displaying the contents of a file on the screen clear (clear screen) Before you start the next section, you may like to clear the terminal window of the previous commands so the output of the following commands can be clearly understood. At the prompt, type % clear This will clear all text and leave you with the % prompt at the top of the window. cat (concatenate) The command cat can be used to display the contents of a file on the screen. Type: % cat science.txt As you can see, the file is longer than than the size of the window, so it scrolls past making it unreadable. less The command less writes the contents of a file onto the screen a page at a time. Type % less science.txt Press the [space-bar] if you want to see another page, and type [q] if you want to quit reading. As you can see, less is used in preference to cat for long files. head The head command writes the first ten lines of a file to the screen. First clear the screen then type % head science.txt Then type % head -5 science.txt What difference did the -5 do to the head command? tail The tail command writes the last ten lines of a file to the screen. Clear the screen and type % tail science.txt Q. How can you view the last 15 lines of the file? 2.5 Searching the contents of a file Simple searching using less Using less, you can search though a text file for a keyword (pattern). For example, to search through science.txt for the word 'science', type % less science.txt then, still in less, type a forward slash [/] followed by the word to search /science As you can see, less finds and highlights the keyword. Type [n] to search for the next occurrence of the word. grep (don't ask why it is called grep) grep is one of many standard UNIX utilities. It searches files for specified words or patterns. First clear the screen, then type % grep science science.txt As you can see, grep has printed out each line containg the word science. Or has it ???? Try typing % grep Science science.txt The grep command is case sensitive; it distinguishes between Science and science. To ignore upper/lower case distinctions, use the -i option, i.e. type % grep -i science science.txt To search for a phrase or pattern, you must enclose it in single quotes (the apostrophe symbol). For example to search for spinning top, type % grep -i 'spinning top' science.txt Some of the other options of grep are: -v display those lines that do NOT match -n precede each matching line with the line number -c print only the total count of matched lines Try some of them and see the different results. Don't forget, you can use more than one option at a time. For example, the number of lines without the words science or Science is % grep -ivc science science.txt wc (word count) A handy little utility is the wc command, short for word count. To do a word count on science.txt, type % wc -w science.txt To find out how many lines the file has, type % wc -l science.txt Summary Command Meaning cp file1 file2 copy file1 and call it file2 mv file1 file2 move or rename file1 to file2 rm file remove a file rmdir directory remove a directory cat file display a file less file display a file a page at a time head file display the first few lines of a file tail file display the last few lines of a file grep 'keyword' file search a file for keywords wc file count number of lines/words/characters in file UNIX Tutorial Three 3.1 Redirection &amp;nbsp; Most processes initiated by UNIX commands write to the standard output (that is, they write to the terminal screen), and many take their input from the standard input (that is, they read it from the keyboard). There is also the standard error, where processes write their error messages, by default, to the terminal screen. We have already seen one use of the cat command to write the contents of a file to the screen. Now type cat without specifing a file to read % cat Then type a few words on the keyboard and press the [Return] key. Finally hold the [Ctrl] key down and press [d] (written as ^D for short) to end the input. What has happened? If you run the cat command without specifing a file to read, it reads the standard input (the keyboard), and on receiving the 'end of file' (^D), copies it to the standard output (the screen). In UNIX, we can redirect both the input and the output of commands. 3.2 Redirecting the Output &amp;nbsp; We use the &amp;gt; symbol to redirect the output of a command. For example, to create a file called list1 containing a list of fruit, type &amp;nbsp; % cat &amp;gt; list1 Then type in the names of some fruit. Press [Return] after each one. pear banana apple ^D {this means press [Ctrl] and [d] to stop} What happens is the cat command reads the standard input (the keyboard) and the &amp;gt; redirects the output, which normally goes to the screen, into a file called list1 To read the contents of the file, type % cat list1 Exercise 3a Using the above method, create another file called list2 containing the following fruit: orange, plum, mango, grapefruit. Read the contents of list2 3.2.1 Appending to a file The form &amp;gt;&amp;gt; appends standard output to a file. So to add more items to the file list1, type % cat &amp;gt;&amp;gt; list1 Then type in the names of more fruit peach grape orange ^D (Control D to stop) To read the contents of the file, type % cat list1 You should now have two files. One contains six fruit, the other contains four fruit. We will now use the cat command to join (concatenate) list1 and list2 into a new file called biglist. Type % cat list1 list2 &amp;gt; biglist What this is doing is reading the contents of list1 and list2 in turn, then outputing the text to the file biglist To read the contents of the new file, type % cat biglist 3.3 Redirecting the Input &amp;nbsp; We use the &amp;lt; symbol to redirect the input of a command. The command sort alphabetically or numerically sorts a list. Type % sort Then type in the names of some animals. Press [Return] after each one. dog cat bird ape ^D (control d to stop) The output will be ape bird cat dog Using &amp;lt; you can redirect the input to come from a file rather than the keyboard. For example, to sort the list of fruit, type % sort &amp;lt; biglist and the sorted list will be output to the screen. To output the sorted list to a file, type, % sort &amp;lt; biglist &amp;gt; slist Use cat to read the contents of the file slist 3.4 Pipes To see who is on the system with you, type % who One method to get a sorted list of names is to type, % who &amp;gt; names.txt % sort &amp;lt; names.txt This is a bit slow and you have to remember to remove the temporary file called names when you have finished. What you really want to do is connect the output of the who command directly to the input of the sort command. This is exactly what pipes do. The symbol for a pipe is the vertical bar | For example, typing % who | sort will give the same result as above, but quicker and cleaner. To find out how many users are logged on, type % who | wc -l Exercise 3b Using pipes, display all lines of list1 and list2 containing the letter 'p', and sort the result. Answer available here Summary Command Meaning command &amp;gt; file redirect standard output to a file command &amp;gt;&amp;gt; file append standard output to a file command &amp;lt; file redirect standard input from a file command1 | command2 pipe the output of command1 to the input of command2 cat file1 file2 &amp;gt; file0 concatenate file1 and file2 to file0 sort sort data who list users currently logged in UNIX Tutorial Four 4.1 Wildcards The * wildcard The character * is called a wildcard, and will match against none or more character(s) in a file (or directory) name. For example, in your unixstuff directory, type % ls list* This will list all files in the current directory starting with list.... Try typing % ls *list This will list all files in the current directory ending with ....list The ? wildcard The character ? will match exactly one character. So ?ouse will match files like house and mouse, but not grouse. Try typing % ls ?list 4.2 Filename conventions We should note here that a directory is merely a special type of file. So the rules and conventions for naming files apply also to directories. In naming files, characters with special meanings such as / * &amp;amp; % , should be avoided. Also, avoid using spaces within names. The safest way to name a file is to use only alphanumeric characters, that is, letters and numbers, together with _ (underscore) and . (dot). Good filenames Bad filenames project.txt project my_big_program.c my big program.c fred_dave.doc fred &amp;amp; dave.doc File names conventionally start with a lower-case letter, and may end with a dot followed by a group of letters indicating the contents of the file. For example, all files consisting of C code may be named with the ending .c, for example, prog1.c . Then in order to list all files containing C code in your home directory, you need only type ls&amp;nbsp;*.c in that directory. 4.3 Getting Help On-line Manuals There are on-line manuals which gives information about most commands. The manual pages tell you which options a particular command can take, and how each option modifies the behaviour of the command. Type man&amp;nbsp;command to read the manual page for a particular command. For example, to find out more about the wc (word count) command, type % man wc Alternatively % whatis wc gives a one-line description of the command, but omits any information about options etc. Apropos When you are not sure of the exact name of a command, % apropos keyword will give you the commands with keyword in their manual page header. For example, try typing % apropos copy Summary Command Meaning * match any number of characters ? match one character man command read the online manual page for a command whatis command brief description of a command apropos keyword match commands with keyword in their man pages &amp;nbsp; UNIX Tutorial Five 5.1 File system security (access rights) In your unixstuff directory, type % ls -l (l for long listing!) You will see that you now get lots of details about the contents of your directory, similar to the example below. Each file (and directory) has associated access rights, which may be found by typing ls -l. Also, ls -lg gives additional information as to which group owns the file (beng95 in the following example): -rwxrw-r-- 1 ee51ab beng95 2450 Sept29 11:52 file1 In the left-hand column is a 10 symbol string consisting of the symbols d, r, w, x, -, and, occasionally, s or S. If d is present, it will be at the left hand end of the string, and indicates a directory: otherwise - will be the starting symbol of the string. The 9 remaining symbols indicate the permissions, or access rights, and are taken as three groups of 3. The left group of 3 gives the file permissions for the user that owns the file (or directory) (ee51ab in the above example); the middle group gives the permissions for the group of people to whom the file (or directory) belongs (eebeng95 in the above example); the rightmost group gives the permissions for all others. The symbols r, w, etc., have slightly different meanings depending on whether they refer to a simple file or to a directory. Access rights on files. r (or -), indicates read permission (or otherwise), that is, the presence or absence of permission to read and copy the file w (or -), indicates write permission (or otherwise), that is, the permission (or otherwise) to change a file x (or -), indicates execution permission (or otherwise), that is, the permission to execute a file, where appropriate Access rights on directories. r allows users to list files in the directory; w means that users may delete files from the directory or move files into it; x means the right to access files in the directory. This implies that you may read files in the directory provided you have read permission on the individual files. So, in order to read a file, you must have execute permission on the directory containing that file, and hence on any directory containing that directory as a subdirectory, and so on, up the tree. Some examples -rwxrwxrwx a file that everyone can read, write and execute (and delete). -rw------- a file that only the owner can read and write - no-one else can read or write and no-one has execution rights (e.g. your mailbox file). 5.2 Changing access rights chmod (changing a file mode) Only the owner of a file can use chmod to change the permissions of a file. The options of chmod are as follows Symbol Meaning u user g group o other a all r read w write (and delete) x execute (and access directory) + add permission - take away permission For example, to remove read write and execute permissions on the file biglist for the group and others, type % chmod go-rwx biglist This will leave the other permissions unaffected. To give read and write permissions on the file biglist to all, % chmod a+rw biglist Exercise 5a Try changing access permissions on the file science.txt and on the directory backups Use ls -l to check that the permissions have changed. 5.3 Processes and Jobs A process is an executing program identified by a unique PID (process identifier). To see information about your processes, with their associated PID and status, type % ps A process may be in the foreground, in the background, or be suspended. In general the shell does not return the UNIX prompt until the current process has finished executing. Some processes take a long time to run and hold up the terminal. Backgrounding a long process has the effect that the UNIX prompt is returned immediately, and other tasks can be carried out while the original process continues executing. Running background processes To background a process, type an &amp;amp; at the end of the command line. For example, the command sleep waits a given number of seconds before continuing. Type % sleep 10 This will wait 10 seconds before returning the command prompt %. Until the command prompt is returned, you can do nothing except wait. To run sleep in the background, type % sleep 10 &amp;amp; [1] 6259 The &amp;amp; runs the job in the background and returns the prompt straight away, allowing you do run other programs while waiting for that one to finish. The first line in the above example is typed in by the user; the next line, indicating job number and PID, is returned by the machine. The user is be notified of a job number (numbered from 1) enclosed in square brackets, together with a PID and is notified when a background process is finished. Backgrounding is useful for jobs which will take a long time to complete. Backgrounding a current foreground process At the prompt, type % sleep 1000 You can suspend the process running in the foreground by typing ^Z, i.e.hold down the [Ctrl] key and type [z]. Then to put it in the background, type % bg Note: do not background programs that require user interaction e.g. vi 5.4 Listing suspended and background processes When a process is running, backgrounded or suspended, it will be entered onto a list along with a job number. To examine this list, type % jobs An example of a job list could be [1] Suspended sleep 1000 [2] Running netscape [3] Running matlab To restart (foreground) a suspended processes, type % fg %jobnumber For example, to restart sleep 1000, type % fg %1 Typing fg with no job number foregrounds the last suspended process. 5.5 Killing a process kill (terminate or signal a process) It is sometimes necessary to kill a process (for example, when an executing program is in an infinite loop) To kill a job running in the foreground, type ^C (control c). For example, run % sleep 100 ^C To kill a suspended or background process, type % kill %jobnumber For example, run % sleep 100 &amp;amp; % jobs If it is job number 4, type % kill %4 To check whether this has worked, examine the job list again to see if the process has been removed. ps (process status) Alternatively, processes can be killed by finding their process numbers (PIDs) and using kill PID_number % sleep 1000 &amp;amp; % ps PID TT S TIME COMMAND 20077 pts/5 S 0:05 sleep 1000 21563 pts/5 T 0:00 netscape 21873 pts/5 S 0:25 nedit To kill off the process sleep 1000, type % kill 20077 and then type ps again to see if it has been removed from the list. If a process refuses to be killed, uses the -9 option, i.e. type % kill -9 20077 Note: It is not possible to kill off other users' processes !!! Summary Command Meaning ls -lag list access rights for all files chmod [options] file change access rights for named file command &amp;amp; run command in background ^C kill the job running in the foreground ^Z suspend the job running in the foreground bg background the suspended job jobs list current jobs fg %1 foreground job number 1 kill %1 kill job number 1 ps list current processes kill 26152 kill process number 26152 UNIX Tutorial Six Other useful UNIX commands &amp;nbsp; quota All students are allocated a certain amount of disk space on the file system for their personal files, usually about 100Mb. If you go over your quota, you are given 7 days to remove excess files. To check your current quota and how much of it you have used, type % quota -v df The df command reports on the space left on the file system. For example, to find out how much space is left on the fileserver, type % df . du The du command outputs the number of kilobyes used by each subdirectory. Useful if you have gone over quota and you want to find out which directory has the most files. In your home-directory, type % du -s * The -s flag will display only a summary (total size) and the * means all files and directories. gzip This reduces the size of a file, thus freeing valuable disk space. For example, type % ls -l science.txt and note the size of the file using ls -l . Then to compress science.txt, type % gzip science.txt This will compress the file and place it in a file called science.txt.gz To see the change in size, type ls -l again. To expand the file, use the gunzip command. % gunzip science.txt.gz zcat zcat will read gzipped files without needing to uncompress them first. % zcat science.txt.gz If the text scrolls too fast for you, pipe the output though less . % zcat science.txt.gz | less file file classifies the named files according to the type of data they contain, for example ascii (text), pictures, compressed data, etc.. To report on all files in your home directory, type % file * diff This command compares the contents of two files and displays the differences. Suppose you have a file called file1 and you edit some part of it and save it as file2. To see the differences type % diff file1 file2 Lines beginning with a &amp;lt; denotes file1, while lines beginning with a &amp;gt; denotes file2. find This searches through the directories for files and directories with a given name, date, size, or any other attribute you care to specify. It is a simple command but with many options - you can read the manual by typing man&amp;nbsp;find. To search for all fies with the extention .txt, starting at the current directory (.) and working through all sub-directories, then printing the name of the file to the screen, type % find . -name "*.txt" -print To find files over 1Mb in size, and display the result as a long listing, type % find . -size +1M -ls history The C shell keeps an ordered list of all the commands that you have entered. Each command is given a number according to the order it was entered. % history (show command history list) If you are using the C shell, you can use the exclamation character (!) to recall commands easily. % !! (recall last command) % !-3 (recall third most recent command) % !5 (recall 5th command in list) % !grep (recall last command starting with grep) You can increase the size of the history buffer by typing % set history=100 &amp;nbsp; UNIX Tutorial Seven 7.1 Compiling UNIX software packages &amp;nbsp; We have many public domain and commercial software packages installed on our systems, which are available to all users. However, students are allowed to download and install small software packages in their own home directory, software usually only useful to them personally. There are a number of steps needed to install the software. Locate and download the source code (which is usually compressed) Unpack the source code Compile the code Install the resulting executable Set paths to the installation directory Of the above steps, probably the most difficult is the compilation stage. Compiling Source Code All high-level language code must be converted into a form the computer understands. For example, C language source code is converted into a lower-level language called assembly language. The assembly language code made by the previous stage is then converted into object code which are fragments of code which the computer understands directly. The final stage in compiling a program involves linking the object code to code libraries which contain certain built-in functions. This final stage produces an executable program. To do all these steps by hand is complicated and beyond the capability of the ordinary user. A number of utilities and tools have been developed for programmers and end-users to simplify these steps. make and the Makefile The make command allows programmers to manage large programs or groups of programs. It aids in developing large programs by keeping track of which portions of the entire program have been changed, compiling only those parts of the program which have changed since the last compile. The make program gets its set of compile rules from a text file called Makefile which resides in the same directory as the source files. It contains information on how to compile the software, e.g. the optimisation level, whether to include debugging info in the executable. It also contains information on where to install the finished compiled binaries (executables), manual pages, data files, dependent library files, configuration files, etc. Some packages require you to edit the Makefile by hand to set the final installation directory and any other parameters. However, many packages are now being distributed with the GNU configure utility. configure As the number of UNIX variants increased, it became harder to write programs which could run on all variants. Developers frequently did not have access to every system, and the characteristics of some systems changed from version to version. The GNU configure and build system simplifies the building of programs distributed as source code. All programs are built using a simple, standardised, two step process. The program builder need not install any special tools in order to build the program. The configure shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a Makefile in each directory of the package. The simplest way to compile a package is: cd to the directory containing the package's source code. Type ./configure to configure the package for your system. Type make to compile the package. Optionally, type make check to run any self-tests that come with the package. Type make install to install the programs and any data files and documentation. Optionally, type make clean to remove the program binaries and object files from the source code directory&amp;nbsp; The configure utility supports a wide variety of options. You can usually use the --help option to get a list of interesting options for a particular configure script. The only generic options you are likely to use are the --prefix and --exec-prefix options. These options are used to specify the installation directories. &amp;nbsp; The directory named by the --prefix option will hold machine independent files such as documentation, data and configuration files. The directory named by the --exec-prefix option, (which is normally a subdirectory of the --prefix directory), will hold machine dependent files such as executables. 7.2 Downloading source code For this example, we will download a piece of free software that converts between different units of measurements. First create a download directory&amp;nbsp; % mkdir download Download the software here and save it to your new download directory. 7.3 Extracting the source code &amp;nbsp; Go into your download directory and list the contents. % cd download % ls -l As you can see, the filename ends in tar.gz. The tar command turns several files and directories into one single tar file. This is then compressed using the gzip command (to create a tar.gz file). First unzip the file using the gunzip command. This will create a .tar file.&amp;nbsp; % gunzip units-1.74.tar.gz Then extract the contents of the tar file. &amp;nbsp; % tar -xvf units-1.74.tar Again, list the contents of the download directory, then go to the units-1.74 sub-directory.&amp;nbsp; % cd units-1.74 7.4 Configuring and creating the Makefile &amp;nbsp; The first thing to do is carefully read the README and INSTALL text files (use the less command). These contain important information on how to compile and run the software. The units package uses the GNU configure system to compile the source code. We will need to specify the installation directory, since the default will be the main system area which you will not have write permissions for. We need to create an install directory in your home directory. &amp;nbsp; % mkdir ~/units174 Then run the configure utility setting the installation path to this. % ./configure --prefix=$HOME/units174 NOTE: The $HOME variable is an example of an environment variable. The value of $HOME is the path to your home directory. Just type % echo $HOME to show the contents of this variable. We will learn more about environment variables in a later chapter. If configure has run correctly, it will have created a Makefile with all necessary options. You can view the Makefile if you wish (use the less command), but do not edit the contents of this. 7.5 Building the package&amp;nbsp; Now you can go ahead and build the package by running the make command.&amp;nbsp; % make After a minute or two (depending on the speed of the computer), the executables will be created. You can check to see everything compiled successfully by typing % make check If everything is okay, you can now install the package. &amp;nbsp; % make install This will install the files into the ~/units174 directory you created earlier. 7.6 Running the software You are now ready to run the software (assuming everything worked).&amp;nbsp; % cd ~/units174 If you list the contents of the units directory, you will see a number of subdirectories. bin The binary executables info GNU info formatted documentation man Man pages share Shared data files To run the program, change to the bin directory and type % ./units As an example, convert 6 feet to metres.&amp;nbsp; You have: 6 feet You want: metres&amp;nbsp; * 1.8288 If you get the answer 1.8288, congratulations, it worked. To view what units it can convert between, view the data file in the share directory (the list is quite comprehensive). To read the full documentation, change into the info directory and type&amp;nbsp; % info --file=units.info 7.7 Stripping unnecessary code When a piece of software is being developed, it is useful for the programmer to include debugging information into the resulting executable. This way, if there are problems encountered when running the executable, the programmer can load the executable into a debugging software package and track down any software bugs. This is useful for the programmer, but unnecessary for the user. We can assume that the package, once finished and available for download has already been tested and debugged. However, when we compiled the software above, debugging information was still compiled into the final executable. Since it is unlikey that we are going to need this debugging information, we can strip it out of the final executable. One of the advantages of this is a much smaller executable, which should run slightly faster. What we are going to do is look at the before and after size of the binary file. First change into the bin directory of the units installation directory.&amp;nbsp; % cd ~/units174/bin % ls -l As you can see, the file is over 100 kbytes in size. You can get more information on the type of file by using the file command.&amp;nbsp; % file units units: ELF 32-bit LSB executable, Intel 80386, version 1, dynamically linked (uses shared libs), not stripped To strip all the debug and line numbering information out of the binary file, use the strip command&amp;nbsp; % strip units % ls -l As you can see, the file is now 36 kbytes - a third of its original size. Two thirds of the binary file was debug code!!! Check the file information again.&amp;nbsp; % file units units: ELF 32-bit LSB executable, Intel 80386, version 1, dynamically linked (uses shared libs), stripped Sometimes you can use the make command to install pre-stripped copies of all the binary files when you install the package. Instead of typing make install, simply type make install-strip</itunes:subtitle><itunes:author>noreply@blogger.com (Hamid)</itunes:author><itunes:summary>UNIX Tutorial One 1.1 Listing files and directories ls (list) When you first login, your current working directory is your home directory. Your home directory has the same name as your user-name, for example, ee91ab, and it is where your personal files and subdirectories are saved. To find out what is in your home directory, type % ls The ls command ( lowercase L and lowercase S ) lists the contents of your current working directory. There may be no files visible in your home directory, in which case, the UNIX prompt will be returned. Alternatively, there may already be some files inserted by the System Administrator when your account was created. ls does not, in fact, cause all the files in your home directory to be listed, but only those ones whose name does not begin with a dot (.) Files beginning with a dot (.) are known as hidden files and usually contain important program configuration information. They are hidden because you should not change them unless you are very familiar with UNIX!!! To list all files in your home directory including those whose names begin with a dot, type % ls -a As you can see, ls -a lists files that are normally hidden. ls is an example of a command which can take options: -a is an example of an option. The options change the behaviour of the command. There are online manual pages that tell you which options a particular command can take, and how each option modifies the behaviour of the command. (See later in this tutorial) 1.2 Making Directories mkdir (make directory) We will now make a subdirectory in your home directory to hold the files you will be creating and using in the course of this tutorial. To make a subdirectory called unixstuff in your current working directory type % mkdir unixstuff To see the directory you have just created, type % ls 1.3 Changing to a different directory&amp;nbsp; cd (change directory) The command cd directory means change the current working directory to 'directory'. The current working directory may be thought of as the directory you are in, i.e. your current position in the file-system tree. To change to the directory you have just made, type % cd unixstuff Type ls to see the contents (which should be empty) Exercise 1a Make another directory inside the unixstuff directory called backups 1.4 The directories . and .. Still in the unixstuff directory, type % ls -a As you can see, in the unixstuff directory (and in all other directories), there are two special directories called (.) and (..) The current directory (.) In UNIX, (.) means the current directory, so typing % cd . NOTE: there is a space between cd and the dot means stay where you are (the unixstuff directory). This may not seem very useful at first, but using (.) as the name of the current directory will save a lot of typing, as we shall see later in the tutorial. The parent directory (..) (..) means the parent of the current directory, so typing % cd .. will take you one directory up the hierarchy (back to your home directory). Try it now. Note: typing cd with no argument always returns you to your home directory. This is very useful if you are lost in the file system. 1.5 Pathnames pwd (print working directory) Pathnames enable you to work out where you are in relation to the whole file-system. For example, to find out the absolute pathname of your home-directory, type cd to get back to your home-directory and then type % pwd The full pathname will look something like this - /home/its/ug1/ee51vn which means that ee51vn (your home directory) is in the sub-directory ug1 (the group directory),which in turn is located in the its sub-directory, which is in the home sub-directory, which is in the top-level root directory called " / " . Exercise 1b Use the commands cd, ls and pwd to explore the file system. (Remember, if you get lost, type cd by itself to return to your home-directory) 1.6 More about home directories and pathnames Understanding pathnames First type cd to get back to your home-directory, then type % ls unixstuff to list the conents of your unixstuff directory. Now type % ls backups You will get a message like this - backups: No such file or directory The reason is, backups is not in your current working directory. To use a command on a file (or directory) not in the current working directory (the directory you are currently in), you must either cd to the correct directory, or specify its full pathname. To list the contents of your backups directory, you must type % ls unixstuff/backups ~ (your home directory) Home directories can also be referred to by the tilde ~ character. It can be used to specify paths starting at your home directory. So typing % ls ~/unixstuff will list the contents of your unixstuff directory, no matter where you currently are in the file system. What do you think % ls ~ would list? What do you think % ls ~/.. would list? Summary Command Meaning ls list files and directories ls -a list all files and directories mkdir make a directory cd directory change to named directory cd change to home-directory cd ~ change to home-directory cd .. change to parent directory pwd display the path of the current directory UNIX Tutorial Two 2.1 Copying Files cp (copy) cp file1 file2 is the command which makes a copy of file1 in the current working directory and calls it file2 What we are going to do now, is to take a file stored in an open access area of the file system, and use the cp command to copy it to your unixstuff directory. First, cd to your unixstuff directory. % cd ~/unixstuff Then at the UNIX prompt, type, % cp /vol/examples/tutorial/science.txt . Note: Don't forget the dot . at the end. Remember, in UNIX, the dot means the current directory. The above command means copy the file science.txt to the current directory, keeping the name the same. (Note: The directory /vol/examples/tutorial/ is an area to which everyone in the school has read and copy access. If you are from outside the University, you can grab a copy of the file here. Use 'File/Save As..' from the menu bar to save it into your unixstuff directory.) Exercise 2a Create a backup of your science.txt file by copying it to a file called science.bak 2.2 Moving files mv (move) mv file1 file2 moves (or renames) file1 to file2 To move a file from one place to another, use the mv command. This has the effect of moving rather than copying the file, so you end up with only one file rather than two. It can also be used to rename a file, by moving the file to the same directory, but giving it a different name. We are now going to move the file science.bak to your backup directory. First, change directories to your unixstuff directory (can you remember how?). Then, inside the unixstuff directory, type % mv science.bak backups/. Type ls and ls backups to see if it has worked. 2.3 Removing files and directories rm (remove), rmdir (remove directory) To delete (remove) a file, use the rm command. As an example, we are going to create a copy of the science.txt file then delete it. Inside your unixstuff directory, type % cp science.txt tempfile.txt % ls % rm tempfile.txt % ls You can use the rmdir command to remove a directory (make sure it is empty first). Try to remove the backups directory. You will not be able to since UNIX will not let you remove a non-empty directory. Exercise 2b Create a directory called tempstuff using mkdir , then remove it using the rmdir command. 2.4 Displaying the contents of a file on the screen clear (clear screen) Before you start the next section, you may like to clear the terminal window of the previous commands so the output of the following commands can be clearly understood. At the prompt, type % clear This will clear all text and leave you with the % prompt at the top of the window. cat (concatenate) The command cat can be used to display the contents of a file on the screen. Type: % cat science.txt As you can see, the file is longer than than the size of the window, so it scrolls past making it unreadable. less The command less writes the contents of a file onto the screen a page at a time. Type % less science.txt Press the [space-bar] if you want to see another page, and type [q] if you want to quit reading. As you can see, less is used in preference to cat for long files. head The head command writes the first ten lines of a file to the screen. First clear the screen then type % head science.txt Then type % head -5 science.txt What difference did the -5 do to the head command? tail The tail command writes the last ten lines of a file to the screen. Clear the screen and type % tail science.txt Q. How can you view the last 15 lines of the file? 2.5 Searching the contents of a file Simple searching using less Using less, you can search though a text file for a keyword (pattern). For example, to search through science.txt for the word 'science', type % less science.txt then, still in less, type a forward slash [/] followed by the word to search /science As you can see, less finds and highlights the keyword. Type [n] to search for the next occurrence of the word. grep (don't ask why it is called grep) grep is one of many standard UNIX utilities. It searches files for specified words or patterns. First clear the screen, then type % grep science science.txt As you can see, grep has printed out each line containg the word science. Or has it ???? Try typing % grep Science science.txt The grep command is case sensitive; it distinguishes between Science and science. To ignore upper/lower case distinctions, use the -i option, i.e. type % grep -i science science.txt To search for a phrase or pattern, you must enclose it in single quotes (the apostrophe symbol). For example to search for spinning top, type % grep -i 'spinning top' science.txt Some of the other options of grep are: -v display those lines that do NOT match -n precede each matching line with the line number -c print only the total count of matched lines Try some of them and see the different results. Don't forget, you can use more than one option at a time. For example, the number of lines without the words science or Science is % grep -ivc science science.txt wc (word count) A handy little utility is the wc command, short for word count. To do a word count on science.txt, type % wc -w science.txt To find out how many lines the file has, type % wc -l science.txt Summary Command Meaning cp file1 file2 copy file1 and call it file2 mv file1 file2 move or rename file1 to file2 rm file remove a file rmdir directory remove a directory cat file display a file less file display a file a page at a time head file display the first few lines of a file tail file display the last few lines of a file grep 'keyword' file search a file for keywords wc file count number of lines/words/characters in file UNIX Tutorial Three 3.1 Redirection &amp;nbsp; Most processes initiated by UNIX commands write to the standard output (that is, they write to the terminal screen), and many take their input from the standard input (that is, they read it from the keyboard). There is also the standard error, where processes write their error messages, by default, to the terminal screen. We have already seen one use of the cat command to write the contents of a file to the screen. Now type cat without specifing a file to read % cat Then type a few words on the keyboard and press the [Return] key. Finally hold the [Ctrl] key down and press [d] (written as ^D for short) to end the input. What has happened? If you run the cat command without specifing a file to read, it reads the standard input (the keyboard), and on receiving the 'end of file' (^D), copies it to the standard output (the screen). In UNIX, we can redirect both the input and the output of commands. 3.2 Redirecting the Output &amp;nbsp; We use the &amp;gt; symbol to redirect the output of a command. For example, to create a file called list1 containing a list of fruit, type &amp;nbsp; % cat &amp;gt; list1 Then type in the names of some fruit. Press [Return] after each one. pear banana apple ^D {this means press [Ctrl] and [d] to stop} What happens is the cat command reads the standard input (the keyboard) and the &amp;gt; redirects the output, which normally goes to the screen, into a file called list1 To read the contents of the file, type % cat list1 Exercise 3a Using the above method, create another file called list2 containing the following fruit: orange, plum, mango, grapefruit. Read the contents of list2 3.2.1 Appending to a file The form &amp;gt;&amp;gt; appends standard output to a file. So to add more items to the file list1, type % cat &amp;gt;&amp;gt; list1 Then type in the names of more fruit peach grape orange ^D (Control D to stop) To read the contents of the file, type % cat list1 You should now have two files. One contains six fruit, the other contains four fruit. We will now use the cat command to join (concatenate) list1 and list2 into a new file called biglist. Type % cat list1 list2 &amp;gt; biglist What this is doing is reading the contents of list1 and list2 in turn, then outputing the text to the file biglist To read the contents of the new file, type % cat biglist 3.3 Redirecting the Input &amp;nbsp; We use the &amp;lt; symbol to redirect the input of a command. The command sort alphabetically or numerically sorts a list. Type % sort Then type in the names of some animals. Press [Return] after each one. dog cat bird ape ^D (control d to stop) The output will be ape bird cat dog Using &amp;lt; you can redirect the input to come from a file rather than the keyboard. For example, to sort the list of fruit, type % sort &amp;lt; biglist and the sorted list will be output to the screen. To output the sorted list to a file, type, % sort &amp;lt; biglist &amp;gt; slist Use cat to read the contents of the file slist 3.4 Pipes To see who is on the system with you, type % who One method to get a sorted list of names is to type, % who &amp;gt; names.txt % sort &amp;lt; names.txt This is a bit slow and you have to remember to remove the temporary file called names when you have finished. What you really want to do is connect the output of the who command directly to the input of the sort command. This is exactly what pipes do. The symbol for a pipe is the vertical bar | For example, typing % who | sort will give the same result as above, but quicker and cleaner. To find out how many users are logged on, type % who | wc -l Exercise 3b Using pipes, display all lines of list1 and list2 containing the letter 'p', and sort the result. Answer available here Summary Command Meaning command &amp;gt; file redirect standard output to a file command &amp;gt;&amp;gt; file append standard output to a file command &amp;lt; file redirect standard input from a file command1 | command2 pipe the output of command1 to the input of command2 cat file1 file2 &amp;gt; file0 concatenate file1 and file2 to file0 sort sort data who list users currently logged in UNIX Tutorial Four 4.1 Wildcards The * wildcard The character * is called a wildcard, and will match against none or more character(s) in a file (or directory) name. For example, in your unixstuff directory, type % ls list* This will list all files in the current directory starting with list.... Try typing % ls *list This will list all files in the current directory ending with ....list The ? wildcard The character ? will match exactly one character. So ?ouse will match files like house and mouse, but not grouse. Try typing % ls ?list 4.2 Filename conventions We should note here that a directory is merely a special type of file. So the rules and conventions for naming files apply also to directories. In naming files, characters with special meanings such as / * &amp;amp; % , should be avoided. Also, avoid using spaces within names. The safest way to name a file is to use only alphanumeric characters, that is, letters and numbers, together with _ (underscore) and . (dot). Good filenames Bad filenames project.txt project my_big_program.c my big program.c fred_dave.doc fred &amp;amp; dave.doc File names conventionally start with a lower-case letter, and may end with a dot followed by a group of letters indicating the contents of the file. For example, all files consisting of C code may be named with the ending .c, for example, prog1.c . Then in order to list all files containing C code in your home directory, you need only type ls&amp;nbsp;*.c in that directory. 4.3 Getting Help On-line Manuals There are on-line manuals which gives information about most commands. The manual pages tell you which options a particular command can take, and how each option modifies the behaviour of the command. Type man&amp;nbsp;command to read the manual page for a particular command. For example, to find out more about the wc (word count) command, type % man wc Alternatively % whatis wc gives a one-line description of the command, but omits any information about options etc. Apropos When you are not sure of the exact name of a command, % apropos keyword will give you the commands with keyword in their manual page header. For example, try typing % apropos copy Summary Command Meaning * match any number of characters ? match one character man command read the online manual page for a command whatis command brief description of a command apropos keyword match commands with keyword in their man pages &amp;nbsp; UNIX Tutorial Five 5.1 File system security (access rights) In your unixstuff directory, type % ls -l (l for long listing!) You will see that you now get lots of details about the contents of your directory, similar to the example below. Each file (and directory) has associated access rights, which may be found by typing ls -l. Also, ls -lg gives additional information as to which group owns the file (beng95 in the following example): -rwxrw-r-- 1 ee51ab beng95 2450 Sept29 11:52 file1 In the left-hand column is a 10 symbol string consisting of the symbols d, r, w, x, -, and, occasionally, s or S. If d is present, it will be at the left hand end of the string, and indicates a directory: otherwise - will be the starting symbol of the string. The 9 remaining symbols indicate the permissions, or access rights, and are taken as three groups of 3. The left group of 3 gives the file permissions for the user that owns the file (or directory) (ee51ab in the above example); the middle group gives the permissions for the group of people to whom the file (or directory) belongs (eebeng95 in the above example); the rightmost group gives the permissions for all others. The symbols r, w, etc., have slightly different meanings depending on whether they refer to a simple file or to a directory. Access rights on files. r (or -), indicates read permission (or otherwise), that is, the presence or absence of permission to read and copy the file w (or -), indicates write permission (or otherwise), that is, the permission (or otherwise) to change a file x (or -), indicates execution permission (or otherwise), that is, the permission to execute a file, where appropriate Access rights on directories. r allows users to list files in the directory; w means that users may delete files from the directory or move files into it; x means the right to access files in the directory. This implies that you may read files in the directory provided you have read permission on the individual files. So, in order to read a file, you must have execute permission on the directory containing that file, and hence on any directory containing that directory as a subdirectory, and so on, up the tree. Some examples -rwxrwxrwx a file that everyone can read, write and execute (and delete). -rw------- a file that only the owner can read and write - no-one else can read or write and no-one has execution rights (e.g. your mailbox file). 5.2 Changing access rights chmod (changing a file mode) Only the owner of a file can use chmod to change the permissions of a file. The options of chmod are as follows Symbol Meaning u user g group o other a all r read w write (and delete) x execute (and access directory) + add permission - take away permission For example, to remove read write and execute permissions on the file biglist for the group and others, type % chmod go-rwx biglist This will leave the other permissions unaffected. To give read and write permissions on the file biglist to all, % chmod a+rw biglist Exercise 5a Try changing access permissions on the file science.txt and on the directory backups Use ls -l to check that the permissions have changed. 5.3 Processes and Jobs A process is an executing program identified by a unique PID (process identifier). To see information about your processes, with their associated PID and status, type % ps A process may be in the foreground, in the background, or be suspended. In general the shell does not return the UNIX prompt until the current process has finished executing. Some processes take a long time to run and hold up the terminal. Backgrounding a long process has the effect that the UNIX prompt is returned immediately, and other tasks can be carried out while the original process continues executing. Running background processes To background a process, type an &amp;amp; at the end of the command line. For example, the command sleep waits a given number of seconds before continuing. Type % sleep 10 This will wait 10 seconds before returning the command prompt %. Until the command prompt is returned, you can do nothing except wait. To run sleep in the background, type % sleep 10 &amp;amp; [1] 6259 The &amp;amp; runs the job in the background and returns the prompt straight away, allowing you do run other programs while waiting for that one to finish. The first line in the above example is typed in by the user; the next line, indicating job number and PID, is returned by the machine. The user is be notified of a job number (numbered from 1) enclosed in square brackets, together with a PID and is notified when a background process is finished. Backgrounding is useful for jobs which will take a long time to complete. Backgrounding a current foreground process At the prompt, type % sleep 1000 You can suspend the process running in the foreground by typing ^Z, i.e.hold down the [Ctrl] key and type [z]. Then to put it in the background, type % bg Note: do not background programs that require user interaction e.g. vi 5.4 Listing suspended and background processes When a process is running, backgrounded or suspended, it will be entered onto a list along with a job number. To examine this list, type % jobs An example of a job list could be [1] Suspended sleep 1000 [2] Running netscape [3] Running matlab To restart (foreground) a suspended processes, type % fg %jobnumber For example, to restart sleep 1000, type % fg %1 Typing fg with no job number foregrounds the last suspended process. 5.5 Killing a process kill (terminate or signal a process) It is sometimes necessary to kill a process (for example, when an executing program is in an infinite loop) To kill a job running in the foreground, type ^C (control c). For example, run % sleep 100 ^C To kill a suspended or background process, type % kill %jobnumber For example, run % sleep 100 &amp;amp; % jobs If it is job number 4, type % kill %4 To check whether this has worked, examine the job list again to see if the process has been removed. ps (process status) Alternatively, processes can be killed by finding their process numbers (PIDs) and using kill PID_number % sleep 1000 &amp;amp; % ps PID TT S TIME COMMAND 20077 pts/5 S 0:05 sleep 1000 21563 pts/5 T 0:00 netscape 21873 pts/5 S 0:25 nedit To kill off the process sleep 1000, type % kill 20077 and then type ps again to see if it has been removed from the list. If a process refuses to be killed, uses the -9 option, i.e. type % kill -9 20077 Note: It is not possible to kill off other users' processes !!! Summary Command Meaning ls -lag list access rights for all files chmod [options] file change access rights for named file command &amp;amp; run command in background ^C kill the job running in the foreground ^Z suspend the job running in the foreground bg background the suspended job jobs list current jobs fg %1 foreground job number 1 kill %1 kill job number 1 ps list current processes kill 26152 kill process number 26152 UNIX Tutorial Six Other useful UNIX commands &amp;nbsp; quota All students are allocated a certain amount of disk space on the file system for their personal files, usually about 100Mb. If you go over your quota, you are given 7 days to remove excess files. To check your current quota and how much of it you have used, type % quota -v df The df command reports on the space left on the file system. For example, to find out how much space is left on the fileserver, type % df . du The du command outputs the number of kilobyes used by each subdirectory. Useful if you have gone over quota and you want to find out which directory has the most files. In your home-directory, type % du -s * The -s flag will display only a summary (total size) and the * means all files and directories. gzip This reduces the size of a file, thus freeing valuable disk space. For example, type % ls -l science.txt and note the size of the file using ls -l . Then to compress science.txt, type % gzip science.txt This will compress the file and place it in a file called science.txt.gz To see the change in size, type ls -l again. To expand the file, use the gunzip command. % gunzip science.txt.gz zcat zcat will read gzipped files without needing to uncompress them first. % zcat science.txt.gz If the text scrolls too fast for you, pipe the output though less . % zcat science.txt.gz | less file file classifies the named files according to the type of data they contain, for example ascii (text), pictures, compressed data, etc.. To report on all files in your home directory, type % file * diff This command compares the contents of two files and displays the differences. Suppose you have a file called file1 and you edit some part of it and save it as file2. To see the differences type % diff file1 file2 Lines beginning with a &amp;lt; denotes file1, while lines beginning with a &amp;gt; denotes file2. find This searches through the directories for files and directories with a given name, date, size, or any other attribute you care to specify. It is a simple command but with many options - you can read the manual by typing man&amp;nbsp;find. To search for all fies with the extention .txt, starting at the current directory (.) and working through all sub-directories, then printing the name of the file to the screen, type % find . -name "*.txt" -print To find files over 1Mb in size, and display the result as a long listing, type % find . -size +1M -ls history The C shell keeps an ordered list of all the commands that you have entered. Each command is given a number according to the order it was entered. % history (show command history list) If you are using the C shell, you can use the exclamation character (!) to recall commands easily. % !! (recall last command) % !-3 (recall third most recent command) % !5 (recall 5th command in list) % !grep (recall last command starting with grep) You can increase the size of the history buffer by typing % set history=100 &amp;nbsp; UNIX Tutorial Seven 7.1 Compiling UNIX software packages &amp;nbsp; We have many public domain and commercial software packages installed on our systems, which are available to all users. However, students are allowed to download and install small software packages in their own home directory, software usually only useful to them personally. There are a number of steps needed to install the software. Locate and download the source code (which is usually compressed) Unpack the source code Compile the code Install the resulting executable Set paths to the installation directory Of the above steps, probably the most difficult is the compilation stage. Compiling Source Code All high-level language code must be converted into a form the computer understands. For example, C language source code is converted into a lower-level language called assembly language. The assembly language code made by the previous stage is then converted into object code which are fragments of code which the computer understands directly. The final stage in compiling a program involves linking the object code to code libraries which contain certain built-in functions. This final stage produces an executable program. To do all these steps by hand is complicated and beyond the capability of the ordinary user. A number of utilities and tools have been developed for programmers and end-users to simplify these steps. make and the Makefile The make command allows programmers to manage large programs or groups of programs. It aids in developing large programs by keeping track of which portions of the entire program have been changed, compiling only those parts of the program which have changed since the last compile. The make program gets its set of compile rules from a text file called Makefile which resides in the same directory as the source files. It contains information on how to compile the software, e.g. the optimisation level, whether to include debugging info in the executable. It also contains information on where to install the finished compiled binaries (executables), manual pages, data files, dependent library files, configuration files, etc. Some packages require you to edit the Makefile by hand to set the final installation directory and any other parameters. However, many packages are now being distributed with the GNU configure utility. configure As the number of UNIX variants increased, it became harder to write programs which could run on all variants. Developers frequently did not have access to every system, and the characteristics of some systems changed from version to version. The GNU configure and build system simplifies the building of programs distributed as source code. All programs are built using a simple, standardised, two step process. The program builder need not install any special tools in order to build the program. The configure shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a Makefile in each directory of the package. The simplest way to compile a package is: cd to the directory containing the package's source code. Type ./configure to configure the package for your system. Type make to compile the package. Optionally, type make check to run any self-tests that come with the package. Type make install to install the programs and any data files and documentation. Optionally, type make clean to remove the program binaries and object files from the source code directory&amp;nbsp; The configure utility supports a wide variety of options. You can usually use the --help option to get a list of interesting options for a particular configure script. The only generic options you are likely to use are the --prefix and --exec-prefix options. These options are used to specify the installation directories. &amp;nbsp; The directory named by the --prefix option will hold machine independent files such as documentation, data and configuration files. The directory named by the --exec-prefix option, (which is normally a subdirectory of the --prefix directory), will hold machine dependent files such as executables. 7.2 Downloading source code For this example, we will download a piece of free software that converts between different units of measurements. First create a download directory&amp;nbsp; % mkdir download Download the software here and save it to your new download directory. 7.3 Extracting the source code &amp;nbsp; Go into your download directory and list the contents. % cd download % ls -l As you can see, the filename ends in tar.gz. The tar command turns several files and directories into one single tar file. This is then compressed using the gzip command (to create a tar.gz file). First unzip the file using the gunzip command. This will create a .tar file.&amp;nbsp; % gunzip units-1.74.tar.gz Then extract the contents of the tar file. &amp;nbsp; % tar -xvf units-1.74.tar Again, list the contents of the download directory, then go to the units-1.74 sub-directory.&amp;nbsp; % cd units-1.74 7.4 Configuring and creating the Makefile &amp;nbsp; The first thing to do is carefully read the README and INSTALL text files (use the less command). These contain important information on how to compile and run the software. The units package uses the GNU configure system to compile the source code. We will need to specify the installation directory, since the default will be the main system area which you will not have write permissions for. We need to create an install directory in your home directory. &amp;nbsp; % mkdir ~/units174 Then run the configure utility setting the installation path to this. % ./configure --prefix=$HOME/units174 NOTE: The $HOME variable is an example of an environment variable. The value of $HOME is the path to your home directory. Just type % echo $HOME to show the contents of this variable. We will learn more about environment variables in a later chapter. If configure has run correctly, it will have created a Makefile with all necessary options. You can view the Makefile if you wish (use the less command), but do not edit the contents of this. 7.5 Building the package&amp;nbsp; Now you can go ahead and build the package by running the make command.&amp;nbsp; % make After a minute or two (depending on the speed of the computer), the executables will be created. You can check to see everything compiled successfully by typing % make check If everything is okay, you can now install the package. &amp;nbsp; % make install This will install the files into the ~/units174 directory you created earlier. 7.6 Running the software You are now ready to run the software (assuming everything worked).&amp;nbsp; % cd ~/units174 If you list the contents of the units directory, you will see a number of subdirectories. bin The binary executables info GNU info formatted documentation man Man pages share Shared data files To run the program, change to the bin directory and type % ./units As an example, convert 6 feet to metres.&amp;nbsp; You have: 6 feet You want: metres&amp;nbsp; * 1.8288 If you get the answer 1.8288, congratulations, it worked. To view what units it can convert between, view the data file in the share directory (the list is quite comprehensive). To read the full documentation, change into the info directory and type&amp;nbsp; % info --file=units.info 7.7 Stripping unnecessary code When a piece of software is being developed, it is useful for the programmer to include debugging information into the resulting executable. This way, if there are problems encountered when running the executable, the programmer can load the executable into a debugging software package and track down any software bugs. This is useful for the programmer, but unnecessary for the user. We can assume that the package, once finished and available for download has already been tested and debugged. However, when we compiled the software above, debugging information was still compiled into the final executable. Since it is unlikey that we are going to need this debugging information, we can strip it out of the final executable. One of the advantages of this is a much smaller executable, which should run slightly faster. What we are going to do is look at the before and after size of the binary file. First change into the bin directory of the units installation directory.&amp;nbsp; % cd ~/units174/bin % ls -l As you can see, the file is over 100 kbytes in size. You can get more information on the type of file by using the file command.&amp;nbsp; % file units units: ELF 32-bit LSB executable, Intel 80386, version 1, dynamically linked (uses shared libs), not stripped To strip all the debug and line numbering information out of the binary file, use the strip command&amp;nbsp; % strip units % ls -l As you can see, the file is now 36 kbytes - a third of its original size. Two thirds of the binary file was debug code!!! Check the file information again.&amp;nbsp; % file units units: ELF 32-bit LSB executable, Intel 80386, version 1, dynamically linked (uses shared libs), stripped Sometimes you can use the make command to install pre-stripped copies of all the binary files when you install the package. Instead of typing make install, simply type make install-strip</itunes:summary><itunes:keywords>Unix in Seven TUtorials</itunes:keywords></item><item><title>Java Tutorial Part-IV </title><link>http://hamidkalu.blogspot.com/2013/09/java-tutorial-part-iv.html</link><category>Java Modifier Types</category><category>Java Number Class</category><author>noreply@blogger.com (Hamid)</author><pubDate>Sun, 22 Sep 2013 12:33:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7786780271346850842.post-3280493334173079242</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;h1&gt;
Java Modifier Types&lt;/h1&gt;
Modifiers are keywords that you add to those definitions to change 
their meanings. The Java language has a wide variety of modifiers, 
including the following:&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;&lt;a href="http://www.blogger.com/null"&gt; Java Access Modifiers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.blogger.com/null"&gt;Non Access Modifiers&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
To use a modifier, you include its keyword in the definition of a 
class, method, or variable. The modifier precedes the rest of the 
statement, as in the following examples (Italic ones):&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;i&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;/i&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; className &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;// ...&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;i&gt;&lt;span class="kwd"&gt;private&lt;/span&gt;&lt;/i&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;boolean&lt;/span&gt;&lt;span class="pln"&gt; myFlag&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;i&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;final&lt;/span&gt;&lt;/i&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; weeks &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;9.5&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;i&gt;&lt;span class="kwd"&gt;protected&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;final&lt;/span&gt;&lt;/i&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; BOXWIDTH &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;42&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;i&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;/i&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pun"&gt;[]&lt;/span&gt;&lt;span class="pln"&gt; arguments&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;// body of method&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
Access Control Modifiers:&lt;/h2&gt;
Java provides a number of access modifiers to set access levels for 
classes, variables, methods and constructors. The four access levels 
are:&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;Visible to the package. the default. No modifiers are needed.&lt;/li&gt;
&lt;li&gt;Visible to the class only (private).&lt;/li&gt;
&lt;li&gt;Visible to the world (public).&lt;/li&gt;
&lt;li&gt;Visible to the package and all subclasses (protected).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Non Access Modifiers:&lt;/h2&gt;
Java provides a number of non-access modifiers to achieve many other functionality.&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;The &lt;i&gt;static&lt;/i&gt; modifier for creating class methods and variables&lt;/li&gt;
&lt;li&gt;The &lt;i&gt;final&lt;/i&gt; modifier for finalizing the implementations of classes, methods, and variables.&lt;/li&gt;
&lt;li&gt;The &lt;i&gt;abstract&lt;/i&gt; modifier for creating abstract classes and methods.&lt;/li&gt;
&lt;li&gt;The &lt;i&gt;synchronized&lt;/i&gt; and &lt;i&gt;volatile&lt;/i&gt; modifiers, which are used for threads. &lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;
&amp;nbsp;
&lt;/h1&gt;
&lt;h1&gt;
Java Basic Operators&lt;/h1&gt;
Java provides a rich set of operators to manipulate variables. We can divide all the Java operators into the following groups:&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;Arithmetic Operators&lt;/li&gt;
&lt;li&gt;Relational Operators&lt;/li&gt;
&lt;li&gt;Bitwise Operators&lt;/li&gt;
&lt;li&gt;Logical Operators&lt;/li&gt;
&lt;li&gt;Assignment Operators&lt;/li&gt;
&lt;li&gt;Misc Operators&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
The Arithmetic Operators:&lt;/h2&gt;
Arithmetic operators are used in mathematical expressions in the same
 way that they are used in algebra. The following table lists the 
arithmetic operators:&lt;br /&gt;
Assume integer variable A holds 10 and variable B holds 20 then:&lt;br /&gt;
&lt;a href="http://www.blogger.com/null"&gt;Show Examples&lt;/a&gt;&lt;br /&gt;
&lt;table class="src"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Operator&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;th style="width: 20%;"&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;+&lt;/td&gt;&lt;td&gt;Addition - Adds values on either side of the operator&lt;/td&gt;&lt;td&gt;A + B will give 30&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-&lt;/td&gt;&lt;td&gt;Subtraction - Subtracts right hand operand from left hand operand&lt;/td&gt;&lt;td&gt;A - B will give -10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;*&lt;/td&gt;&lt;td&gt;Multiplication - Multiplies values on either side of the operator&lt;/td&gt;&lt;td&gt;A * B will give 200&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;/&lt;/td&gt;&lt;td&gt;Division - Divides left hand operand by right hand operand&lt;/td&gt;&lt;td&gt;B / A will give 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;%&lt;/td&gt;&lt;td&gt;Modulus - Divides left hand operand by right hand operand and returns remainder&lt;/td&gt;&lt;td&gt;B % A will give 0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;++&lt;/td&gt;&lt;td&gt;Increment - Increase the value of operand by 1&lt;/td&gt;&lt;td&gt;B++ gives 21&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;--&lt;/td&gt;&lt;td&gt;Decrement - Decrease the value of operand by 1&lt;/td&gt;&lt;td&gt;B-- gives 19&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h2&gt;
The Relational Operators:&lt;/h2&gt;
There are following relational operators supported by Java language&lt;br /&gt;
Assume variable A holds 10 and variable B holds 20 then:&lt;br /&gt;
&lt;a href="http://www.blogger.com/null"&gt;Show Examples&lt;/a&gt;&lt;br /&gt;
&lt;table class="src"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Operator&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;th style="width: 20%;"&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;==&lt;/td&gt;&lt;td&gt;Checks if the value of two operands are equal or not, if yes then condition becomes true.&lt;/td&gt;&lt;td&gt;(A == B) is not true. &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;!=&lt;/td&gt;&lt;td&gt;Checks if the value of two operands are equal or not, if values are not equal then condition becomes true.&lt;/td&gt;&lt;td&gt;(A != B) is true. &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;gt;&lt;/td&gt;&lt;td&gt;Checks if the value of left  operand is greater than the value of right operand, if yes then condition becomes true.&lt;/td&gt;&lt;td&gt;(A &amp;gt; B) is not true. &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;lt;&lt;/td&gt;&lt;td&gt;Checks if the value of left  operand is less than the value of right operand, if yes then condition becomes true.&lt;/td&gt;&lt;td&gt;(A &amp;lt; B) is true. &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;gt;=&lt;/td&gt;&lt;td&gt;Checks if the value of left  operand is greater than 
or equal to the value of right operand, if yes then condition becomes 
true.&lt;/td&gt;&lt;td&gt;(A &amp;gt;= B) is not true. &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;lt;=&lt;/td&gt;&lt;td&gt;Checks if the value of left  operand is less than or equal to the value of right operand, if yes then condition becomes true.&lt;/td&gt;&lt;td&gt;(A &amp;lt;= B) is true. &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h2&gt;
The Bitwise Operators:&lt;/h2&gt;
Java defines several bitwise operators which can be applied to the integer types, long, int, short, char, and byte.&lt;br /&gt;
Bitwise operator works on bits and perform bit by bit operation. 
Assume if a = 60; and b = 13; Now in binary format they will be as 
follows:&lt;br /&gt;
a = 0011 1100&lt;br /&gt;
b = 0000 1101&lt;br /&gt;
-----------------&lt;br /&gt;
a&amp;amp;b = 0000 1100&lt;br /&gt;
a|b = 0011 1101&lt;br /&gt;
a^b = 0011 0001&lt;br /&gt;
~a&amp;nbsp; = 1100 0011&lt;br /&gt;
The following table lists the bitwise operators:&lt;br /&gt;
Assume integer variable A holds 60 and variable B holds 13 then:&lt;br /&gt;
&lt;a href="http://www.blogger.com/null"&gt;Show Examples&lt;/a&gt;&lt;br /&gt;
&lt;table class="src"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Operator&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;th style="width: 20%;"&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;amp;&lt;/td&gt;&lt;td&gt;Binary AND Operator copies a bit to the result if it exists in both operands. &lt;/td&gt;&lt;td&gt;(A &amp;amp; B) will give 12 which is 0000 1100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;|&lt;/td&gt;&lt;td&gt;Binary OR Operator copies a bit if it exists in eather operand. &lt;/td&gt;&lt;td&gt;(A | B) will give 61 which is 0011 1101&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;^&lt;/td&gt;&lt;td&gt;Binary XOR Operator copies the bit if it is set in one operand but not both. &lt;/td&gt;&lt;td&gt;(A ^ B) will give 49 which is 0011 0001&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;~&lt;/td&gt;&lt;td&gt;Binary Ones Complement Operator is unary and has the efect of 'flipping' bits. &lt;/td&gt;&lt;td&gt;(~A ) will give -60 which is 1100 0011&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;lt;&amp;lt;&lt;/td&gt;&lt;td&gt;Binary Left Shift Operator. The left operands value is moved left by the number of bits specified by the right operand. &lt;/td&gt;&lt;td&gt;A &amp;lt;&amp;lt; 2 will give 240 which is 1111 0000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;gt;&amp;gt;&lt;/td&gt;&lt;td&gt;Binary Right Shift Operator. The left operands value is moved right by the number of bits specified by the right operand. &lt;/td&gt;&lt;td&gt;A &amp;gt;&amp;gt; 2 will give 15 which is 1111&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/td&gt;&lt;td&gt;Shift right zero fill operator. The left 
operands value is moved right by the number of bits specified by the 
right operand and shifted values are filled up with zeros. &lt;/td&gt;&lt;td&gt;A &amp;gt;&amp;gt;&amp;gt;2 will give 15 which is 0000 1111&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h2&gt;
The Logical Operators:&lt;/h2&gt;
The following table lists the logical operators:&lt;br /&gt;
Assume boolean variables A holds true and variable B holds false then:&lt;br /&gt;
&lt;a href="http://www.blogger.com/null"&gt;Show Examples&lt;/a&gt;&lt;br /&gt;
&lt;table class="src"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Operator&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;th style="width: 20%;"&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;amp;&amp;amp;&lt;/td&gt;&lt;td&gt;Called Logical AND  operator. If both the operands are non zero then then condition becomes true.&lt;/td&gt;&lt;td&gt;(A &amp;amp;&amp;amp; B) is false. &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;||&lt;/td&gt;&lt;td&gt;Called Logical OR Operator.  If any of the two operands are non zero then then condition becomes true.&lt;/td&gt;&lt;td&gt;(A || B) is true. &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;!&lt;/td&gt;&lt;td&gt;Called Logical NOT Operator.  Use to reverses the logical 
state of its operand. If a condition is true then Logical NOT operator 
will make false.&lt;/td&gt;&lt;td&gt;!(A &amp;amp;&amp;amp; B) is true. &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h2&gt;
The Assignment Operators:&lt;/h2&gt;
There are following assignment operators supported by Java language:&lt;br /&gt;
&lt;a href="http://www.blogger.com/null"&gt;Show Examples&lt;/a&gt;&lt;br /&gt;
&lt;table class="src"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;Operator&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;th style="width: 20%;"&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;=&lt;/td&gt;&lt;td&gt;Simple assignment operator, Assigns values from right side operands to left side operand&lt;/td&gt;&lt;td&gt;C = A + B will assigne value of A + B into C&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;+=&lt;/td&gt;&lt;td&gt;Add AND assignment operator, It adds right operand to the left operand and assign the result to left operand&lt;/td&gt;&lt;td&gt;C += A is equivalent to C = C + A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-=&lt;/td&gt;&lt;td&gt;Subtract AND assignment operator, It subtracts right operand from the left operand and assign the result to left operand&lt;/td&gt;&lt;td&gt;C -= A is equivalent to C = C - A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;*=&lt;/td&gt;&lt;td&gt;Multiply AND assignment operator, It multiplies right operand with the left operand and assign the result to left operand&lt;/td&gt;&lt;td&gt;C *= A is equivalent to C = C * A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;/=&lt;/td&gt;&lt;td&gt;Divide AND assignment operator, It divides left operand with the right operand and assign the result to left operand&lt;/td&gt;&lt;td&gt;C /= A is equivalent to C = C / A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;%=&lt;/td&gt;&lt;td&gt;Modulus AND assignment operator, It takes modulus using two operands and assign the result to  left operand&lt;/td&gt;&lt;td&gt;C %= A is equivalent to C = C % A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;lt;&amp;lt;=&lt;/td&gt;&lt;td&gt;Left shift AND assignment operator &lt;/td&gt;&lt;td&gt;C &amp;lt;&amp;lt;= 2 is same as  C = C &amp;lt;&amp;lt; 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;gt;&amp;gt;=&lt;/td&gt;&lt;td&gt;Right shift AND assignment operator &lt;/td&gt;&lt;td&gt;C &amp;gt;&amp;gt;= 2 is same as  C = C &amp;gt;&amp;gt; 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;amp;=&lt;/td&gt;&lt;td&gt;Bitwise AND assignment operator&lt;/td&gt;&lt;td&gt;C &amp;amp;= 2 is same as  C = C &amp;amp; 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;^=&lt;/td&gt;&lt;td&gt;bitwise exclusive OR and assignment operator&lt;/td&gt;&lt;td&gt;C ^= 2 is same as  C = C ^ 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;|=&lt;/td&gt;&lt;td&gt;bitwise inclusive OR and assignment operator&lt;/td&gt;&lt;td&gt;C |= 2 is same as  C = C | 2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h2&gt;
Misc Operators&lt;/h2&gt;
There are few other operators supported by Java Language.&lt;br /&gt;
&lt;h2&gt;
Conditional Operator ( ? : ):&lt;/h2&gt;
Conditional operator is also known as the ternary operator. This 
operator consists of three operands and is used to evaluate boolean 
expressions. The goal of the operator is to decide which value should be
 assigned to the variable. The operator is written as :&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;variable x &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;expression&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;?&lt;/span&gt;&lt;span class="pln"&gt; value &lt;/span&gt;&lt;span class="kwd"&gt;if&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;true&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; value &lt;/span&gt;&lt;span class="kwd"&gt;if&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;false&lt;/span&gt;&lt;/pre&gt;
Following is the example:&lt;br /&gt;
&lt;pre class="prettyprint tryit prettyprinted"&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Test&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; args&lt;/span&gt;&lt;span class="pun"&gt;[]){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; a &lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; b&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      a &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;10&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      b &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;a &lt;/span&gt;&lt;span class="pun"&gt;==&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;1&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;?&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;20&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;30&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Value of b is : "&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt;  b &lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;

      b &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;a &lt;/span&gt;&lt;span class="pun"&gt;==&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;10&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;?&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;20&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;30&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Value of b is : "&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; b &lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
This would produce following result:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="typ"&gt;Value&lt;/span&gt;&lt;span class="pln"&gt; of b &lt;/span&gt;&lt;span class="kwd"&gt;is&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;30&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="typ"&gt;Value&lt;/span&gt;&lt;span class="pln"&gt; of b &lt;/span&gt;&lt;span class="kwd"&gt;is&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;20&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
instanceOf Operator:&lt;/h2&gt;
This operator is used only for object reference variables. The 
operator checks whether the object is of a particular type(class type or
 interface type).  instanceOf operator is wriiten as:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Object&lt;/span&gt;&lt;span class="pln"&gt; reference variable &lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt; instanceOf  &lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pun"&gt;/&lt;/span&gt;&lt;span class="kwd"&gt;interface&lt;/span&gt;&lt;span class="pln"&gt; type&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;/pre&gt;
If the object referred by the variable on the left side of the 
operator passes the IS-A check for the class/interface type on the right
 side then the result will be true. Following is the example:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; name &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;'James'&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;boolean&lt;/span&gt;&lt;span class="pln"&gt; result &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; name instanceOf &lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;  
&lt;/span&gt;&lt;span class="com"&gt;// This will return true since name is type of String&lt;/span&gt;&lt;/pre&gt;
This operator will still return true if the object being compared is 
the assignment compatible with the type on the right. Following is one 
more example:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Vehicle&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{}&lt;/span&gt;&lt;span class="pln"&gt;

&lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Car&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;extends&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Vehicle&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; args&lt;/span&gt;&lt;span class="pun"&gt;[]){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;Vehicle&lt;/span&gt;&lt;span class="pln"&gt; a &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;new&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Car&lt;/span&gt;&lt;span class="pun"&gt;();&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;boolean&lt;/span&gt;&lt;span class="pln"&gt; result &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt;  a &lt;/span&gt;&lt;span class="kwd"&gt;instanceof&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Car&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; result&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
This would produce following result:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;true&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
Precedence of Java Operators:&lt;/h2&gt;
Operator precedence determines the grouping of terms in an 
expression. This affects how an expression is evaluated. Certain 
operators have higher precedence than others; for example, the 
multiplication operator has higher precedence than the addition 
operator:&lt;br /&gt;
For example x = 7 + 3 * 2;  Here  x is assigned 13, not 20 because 
operator * has higher precedenace than + so it first get multiplied with
 3*2 and then adds into 7.&lt;br /&gt;
Here operators with the highest precedence appear at the top of the 
table, those with the lowest appear at the bottom. Within an expression,
 higher precedenace operators will be evaluated first.&lt;br /&gt;
&lt;table class="src"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;Category&amp;nbsp;&lt;/th&gt; &lt;th&gt;Operator&amp;nbsp;&lt;/th&gt;
&lt;th style="width: 20%;"&gt;Associativity&amp;nbsp;&lt;/th&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Postfix&amp;nbsp;&lt;/td&gt;
&lt;td&gt;() [] . (dot operator)&lt;/td&gt; &lt;td&gt;Left to
right&amp;nbsp;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Unary&amp;nbsp;&lt;/td&gt; 
&lt;td&gt;++ - - !  ~ &lt;/td&gt; &lt;td&gt;Right to left&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Multiplicative &amp;nbsp;&lt;/td&gt; &lt;td&gt;*  /  %&amp;nbsp;&lt;/td&gt;
&lt;td&gt;Left to right&amp;nbsp;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Additive &amp;nbsp;&lt;/td&gt;
&lt;td&gt;+  -&amp;nbsp;&lt;/td&gt; &lt;td&gt;Left to right&amp;nbsp;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Shift &amp;nbsp;&lt;/td&gt; &lt;td&gt;&amp;gt;&amp;gt; &amp;gt;&amp;gt;&amp;gt; &amp;lt;&amp;lt; &amp;nbsp;&lt;/td&gt; &lt;td&gt;Left
to right&amp;nbsp;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Relational &amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;gt; &amp;gt;=  &amp;lt; &amp;lt;= &amp;nbsp;&lt;/td&gt; &lt;td&gt;Left to right&amp;nbsp;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Equality &amp;nbsp;&lt;/td&gt; &lt;td&gt;==  !=&amp;nbsp;&lt;/td&gt; &lt;td&gt;Left
to right&amp;nbsp;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; 
&lt;td&gt;Bitwise AND&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;amp;&amp;nbsp;&lt;/td&gt; &lt;td&gt;Left to right&amp;nbsp;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Bitwise
XOR&amp;nbsp;&lt;/td&gt; &lt;td&gt;^&amp;nbsp;&lt;/td&gt; &lt;td&gt;Left to right&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Bitwise OR&amp;nbsp;&lt;/td&gt; &lt;td&gt;|&amp;nbsp;&lt;/td&gt; &lt;td&gt;Left
to right&amp;nbsp;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Logical AND&amp;nbsp;&lt;/td&gt;
&lt;td&gt;&amp;amp;&amp;amp;&amp;nbsp;&lt;/td&gt; &lt;td&gt;Left to right&amp;nbsp;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Logical OR&amp;nbsp;&lt;/td&gt; &lt;td&gt;||&amp;nbsp;&lt;/td&gt; &lt;td&gt;Left to
right&amp;nbsp;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Conditional&amp;nbsp;&lt;/td&gt;
&lt;td&gt;?:&amp;nbsp;&lt;/td&gt; &lt;td&gt;Right to left&amp;nbsp;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Assignment&amp;nbsp;&lt;/td&gt; &lt;td&gt;=  +=  -=  *=  /=  %=
&amp;gt;&amp;gt;=  &amp;lt;&amp;lt;=  &amp;amp;=  ^=   |=&amp;nbsp;&lt;/td&gt; &lt;td&gt;Right to left&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Comma&amp;nbsp;&lt;/td&gt; &lt;td&gt;,&amp;nbsp;&lt;/td&gt; &lt;td&gt;Left to
right&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h1&gt;
Java Loops - for, while and do...while&lt;/h1&gt;
There may be a sitution when we need to execute a block of code several number of times, and is often referred to as a loop. &lt;br /&gt;
Java has very flexible three looping mechanisms. You can use one of the following three loops:&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;while Loop&lt;/li&gt;
&lt;li&gt;do...while Loop&lt;/li&gt;
&lt;li&gt;for Loop&lt;/li&gt;
&lt;/ul&gt;
As of java 5 the &lt;i&gt;enhanced for loop&lt;/i&gt; was introduced. This is mainly used for Arrays.&lt;br /&gt;
&lt;h2&gt;
The while Loop:&lt;/h2&gt;
A while loop is a control structure that allows you to repeat a task a certain number of times.&lt;br /&gt;
&lt;h2&gt;
Syntax:&lt;/h2&gt;
The syntax of a while loop is:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;while&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;Boolean_expression&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;//Statements&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
When executing, if the &lt;i&gt;boolean_expression&lt;/i&gt; result is true then the actions inside the loop will be executed. This will continue as long as the expression result is true.&lt;br /&gt;
Here key point of the &lt;i&gt;while&lt;/i&gt; loop is that the loop might not 
ever run. When the expression is tested and the result is false, the 
loop body will be skipped and the first statement after the while loop 
will be executed.&lt;br /&gt;
&lt;h2&gt;
Example:&lt;/h2&gt;
&lt;pre class="prettyprint tryit prettyprinted" style="cursor: default;"&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Test&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; args&lt;/span&gt;&lt;span class="pun"&gt;[])&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;10&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

      &lt;/span&gt;&lt;span class="kwd"&gt;while&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;20&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"value of x : "&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
         x&lt;/span&gt;&lt;span class="pun"&gt;++;&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"\n"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
This would produce following result:&lt;br /&gt;
&lt;pre class="result"&gt;value of x : 10
value of x : 11
value of x : 12
value of x : 13
value of x : 14
value of x : 15
value of x : 16
value of x : 17
value of x : 18
value of x : 19
&lt;/pre&gt;
&lt;h2&gt;
The do...while Loop:&lt;/h2&gt;
A do...while loop is similar to a while loop, except that a do...while loop is guaranteed to execute at least one time.&lt;br /&gt;
&lt;h2&gt;
Syntax:&lt;/h2&gt;
The syntax of a do...while loop is:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;do&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;//Statements&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="kwd"&gt;while&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;Boolean_expression&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;/pre&gt;
Notice that the Boolean expression appears at the end of the loop, so
 the statements in the loop execute once before the Boolean is tested.&lt;br /&gt;
If the Boolean expression is true, the flow of control jumps back up 
to do, and the statements in the loop execute again. This process 
repeats until the Boolean expression is false.&lt;br /&gt;
&lt;h2&gt;
Example:&lt;/h2&gt;
&lt;pre class="prettyprint tryit prettyprinted" style="cursor: default;"&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Test&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; args&lt;/span&gt;&lt;span class="pun"&gt;[]){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;10&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

      &lt;/span&gt;&lt;span class="kwd"&gt;do&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"value of x : "&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
         x&lt;/span&gt;&lt;span class="pun"&gt;++;&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"\n"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="kwd"&gt;while&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;20&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
This would produce following result:&lt;br /&gt;
&lt;pre class="result"&gt;value of x : 10
value of x : 11
value of x : 12
value of x : 13
value of x : 14
value of x : 15
value of x : 16
value of x : 17
value of x : 18
value of x : 19
&lt;/pre&gt;
&lt;h2&gt;
The for Loop:&lt;/h2&gt;
A for loop is a repetition control structure that allows you to 
efficiently write a loop that needs to execute a specific number of 
times.&lt;br /&gt;
A for loop is useful when you know how many times a task is to be repeated.&lt;br /&gt;
&lt;h2&gt;
Syntax:&lt;/h2&gt;
The syntax of a for loop is:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;for&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;initialization&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Boolean_expression&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt; update&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;//Statements&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
Here is the flow of control in a for loop:&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;The initialization step is executed first, and only once. This 
step allows you to declare and initialize any loop control variables. 
You are not required to put a statement here, as long as a semicolon 
appears.&lt;/li&gt;
&lt;li&gt;Next, the Boolean expression is evaluated. If it is true, the 
body of the loop is executed. If it is false, the body of the loop does 
not execute and flow of control jumps to the next statement past the for
 loop.&lt;/li&gt;
&lt;li&gt;After the body of the for loop executes, the flow of control 
jumps back up to the update statement. This statement allows you to 
update any loop control variables. This statement can be left blank, as 
long as a semicolon appears after the Boolean expression.&lt;/li&gt;
&lt;li&gt;The Boolean expression is now evaluated again. If it is true, the
 loop executes and the process repeats itself (body of loop, then update
 step,then Boolean expression). After the Boolean expression is false, 
the for loop terminates.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Example:&lt;/h2&gt;
&lt;pre class="prettyprint tryit prettyprinted"&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Test&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; args&lt;/span&gt;&lt;span class="pun"&gt;[])&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;

      &lt;/span&gt;&lt;span class="kwd"&gt;for&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;10&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;20&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; x&lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="lit"&gt;1&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"value of x : "&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"\n"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
This would produce following result:&lt;br /&gt;
&lt;pre class="result"&gt;value of x : 10
value of x : 11
value of x : 12
value of x : 13
value of x : 14
value of x : 15
value of x : 16
value of x : 17
value of x : 18
value of x : 19
&lt;/pre&gt;
&lt;h2&gt;
Enhanced for loop in Java:&lt;/h2&gt;
As of java 5 the enhanced for loop was introduced. This is mainly used for Arrays.&lt;br /&gt;
&lt;h2&gt;
Syntax:&lt;/h2&gt;
The syntax of enhanced for loop is:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;for&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;declaration &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; expression&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;//Statements&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;ul class="list"&gt;
&lt;li&gt;&lt;b&gt;Declaration&lt;/b&gt; . The newly declared block variable, which is 
of a type compatible with the elements of the array you are accessing. 
The variable will be available within the for block and its value would 
be the same as the current array element.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Expression&lt;/b&gt; . This evaluate to the array you need to loop 
through. The expression can be an array variable or method call that 
returns an array.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Example:&lt;/h2&gt;
&lt;pre class="prettyprint tryit prettyprinted" style="cursor: default;"&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Test&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; args&lt;/span&gt;&lt;span class="pun"&gt;[]){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;[]&lt;/span&gt;&lt;span class="pln"&gt; numbers &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="lit"&gt;10&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;20&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;30&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;40&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;50&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;span class="pln"&gt;

      &lt;/span&gt;&lt;span class="kwd"&gt;for&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; numbers &lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;","&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"\n"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;[]&lt;/span&gt;&lt;span class="pln"&gt; names &lt;/span&gt;&lt;span class="pun"&gt;={&lt;/span&gt;&lt;span class="str"&gt;"James"&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Larry"&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Tom"&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Lacy"&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;for&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; name &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; names &lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; name &lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;","&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
This would produce following result:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="lit"&gt;10&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="lit"&gt;20&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="lit"&gt;30&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="lit"&gt;40&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="lit"&gt;50&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="typ"&gt;James&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="typ"&gt;Larry&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="typ"&gt;Tom&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="typ"&gt;Lacy&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
The break Keyword:&lt;/h2&gt;
The &lt;i&gt;break&lt;/i&gt; keyword is used to stop the entire loop. The break keyword must be used inside any loop or a switch statement.&lt;br /&gt;
The break keyword will stop the execution of the innermost loop and start executing the next line of code after the block.&lt;br /&gt;
&lt;h2&gt;
Syntax:&lt;/h2&gt;
The syntax of a break is a single statement inside any loop:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;break&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
Example:&lt;/h2&gt;
&lt;pre class="prettyprint tryit prettyprinted" style="cursor: default;"&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Test&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; args&lt;/span&gt;&lt;span class="pun"&gt;[])&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;[]&lt;/span&gt;&lt;span class="pln"&gt; numbers &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="lit"&gt;10&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;20&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;30&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;40&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;50&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;span class="pln"&gt;

      &lt;/span&gt;&lt;span class="kwd"&gt;for&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; numbers &lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="kwd"&gt;if&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;==&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;30&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
	      &lt;/span&gt;&lt;span class="kwd"&gt;break&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"\n"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
This would produce following result:&lt;br /&gt;
&lt;pre class="result"&gt;10
20
&lt;/pre&gt;
&lt;h2&gt;
The continue Keyword:&lt;/h2&gt;
The &lt;i&gt;continue&lt;/i&gt; keyword can be used in any of the loop control 
structures. It causes the loop to immediately jump to the next iteration
 of the loop.&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;In a for loop, the continue keyword causes flow of control to immediately jump to the update statement.&lt;/li&gt;
&lt;li&gt;In a while loop or do/while loop, flow of control immediately jumps to the Boolean expression.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Syntax:&lt;/h2&gt;
The syntax of a continue is a single statement inside any loop:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;continue&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
Example:&lt;/h2&gt;
&lt;pre class="prettyprint tryit prettyprinted" style="cursor: default;"&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Test&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; args&lt;/span&gt;&lt;span class="pun"&gt;[])&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;[]&lt;/span&gt;&lt;span class="pln"&gt; numbers &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="lit"&gt;10&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;20&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;30&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;40&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;50&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;span class="pln"&gt;

      &lt;/span&gt;&lt;span class="kwd"&gt;for&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; numbers &lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="kwd"&gt;if&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;==&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;30&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
	      &lt;/span&gt;&lt;span class="kwd"&gt;continue&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"\n"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
This would produce following result:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="lit"&gt;10&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="lit"&gt;20&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="lit"&gt;40&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="lit"&gt;50&lt;/span&gt;&lt;/pre&gt;
&lt;h1&gt;
Java Decision Making&lt;/h1&gt;
There are two types of decision making statements in Java. They are:&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;if statements&lt;/li&gt;
&lt;li&gt;switch statements&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
The if Statement:&lt;/h2&gt;
An if statement consists of a Boolean expression followed by one or more statements.&lt;br /&gt;
&lt;h2&gt;
Syntax:&lt;/h2&gt;
The syntax of an if statement is:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;if&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;Boolean_expression&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;//Statements will execute if the Boolean expression is true&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
If the boolean expression evaluates to true then the block of code 
inside the if statement will be executed. If not the first set of code 
after the end of the if statement(after the closing curly brace) will be
 executed.&lt;br /&gt;
&lt;h2&gt;
Example:&lt;/h2&gt;
&lt;pre class="prettyprint tryit prettyprinted" style="cursor: default;"&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Test&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; args&lt;/span&gt;&lt;span class="pun"&gt;[]){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;10&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

      &lt;/span&gt;&lt;span class="kwd"&gt;if&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;20&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"This is if statement"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
This would produce following result:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="typ"&gt;This&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;is&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;if&lt;/span&gt;&lt;span class="pln"&gt; statement&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
The if...else Statement:&lt;/h2&gt;
An if statement can be followed by an optional &lt;i&gt;else&lt;/i&gt; statement, which executes when the Boolean expression is false.&lt;br /&gt;
&lt;h2&gt;
Syntax:&lt;/h2&gt;
The syntax of a if...else is:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;if&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;Boolean_expression&lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;//Executes when the Boolean expression is true&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="kwd"&gt;else&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;//Executes when the Boolean expression is false&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
Example:&lt;/h2&gt;
&lt;pre class="prettyprint tryit prettyprinted" style="cursor: default;"&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Test&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; args&lt;/span&gt;&lt;span class="pun"&gt;[]){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;30&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

      &lt;/span&gt;&lt;span class="kwd"&gt;if&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;&amp;lt;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;20&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"This is if statement"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="kwd"&gt;else&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"This is else statement"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
This would produce following result:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="typ"&gt;This&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;is&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;else&lt;/span&gt;&lt;span class="pln"&gt; statement&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
The if...else if...else Statement:&lt;/h2&gt;
An if statement can be followed by an optional &lt;i&gt;else if...else&lt;/i&gt; statement, which is very usefull to test various conditions using single if...else if statement.&lt;br /&gt;
When using if , else if , else statements there are few points to keep in mind.&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;An if can have zero or one else's and it must come after any else if's.&lt;/li&gt;
&lt;li&gt;An if can have zero to many else if's and they must come before the else.&lt;/li&gt;
&lt;li&gt;Once an else if succeeds, none of he remaining else if's or else's will be tested.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Syntax:&lt;/h2&gt;
The syntax of a if...else is:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;if&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;Boolean_expression&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;1&lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;//Executes when the Boolean expression 1 is true&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="kwd"&gt;else&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;if&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;Boolean_expression&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;2&lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;//Executes when the Boolean expression 2 is true&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="kwd"&gt;else&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;if&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;Boolean_expression&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;3&lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;//Executes when the Boolean expression 3 is true&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="kwd"&gt;else&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;//Executes when the none of the above condition is true.&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
Example:&lt;/h2&gt;
&lt;pre class="prettyprint tryit prettyprinted" style="cursor: default;"&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Test&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; args&lt;/span&gt;&lt;span class="pun"&gt;[]){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;30&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

      &lt;/span&gt;&lt;span class="kwd"&gt;if&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;==&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;10&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Value of X is 10"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="kwd"&gt;else&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;if&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;==&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;20&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Value of X is 20"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="kwd"&gt;else&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;if&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;==&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;30&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Value of X is 30"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="kwd"&gt;else&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"This is else statement"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
This would produce following result:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="typ"&gt;Value&lt;/span&gt;&lt;span class="pln"&gt; of X &lt;/span&gt;&lt;span class="kwd"&gt;is&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;30&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
Nested if...else Statement:&lt;/h2&gt;
It is always legal to nest if-else statements, which means you can 
use one if or else if statement inside another if or else if statement.&lt;br /&gt;
&lt;h2&gt;
Syntax:&lt;/h2&gt;
The syntax for a nested if...else is as follows:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;if&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;Boolean_expression&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;1&lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;//Executes when the Boolean expression 1 is true&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;if&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;Boolean_expression&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;2&lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="com"&gt;//Executes when the Boolean expression 2 is true&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
You can nest &lt;i&gt;else if...else&lt;/i&gt; in the similar way as we have nested &lt;i&gt;if&lt;/i&gt; statement.&lt;br /&gt;
&lt;h2&gt;
Example:&lt;/h2&gt;
&lt;pre class="prettyprint tryit prettyprinted" style="cursor: default;"&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Test&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; args&lt;/span&gt;&lt;span class="pun"&gt;[]){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;30&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; y &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;10&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

      &lt;/span&gt;&lt;span class="kwd"&gt;if&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;==&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;30&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="kwd"&gt;if&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; y &lt;/span&gt;&lt;span class="pun"&gt;==&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;10&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;print&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"X = 30 and Y = 10"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
This would produce following result:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;X &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;30&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;and&lt;/span&gt;&lt;span class="pln"&gt; Y &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;10&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
The switch Statement:&lt;/h2&gt;
A &lt;i&gt;switch&lt;/i&gt; statement allows a variable to be tested for equality
 against a list of values. Each value is called a case, and the variable
 being switched on is
checked for each case.&lt;br /&gt;
&lt;h2&gt;
Syntax:&lt;/h2&gt;
The syntax of enhanced for loop is:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;switch&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;expression&lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
    &lt;/span&gt;&lt;span class="kwd"&gt;case&lt;/span&gt;&lt;span class="pln"&gt; value &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
       &lt;/span&gt;&lt;span class="com"&gt;//Statements&lt;/span&gt;&lt;span class="pln"&gt;
       &lt;/span&gt;&lt;span class="kwd"&gt;break&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="com"&gt;//optional&lt;/span&gt;&lt;span class="pln"&gt;
    &lt;/span&gt;&lt;span class="kwd"&gt;case&lt;/span&gt;&lt;span class="pln"&gt; value &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
       &lt;/span&gt;&lt;span class="com"&gt;//Statements&lt;/span&gt;&lt;span class="pln"&gt;
       &lt;/span&gt;&lt;span class="kwd"&gt;break&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="com"&gt;//optional&lt;/span&gt;&lt;span class="pln"&gt;
    &lt;/span&gt;&lt;span class="com"&gt;//You can have any number of case statements.&lt;/span&gt;&lt;span class="pln"&gt;
    &lt;/span&gt;&lt;span class="kwd"&gt;default&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="com"&gt;//Optional&lt;/span&gt;&lt;span class="pln"&gt;
       &lt;/span&gt;&lt;span class="com"&gt;//Statements&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
The following rules apply to a switch statement:&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;The variable used in a switch statement can only be a byte, short, int, or char.&lt;/li&gt;
&lt;li&gt;You can have any number of case statements within a switch. Each case is followed by the value to be compared to and a colon.&lt;/li&gt;
&lt;li&gt;The value for a case must be the same data type as the variable in the switch, and it must be a constant or a literal.&lt;/li&gt;
&lt;li&gt;When the variable being switched on is equal to a case, the statements following that case will execute until a &lt;i&gt;break&lt;/i&gt; statement is reached.&lt;/li&gt;
&lt;li&gt;When a &lt;i&gt;break&lt;/i&gt; statement is reached, the switch terminates, and the flow of control jumps to the next line following the switch statement.&lt;/li&gt;
&lt;li&gt;Not every case needs to contain a break. If no break appears, the flow of control will &lt;i&gt;fall through&lt;/i&gt; to subsequent cases until a break is reached.&lt;/li&gt;
&lt;li&gt;A &lt;i&gt;switch&lt;/i&gt; statement can have an optional default case, 
which must appear at the end of the switch. The default case can be used
 for performing a task when none of the cases is true. No break is 
needed in the default case.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Example:&lt;/h2&gt;
&lt;pre class="prettyprint tryit prettyprinted" style="cursor: default;"&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Test&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; args&lt;/span&gt;&lt;span class="pun"&gt;[]){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;char&lt;/span&gt;&lt;span class="pln"&gt; grade &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; args&lt;/span&gt;&lt;span class="pun"&gt;[&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;].&lt;/span&gt;&lt;span class="pln"&gt;charAt&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;

      &lt;/span&gt;&lt;span class="kwd"&gt;switch&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;grade&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="kwd"&gt;case&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;'A'&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
            &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Excellent!"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt; 
            &lt;/span&gt;&lt;span class="kwd"&gt;break&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="kwd"&gt;case&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;'B'&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="kwd"&gt;case&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;'C'&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
            &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Well done"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
            &lt;/span&gt;&lt;span class="kwd"&gt;break&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="kwd"&gt;case&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;'D'&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
            &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"You passed"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="kwd"&gt;case&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;'F'&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
            &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Better try again"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
            &lt;/span&gt;&lt;span class="kwd"&gt;break&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
         &lt;/span&gt;&lt;span class="kwd"&gt;default&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;
            &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Invalid grade"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Your grade is "&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; grade&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
Compile and run above program using various command line arguments. This would produce following result:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;$ java &lt;/span&gt;&lt;span class="typ"&gt;Test&lt;/span&gt;&lt;span class="pln"&gt; a
&lt;/span&gt;&lt;span class="typ"&gt;Invalid&lt;/span&gt;&lt;span class="pln"&gt; grade
&lt;/span&gt;&lt;span class="typ"&gt;Your&lt;/span&gt;&lt;span class="pln"&gt; grade &lt;/span&gt;&lt;span class="kwd"&gt;is&lt;/span&gt;&lt;span class="pln"&gt; a a
$ java &lt;/span&gt;&lt;span class="typ"&gt;Test&lt;/span&gt;&lt;span class="pln"&gt; A
&lt;/span&gt;&lt;span class="typ"&gt;Excellent&lt;/span&gt;&lt;span class="pun"&gt;!&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="typ"&gt;Your&lt;/span&gt;&lt;span class="pln"&gt; grade &lt;/span&gt;&lt;span class="kwd"&gt;is&lt;/span&gt;&lt;span class="pln"&gt; a A
$ java &lt;/span&gt;&lt;span class="typ"&gt;Test&lt;/span&gt;&lt;span class="pln"&gt; C
&lt;/span&gt;&lt;span class="typ"&gt;Well&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;done&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="typ"&gt;Your&lt;/span&gt;&lt;span class="pln"&gt; grade &lt;/span&gt;&lt;span class="kwd"&gt;is&lt;/span&gt;&lt;span class="pln"&gt; a C
$&lt;/span&gt;&lt;/pre&gt;
&lt;h1&gt;
Java - Numbers Class&lt;/h1&gt;
Normally, when we work with Numbers, we use primitive data  types  such as  byte, int, long, double etc.&lt;br /&gt;
&lt;h2&gt;
Example:&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; i &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;5000&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;float&lt;/span&gt;&lt;span class="pln"&gt; gpa &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;13.65&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;byte&lt;/span&gt;&lt;span class="pln"&gt; mask &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0xaf&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;/pre&gt;
However in development we come across situations were we need to use 
objects instead of primitive data types. In-order to achieve this Java 
provides wrapper classes for each primitive data type.&lt;br /&gt;
All the wrapper classes ( Integer, Long, Byte, Double, Float, Short) are subclasses of the abstract class Number.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxgVWSPDLTdZ6WVW6UQnls4D_Fcc7EDlAT9tQRep7lPtgjJiC0x68jKnr5AyN6JRFNbGBrrwzWuu7zf4gCYMfC-irhyphenhyphenZKYrPDp-5R7PJPbKoTPKHXR94KV__bWxch3A0Z0clZ5rd8GsHqI/s1600/number_classes.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="133" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxgVWSPDLTdZ6WVW6UQnls4D_Fcc7EDlAT9tQRep7lPtgjJiC0x68jKnr5AyN6JRFNbGBrrwzWuu7zf4gCYMfC-irhyphenhyphenZKYrPDp-5R7PJPbKoTPKHXR94KV__bWxch3A0Z0clZ5rd8GsHqI/s320/number_classes.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;center&gt;

&lt;/center&gt;
This wrapping is taken care of by the compiler The process is called 
boxing. So when a primitive is used when an object is required the 
compiler boxes the primitive type in its wrapper class. Similarly the 
compiler unboxes the object to a primitive as well. The &lt;b&gt;Number&lt;/b&gt; is part of the java.lang package.&lt;br /&gt;
Here is an example of boxing and unboxing:&lt;br /&gt;
&lt;pre class="prettyprint tryit prettyprinted" style="cursor: default;"&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Test&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; args&lt;/span&gt;&lt;span class="pun"&gt;[]){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;Integer&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;5&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="com"&gt;// boxes int to an Integer object&lt;/span&gt;&lt;span class="pln"&gt;
      x &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt;  x &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;10&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;   &lt;/span&gt;&lt;span class="com"&gt;// unboxes the Integer to a int&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;x&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt; 
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
This would produce following result:&lt;br /&gt;
&lt;pre class="result"&gt;15
&lt;/pre&gt;
When x is assigned integer values, the compiler boxes the integer 
because x is integer objects. Later, x is unboxed so that they can be 
added as integers.&lt;br /&gt;
&lt;h2&gt;
Number Methods:&lt;/h2&gt;
Here is the list of the instance methods that all the subclasses of the Number class implement:&lt;br /&gt;
&lt;table class="src"&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;th&gt;SN&lt;/th&gt;&lt;th&gt;Methods with Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;xxxValue()&lt;/a&gt;&lt;br /&gt;
Converts the value of &lt;i&gt;this&lt;/i&gt; Number object to the xxx data type and returned it.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;compareTo()&lt;/a&gt;&lt;br /&gt;
Compares &lt;i&gt;this&lt;/i&gt; Number object to the argument.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;equals()&lt;/a&gt;&lt;br /&gt;
Determines whether &lt;i&gt;this&lt;/i&gt; number object is equal to the argument.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;valueOf()&lt;/a&gt;&lt;br /&gt;
Returns an Integer object holding the value of the specified primitive.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;5&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;toString()&lt;/a&gt;&lt;br /&gt;
Returns a String object representing the value of specified int or Integer.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;6&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;parseInt()&lt;/a&gt;&lt;br /&gt;
This method is used to get the primitive data type of a certain String.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;7&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;abs()&lt;/a&gt;&lt;br /&gt;
Returns the absolute value of the argument.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;8&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;ceil()&lt;/a&gt;&lt;br /&gt;
Returns the smallest integer that is greater than or equal to the argument. Returned as a double.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;9&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;floor()&lt;/a&gt;&lt;br /&gt;
Returns the largest integer that is less than or equal to the argument. Returned as a double.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;10&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;rint()&lt;/a&gt;&lt;br /&gt;
Returns the integer that is closest in value to the argument. Returned as a double.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;11&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;round()&lt;/a&gt;&lt;br /&gt;
Returns the closest long or int, as indicated by the method's return type, to the argument.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;12&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;min()&lt;/a&gt;&lt;br /&gt;
Returns the smaller of the two arguments.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;13&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;max()&lt;/a&gt;&lt;br /&gt;
Returns the larger of the two arguments.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;14&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;exp()&lt;/a&gt;&lt;br /&gt;
Returns the base of the natural logarithms, e, to the power of the argument.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;15&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;log()&lt;/a&gt;&lt;br /&gt;
Returns the natural logarithm of the argument.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;16&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;pow()&lt;/a&gt;&lt;br /&gt;
Returns the value of the first argument raised to the power of the second argument.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;17&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;sqrt()&lt;/a&gt;&lt;br /&gt;
Returns the square root of the argument.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;18&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;sin()&lt;/a&gt;&lt;br /&gt;
Returns the sine of the specified double value.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;19&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;cos()&lt;/a&gt;&lt;br /&gt;
Returns the cosine of the specified double value.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;20&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;tan()&lt;/a&gt;&lt;br /&gt;
Returns the tangent of the specified double value.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;21&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;asin()&lt;/a&gt;&lt;br /&gt;
Returns the arcsine of the specified double value.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;22&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;acos()&lt;/a&gt;&lt;br /&gt;
Returns the arccosine of the specified double value.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;23&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;atan()&lt;/a&gt;&lt;br /&gt;
Returns the arctangent of the specified double value.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;24&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;atan2()&lt;/a&gt;&lt;br /&gt;
Converts rectangular coordinates (x, y) to polar coordinate (r, theta) and returns theta.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;25&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;toDegrees()&lt;/a&gt;&lt;br /&gt;
Converts the argument to degrees&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;26&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;toRadians()&lt;/a&gt;&lt;br /&gt;
Converts the argument to radians.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;27&lt;/td&gt;&lt;td&gt;&lt;a href="http://www.blogger.com/null"&gt;random()&lt;/a&gt;&lt;br /&gt;
Returns a random number.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;h1&gt;
&lt;/h1&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxgVWSPDLTdZ6WVW6UQnls4D_Fcc7EDlAT9tQRep7lPtgjJiC0x68jKnr5AyN6JRFNbGBrrwzWuu7zf4gCYMfC-irhyphenhyphenZKYrPDp-5R7PJPbKoTPKHXR94KV__bWxch3A0Z0clZ5rd8GsHqI/s72-c/number_classes.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Java Tutorial Part-III</title><link>http://hamidkalu.blogspot.com/2013/09/java-tutorial-part-iii.html</link><category>Java Basic Data Types</category><category>Java Basic Syntax</category><category>Java Objects and Classes</category><author>noreply@blogger.com (Hamid)</author><pubDate>Sun, 22 Sep 2013 12:28:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7786780271346850842.post-6522244811000032438</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;h1&gt;
Java Basic Syntax&lt;/h1&gt;
When we consider a Java program it can be defined as a collection of 
objects that communicate via invoking each others methods. Let us now 
briefly look into what do class, object, methods and instance variables 
mean.&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;&lt;b&gt;Object -&lt;/b&gt; Objects have states and behaviors. Example: A dog
 has states-color, name, breed as well as behaviors -wagging, barking, 
eating. An object is an instance of a class. &lt;/li&gt;
&lt;li&gt;&lt;b&gt;Class -&lt;/b&gt; A class can be defined as a template/ blue print that describe the behaviors/states that object of its type support.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Methods -&lt;/b&gt; A method is basically a behavior. A class can 
contain many methods. It is in methods where the logics are written, 
data is manipulated and all the actions are executed.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Instance Variables -&lt;/b&gt; Each object has its unique set of 
instance variables. An object's state is created by the values assigned 
to these instance variables.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
First Java Program:&lt;/h2&gt;
Let us look at a simple code that would print the words &lt;i&gt;Hello World&lt;/i&gt;.&lt;br /&gt;
&lt;pre class="prettyprint tryit prettyprinted" style="cursor: default;"&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;MyFirstJavaProgram&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="com"&gt;/* This is my first java program.  
    * This will print 'Hello World' as the output
    */&lt;/span&gt;&lt;span class="pln"&gt;

    &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;[]&lt;/span&gt;&lt;span class="pln"&gt;args&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
       &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Hello World"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="com"&gt;// prints Hello World&lt;/span&gt;&lt;span class="pln"&gt;
    &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;/pre&gt;
Lets look at how to save the file, compile and run the program. Please follow the steps given below:&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;Open notepad and add the code as above.&lt;/li&gt;
&lt;li&gt;Save the file as :  MyFirstJavaProgram.java.&lt;/li&gt;
&lt;li&gt;Open a command prompt window and go o the directory where you saved the  class. Assume its C:\.&lt;/li&gt;
&lt;li&gt;Type ' javac MyFirstJavaProgram.java ' and press enter to compile
 your code. If there are no errors in your code the command prompt will 
take you to the next line.( Assumption : The path variable is set).&lt;/li&gt;
&lt;li&gt;Now type ' java MyFirstJavaProgram ' to run your program.&lt;/li&gt;
&lt;li&gt;You will be able to see ' Hello World ' printed on the window.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;C &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;gt;&lt;/span&gt;&lt;span class="pln"&gt; javac &lt;/span&gt;&lt;span class="typ"&gt;MyFirstJavaProgram&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;java
C &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;&amp;gt;&lt;/span&gt;&lt;span class="pln"&gt; java &lt;/span&gt;&lt;span class="typ"&gt;MyFirstJavaProgram&lt;/span&gt;&lt;span class="pln"&gt; 
&lt;/span&gt;&lt;span class="typ"&gt;Hello&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;World&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
Basic Syntax:&lt;/h2&gt;
About Java programs, it is very important to keep in mind the following points.&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;&lt;b&gt;Case Sensitivity - &lt;/b&gt; Java is case sensitive which means identifier &lt;b&gt;Hello&lt;/b&gt; and &lt;b&gt;hello&lt;/b&gt; would have different meaning in Java.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Class Names - &lt;/b&gt; For all class names the first letter should be in Upper Case. &lt;br /&gt;&lt;br /&gt; If several words are used to form a name of the class each inner words first letter should be in Upper Case.&lt;br /&gt;&lt;br /&gt; Example &lt;i&gt;class MyFirstJavaClass &lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Method Names - &lt;/b&gt; All method names should start with a Lower Case letter.  &lt;br /&gt;&lt;br /&gt; If several words are  used to form the name of the method, then each inner word's first letter should be in Upper Case.&lt;br /&gt;&lt;br /&gt; Example &lt;i&gt;public void myMethodName()&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Program File Name - &lt;/b&gt; Name of the program file should exactly match the class name.  &lt;br /&gt;&lt;br /&gt;
 When saving the file you should save it using the class name (Remember 
java is case sensitive) and append '.java' to the end of the name. (if 
the file name and the class name do not match your program will not 
compile).&lt;br /&gt;&lt;br /&gt; Example : Assume 'MyFirstJavaProgram' is the class  name. Then the file should be saved as &lt;i&gt;'MyFirstJavaProgram.java'&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;public static void main(String args[]) -&lt;/b&gt; java program processing starts from the main() method which is a mandatory part of every java program..&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Java Identifiers:&lt;/h2&gt;
All java components require names. Names used for classes, variables and methods are called identifiers.&lt;br /&gt;
In java there are several points to remember about identifiers. They are as follows:&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;All identifiers should begin with a letter (A to Z or a to z ), currency character ($) or an underscore (_).&lt;/li&gt;
&lt;li&gt;After the first character identifiers can have any combination of characters.&lt;/li&gt;
&lt;li&gt;A key word cannot be used as an identifier.&lt;/li&gt;
&lt;li&gt;Most importantly identifiers are case sensitive.&lt;/li&gt;
&lt;li&gt;Examples of legal identifiers:age, $salary, _value,  __1_value&lt;/li&gt;
&lt;li&gt;Examples of illegal identifiers : 123abc, -salary&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Java Modifiers:&lt;/h2&gt;
Like other languages it is possible to modify classes, methods etc by using modifiers. There are two categories of modifiers.&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;&lt;b&gt;Access Modifiers : &lt;/b&gt; default, public , protected, private&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Non-access Modifiers : &lt;/b&gt; final, abstract, strictfp&lt;/li&gt;
&lt;/ul&gt;
We will be looking into more details about modifiers in the next section.&lt;br /&gt;
&lt;h2&gt;
Java Variables:&lt;/h2&gt;
We would see following type of variables in Java:&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;Local Variables&lt;/li&gt;
&lt;li&gt;Class Variables (Static Variables)&lt;/li&gt;
&lt;li&gt;Instance Variables (Non static variables)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Java Arrays:&lt;/h2&gt;
Arrays are objects that store multiple variables of the same type. 
However an Array itself is an object on the heap. We will look into how 
to declare, construct and initialize in the upcoming chapters.&lt;br /&gt;
&lt;h2&gt;
Java Enums:&lt;/h2&gt;
Enums were introduced in java 5.0. Enums restrict a variable to have 
one of only a few predefined values. The values in this enumerated list 
are called enums.&lt;br /&gt;
With the use of enums it is possible to reduce the number of bugs in your code. &lt;br /&gt;
For example if we consider an application for a fresh juice shop it 
would be possible to restrict the glass size to small, medium and Large.
 This would make sure that it would not allow anyone to order any size 
other than the small, medium or large.&lt;br /&gt;
&lt;h2&gt;
Example:&lt;/h2&gt;
&lt;pre class="prettyprint tryit prettyprinted" style="cursor: default;"&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;FreshJuice&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;enum&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;FreshJuiceSize&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt; SMALL&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; MEDUIM&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; LARGE &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;FreshJuiceSize&lt;/span&gt;&lt;span class="pln"&gt; size&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;

&lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;FreshJuiceTest&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; args&lt;/span&gt;&lt;span class="pun"&gt;[]){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;FreshJuice&lt;/span&gt;&lt;span class="pln"&gt; juice &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;new&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;FreshJuice&lt;/span&gt;&lt;span class="pun"&gt;();&lt;/span&gt;&lt;span class="pln"&gt;
      juice&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;size &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;FreshJuice&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;FreshJuiceSize&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;MEDUIM &lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Size: "&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; juice&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;size&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
Above example will produce following result:&lt;br /&gt;
&lt;pre class="result"&gt;Size: MEDUIM
&lt;/pre&gt;
&lt;b&gt;Note:&lt;/b&gt; enums can be declared as their own or inside a class. Methods, variables, constructors can be defined inside enums as well.&lt;br /&gt;
&lt;h2&gt;
Java Keywords:&lt;/h2&gt;
The following list shows the reserved words in Java. These reserved 
words may not be used as constant or variable or any other identifier 
names.&lt;br /&gt;
&lt;table class="src"&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;abstract&lt;/td&gt;&lt;td&gt;assert&lt;/td&gt;&lt;td&gt;boolean&lt;/td&gt;&lt;td&gt;break&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;byte&lt;/td&gt;&lt;td&gt;case&lt;/td&gt;&lt;td&gt;catch&lt;/td&gt;&lt;td&gt;char&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;class&lt;/td&gt;&lt;td&gt;const&lt;/td&gt;&lt;td&gt;continue&lt;/td&gt;&lt;td&gt;default&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;do&lt;/td&gt;&lt;td&gt;double&lt;/td&gt;&lt;td&gt;else&lt;/td&gt;&lt;td&gt;enum&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;extends&lt;/td&gt;&lt;td&gt;final&lt;/td&gt;&lt;td&gt;finally&lt;/td&gt;&lt;td&gt;float&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;for&lt;/td&gt;&lt;td&gt;goto&lt;/td&gt;&lt;td&gt;if&lt;/td&gt;&lt;td&gt;implements&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;import&lt;/td&gt;&lt;td&gt;instanceof&lt;/td&gt;&lt;td&gt;int&lt;/td&gt;&lt;td&gt;interface&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;long&lt;/td&gt;&lt;td&gt;native&lt;/td&gt;&lt;td&gt;new&lt;/td&gt;&lt;td&gt;package&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;private&lt;/td&gt;&lt;td&gt;protected&lt;/td&gt;&lt;td&gt;public&lt;/td&gt;&lt;td&gt;return&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;short&lt;/td&gt;&lt;td&gt;static&lt;/td&gt;&lt;td&gt;strictfp&lt;/td&gt;&lt;td&gt;super&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;switch&lt;/td&gt;&lt;td&gt;synchronized&lt;/td&gt;&lt;td&gt;this&lt;/td&gt;&lt;td&gt;throw&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;throws&lt;/td&gt;&lt;td&gt;transient&lt;/td&gt;&lt;td&gt;try&lt;/td&gt;&lt;td&gt;void&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;volatile&lt;/td&gt;&lt;td&gt;while&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h2&gt;
Comments in Java&lt;/h2&gt;
Java supports single line and multi-line comments very similar to c 
and c++. All characters available inside any comment are ignored by Java
 compiler.&lt;br /&gt;
&lt;pre class="prettyprint tryit prettyprinted"&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;MyFirstJavaProgram&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="com"&gt;/* This is my first java program.
    * This will print 'Hello World' as the output
    * This is an example of multi-line comments.
    */&lt;/span&gt;&lt;span class="pln"&gt;

    &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;[]&lt;/span&gt;&lt;span class="pln"&gt;args&lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
       &lt;/span&gt;&lt;span class="com"&gt;// This is an example of single line comment&lt;/span&gt;&lt;span class="pln"&gt;
       &lt;/span&gt;&lt;span class="com"&gt;/* This is also an example of single line comment. */&lt;/span&gt;&lt;span class="pln"&gt;
       &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Hello World"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt; 
    &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
Using Blank Lines:&lt;/h2&gt;
A line containing only whitespace, possibly with a comment, is known as a blank line, and Java totally ignores it.&lt;br /&gt;
&lt;h2&gt;
Inheritance:&lt;/h2&gt;
In java classes can be derived from classes.  Basically if you need 
to create a new class and here is already a class that has some of the 
code you require, then it is possible to derive your new class from the 
already existing code. &lt;br /&gt;
This concept allows you to reuse the fields and methods of the 
existing class with out having to rewrite the code in a new class. In 
this scenario the existing class is called the super class and the 
derived class is called the subclass.&lt;br /&gt;
&lt;h2&gt;
Interfaces:&lt;/h2&gt;
In Java language an interface can be defined as a contract between 
objects on how to communicate with each other. Interfaces play a vital 
role when it comes to the concept of inheritance.&lt;br /&gt;
An interface defines the methods, a deriving class(subclass) should 
use. But the implementation of the methods is totally up to the 
subclass.&lt;br /&gt;
&lt;h1&gt;
Java - Objects and Classes&lt;/h1&gt;
Java is an Object Oriented Language. As a language that has the 
Object Oriented feature Java supports the following fundamental 
concepts:&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;Polymorphism&lt;/li&gt;
&lt;li&gt;Inheritance&lt;/li&gt;
&lt;li&gt;Encapsulation&lt;/li&gt;
&lt;li&gt;Abstraction&lt;/li&gt;
&lt;li&gt;Classes&lt;/li&gt;
&lt;li&gt;Objects&lt;/li&gt;
&lt;li&gt;Instance&lt;/li&gt;
&lt;li&gt;Method&lt;/li&gt;
&lt;li&gt;Message Parsing&lt;/li&gt;
&lt;/ul&gt;
In this chapter we will look into the concepts Classes and Objects.&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;&lt;b&gt;Object -&lt;/b&gt; Objects have states and behaviors. Example: A dog
 has states-color, name, breed as well as behaviors -wagging, barking, 
eating. An object is an instance of a class. &lt;/li&gt;
&lt;li&gt;&lt;b&gt;Class -&lt;/b&gt; A class can be defined as a template/ blue print that describe the behaviors/states that object of its type support.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Objects in Java:&lt;/h2&gt;
Let us now look deep into what are objects. If we consider the 
real-world we can find many objects around us, Cars, Dogs, Humans etc. 
All these objects have a state and behavior.&lt;br /&gt;
If we consider a dog then its state is - name, breed, color, and the behavior is - barking, wagging, running&lt;br /&gt;
If you compare the software object with a real world object, they have very similar characteristics.&lt;br /&gt;
Software objects also have a state and behavior. A software object's 
state is stored in fields and behavior is shown via methods.&lt;br /&gt;
So in software development methods operate on the internal state of 
an object and the object-to-object communication is done via methods.&lt;br /&gt;
&lt;h2&gt;
Classes in Java:&lt;/h2&gt;
A class is a blue print from which individual objects are created.&lt;br /&gt;
A sample of a class is given below:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Dog&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; breed&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; age&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; color&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; barking&lt;/span&gt;&lt;span class="pun"&gt;(){&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   
   &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; hungry&lt;/span&gt;&lt;span class="pun"&gt;(){&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   
   &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; sleeping&lt;/span&gt;&lt;span class="pun"&gt;(){&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
A class can contain any of the following variable types.&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;&lt;b&gt;Local variables . &lt;/b&gt;variables defined inside methods, 
constructors or blocks are called local variables. The variable will be 
declared and initialized within the method and the variable will be 
destroyed when the method has completed.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Instance variables . &lt;/b&gt;Instance variables are variables 
within a class but outside any method. These variables are instantiated 
when the class is loaded. Instance variables can be accessed from inside
 any method, constructor or blocks of that particular class.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Class variables . &lt;/b&gt; Class variables are variables declared with in a class, outside any method, with the static keyword.&lt;/li&gt;
&lt;/ul&gt;
A class can have any number of methods to access the value of various
 kind of methods. In the above example, barking(), hungry() and 
sleeping() are methods.&lt;br /&gt;
Below mentioned are some of the important topics that need to be discussed when looking into classes of the Java Language.&lt;br /&gt;
&lt;h2&gt;
Constructors:&lt;/h2&gt;
When discussing about classes one of the most important sub topic 
would be constructors. Every class has a constructor. If we do not 
explicitly write a constructor for a class the java compiler builds a 
default constructor for that class.&lt;br /&gt;
Each time a new object is created at least one constructor will be 
invoked. The main rule of constructors is that they should have the same
 name as the class. A class can have more than one constructor.&lt;br /&gt;
Example of a constructor is given below:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Puppy&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; puppy&lt;/span&gt;&lt;span class="pun"&gt;(){&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; puppy&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; name&lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="com"&gt;// This constructor has one parameter, &lt;/span&gt;&lt;i&gt;&lt;span class="com"&gt;name&lt;/span&gt;&lt;/i&gt;&lt;span class="com"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
Java also supports &lt;a href="http://www.blogger.com/null"&gt;Singleton Classes&lt;/a&gt; where you would be able to create only one instance of a class.&lt;br /&gt;
&lt;h2&gt;
Creating an Object:&lt;/h2&gt;
As mentioned previously a class provides the blueprints for objects. 
So basically an object is created from a class. In java the new key word
 is used to create new objects. &lt;br /&gt;
There are three steps when creating an object from a class:&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;&lt;b&gt;Declaration . &lt;/b&gt;A variable declaration with a variable name with an object type.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Instantiation . &lt;/b&gt;The 'new' key word is used to create the object.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Initialization . &lt;/b&gt;The 'new' keyword is followed by a call to a constructor. This call initializes the new object.&lt;/li&gt;
&lt;/ul&gt;
Example of creating an object is given below:&lt;br /&gt;
&lt;pre class="prettyprint tryit prettyprinted"&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Puppy&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Puppy&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; name&lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="com"&gt;// This constructor has one parameter, &lt;/span&gt;&lt;i&gt;&lt;span class="com"&gt;name&lt;/span&gt;&lt;/i&gt;&lt;span class="com"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Passed Name is :"&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; name &lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt; 
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;[]&lt;/span&gt;&lt;span class="pln"&gt;args&lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="com"&gt;// Following statement would create an object myPuppy&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;Puppy&lt;/span&gt;&lt;span class="pln"&gt; myPuppy &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;new&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Puppy&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"tommy"&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
If we compile and run the above program then it would produce following result:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="typ"&gt;Passed&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Name&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;is&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;tommy&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
Accessing Instance Variables and Methods:&lt;/h2&gt;
Instance variables and methods are accessed via created objects. To 
access an instance variable the fully qualified path should be as 
follows:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="com"&gt;/* First create an object */&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="typ"&gt;ObjectReference&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;new&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Constructor&lt;/span&gt;&lt;span class="pun"&gt;();&lt;/span&gt;&lt;span class="pln"&gt;

&lt;/span&gt;&lt;span class="com"&gt;/* Now call a variable as follows */&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="typ"&gt;ObjectReference&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;variableName&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

&lt;/span&gt;&lt;span class="com"&gt;/* Now you can call a class method as follows */&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="typ"&gt;ObjectReference&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="typ"&gt;MethodName&lt;/span&gt;&lt;span class="pun"&gt;();&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
Example:&lt;/h2&gt;
This example explains how to access instance variables and methods of a class:&lt;br /&gt;
&lt;pre class="prettyprint tryit prettyprinted"&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Puppy&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   
   &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; puppyAge&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Puppy&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; name&lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="com"&gt;// This constructor has one parameter, &lt;/span&gt;&lt;i&gt;&lt;span class="com"&gt;name&lt;/span&gt;&lt;/i&gt;&lt;span class="com"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Passed Name is :"&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; name &lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt; 
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; setAge&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; age &lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
       puppyAge &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; age&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; getAge&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
       &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Puppy's age is :"&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; puppyAge &lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt; 
       &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; puppyAge&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;[]&lt;/span&gt;&lt;span class="pln"&gt;args&lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="com"&gt;/* Object creation */&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;Puppy&lt;/span&gt;&lt;span class="pln"&gt; myPuppy &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;new&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Puppy&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"tommy"&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;

      &lt;/span&gt;&lt;span class="com"&gt;/* Call class method to set puppy's age */&lt;/span&gt;&lt;span class="pln"&gt;
      myPuppy&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;setAge&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;2&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;

      &lt;/span&gt;&lt;span class="com"&gt;/* Call another class method to get puppy's age */&lt;/span&gt;&lt;span class="pln"&gt;
      myPuppy&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;getAge&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;

      &lt;/span&gt;&lt;span class="com"&gt;/* You can access instance variable as follows as well */&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Variable Value :"&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; myPuppy&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;puppyAge &lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt; 
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
If we compile and run the above program then it would produce following result:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="typ"&gt;Passed&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Name&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;is&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;tommy
&lt;/span&gt;&lt;span class="typ"&gt;Puppy&lt;/span&gt;&lt;span class="str"&gt;'s age is :2
Variable Value :2&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
Source file declaration rules:&lt;/h2&gt;
As the last part of this section lets us now look into the source 
file declaration rules. These rules are essential when declaring 
classes, &lt;i&gt;import&lt;/i&gt; statements and &lt;i&gt;package&lt;/i&gt; statements in a source file.&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;There can be only one public class per source file.&lt;/li&gt;
&lt;li&gt;A source file can have multiple non public classes.&lt;/li&gt;
&lt;li&gt;The public class name should be the name of the source file as well which should be appended by &lt;b&gt;.java&lt;/b&gt; at the end. For example : The class name is . &lt;i&gt;public class Employee{}&lt;/i&gt; Then the source file should be as Employee.java.&lt;/li&gt;
&lt;li&gt;If the class is defined inside a package, then the package statement should be the first statement in the source file.&lt;/li&gt;
&lt;li&gt;If import statements are present then they must be written 
between the package statement and the class declaration. If there are no
 package statements then the import statement should be the first line 
in the source file. &lt;/li&gt;
&lt;li&gt;Import and package statements will imply to all the classes 
present in the source file. It is not possible to declare different 
import and/or package statements to different classes in the source 
file.&lt;/li&gt;
&lt;/ul&gt;
Classes have several access levels and there are different types of 
classes; abstract classes, final classes etc. I will be explaining about
 all these in the access modifiers chapter.&lt;br /&gt;
Apart from the above mentioned types of classes, Java also has some special classes called Inner classes and Anonymous classes.&lt;br /&gt;
&lt;h2&gt;
Java Package:&lt;/h2&gt;
In simple it is a way of categorizing the classes and interfaces. 
When developing applications in Java,  hundreds of classes and 
interfaces will be written, therefore categorizing these classes is a 
must as well as makes life much easier.&lt;br /&gt;
&lt;h2&gt;
Import statements:&lt;/h2&gt;
In java if a fully qualified name, which includes the package and the
 class name, is given then the compiler can easily locate the source 
code or classes. Import statement is a way of giving the proper location
 for the compiler to find that particular class.&lt;br /&gt;
For example following line would ask compiler to load all the classes available in directory java_installation/java/io :&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;import&lt;/span&gt;&lt;span class="pln"&gt; java&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;io&lt;/span&gt;&lt;span class="pun"&gt;.*;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
A Simple Case Study:&lt;/h2&gt;
For our case study we will be creating two classes. They are Employee and EmployeeTest.&lt;br /&gt;
First open notepad and add the following code. Remember this is the 
Employee class and the class is a public class. Now save this source 
file with the name Employee.java.&lt;br /&gt;
The Employee class has four instance variables name, age, designation
 and salary. The class has one explicitly defined constructor which 
takes a parameter.&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;import&lt;/span&gt;&lt;span class="pln"&gt; java&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;io&lt;/span&gt;&lt;span class="pun"&gt;.*;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Employee&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; name&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; age&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; designation&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; salary&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
 
   &lt;/span&gt;&lt;span class="com"&gt;// This is the constructor of the class Employee&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Employee&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; name&lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;this&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;name &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; name&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;// Assign the age of the Employee  to the variable age.&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; empAge&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; empAge&lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
      age &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt;  empAge&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;/* Assign the designation to the variable designation.*/&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; empDesignation&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; empDesig&lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
      designation &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; empDesig&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;/* Assign the salary to the variable salary.*/&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; empSalary&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; empSalary&lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
      salary &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; empSalary&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;/* Print the Employee details */&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; printEmployee&lt;/span&gt;&lt;span class="pun"&gt;(){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Name:"&lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; name &lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Age:"&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; age &lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Designation:"&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; designation &lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Salary:"&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; salary&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
As mentioned previously in this tutorial processing starts from the 
main method. Therefore in-order for us to run this Employee class there 
should be main method and objects should be created. We will be creating
 a separate class for these tasks.&lt;br /&gt;
Given below is the &lt;i&gt;EmployeeTest&lt;/i&gt; class which creates two 
instances of the class Employee and invokes the methods for each object 
to assign values for each variable.&lt;br /&gt;
Save the following code in EmployeeTest.java file&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="kwd"&gt;import&lt;/span&gt;&lt;span class="pln"&gt; java&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;io&lt;/span&gt;&lt;span class="pun"&gt;.*;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;EmployeeTest&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; args&lt;/span&gt;&lt;span class="pun"&gt;[]){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="com"&gt;/* Create two objects using constructor */&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;Employee&lt;/span&gt;&lt;span class="pln"&gt; empOne &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;new&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Employee&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"James Smith"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;Employee&lt;/span&gt;&lt;span class="pln"&gt; empTwo &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;new&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Employee&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Mary Anne"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;

      &lt;/span&gt;&lt;span class="com"&gt;// Invoking methods for each object created&lt;/span&gt;&lt;span class="pln"&gt;
      empOne&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;empAge&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;26&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      empOne&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;empDesignation&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Senior Software Engineer"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      empOne&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;empSalary&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;1000&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      empOne&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;printEmployee&lt;/span&gt;&lt;span class="pun"&gt;();&lt;/span&gt;&lt;span class="pln"&gt;

      empTwo&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;empAge&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;21&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      empTwo&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;empDesignation&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Software Engineer"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      empTwo&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;empSalary&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;500&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      empTwo&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;printEmployee&lt;/span&gt;&lt;span class="pun"&gt;();&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/pre&gt;
Now compile both the classes and then run &lt;i&gt;EmployeeTest&lt;/i&gt; to see the result as follows:&lt;br /&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;C &lt;/span&gt;&lt;span class="pun"&gt;:&amp;gt;&lt;/span&gt;&lt;span class="pln"&gt; javac &lt;/span&gt;&lt;span class="typ"&gt;Employee&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;java
C &lt;/span&gt;&lt;span class="pun"&gt;:&amp;gt;&lt;/span&gt;&lt;span class="pln"&gt; vi &lt;/span&gt;&lt;span class="typ"&gt;EmployeeTest&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;java
C &lt;/span&gt;&lt;span class="pun"&gt;:&amp;gt;&lt;/span&gt;&lt;span class="pln"&gt; javac  &lt;/span&gt;&lt;span class="typ"&gt;EmployeeTest&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;java
C &lt;/span&gt;&lt;span class="pun"&gt;:&amp;gt;&lt;/span&gt;&lt;span class="pln"&gt; java &lt;/span&gt;&lt;span class="typ"&gt;EmployeeTest&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="typ"&gt;Name&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="typ"&gt;James&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Smith&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="typ"&gt;Age&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="lit"&gt;26&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="typ"&gt;Designation&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="typ"&gt;Senior&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Software&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Engineer&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="typ"&gt;Salary&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="lit"&gt;1000.0&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="typ"&gt;Name&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="typ"&gt;Mary&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Anne&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="typ"&gt;Age&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="lit"&gt;21&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="typ"&gt;Designation&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="typ"&gt;Software&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Engineer&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="typ"&gt;Salary&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="lit"&gt;500.0&lt;/span&gt;&lt;/pre&gt;
&lt;h1&gt;
Java Basic Data Types&lt;/h1&gt;
Variables are nothing but reserved memory locations to store values. 
This means that when you create a variable you reserve some space in 
memory.&lt;br /&gt;
Based on the data type of a variable, the operating system allocates 
memory and decides what can be stored in the reserved memory. Therefore,
 by assigning different data types to variables, you can store integers,
 decimals, or characters in these variables.&lt;br /&gt;
There are two data types available in Java:&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;Primitive Data Types&lt;/li&gt;
&lt;li&gt;Reference/Object Data Types&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Primitive Data Types:&lt;/h2&gt;
There are eight primitive data types supported by Java. Primitive 
data types are predefined by the language and named by a key word. Let 
us now look into detail about the eight primitive data types.&lt;br /&gt;
&lt;h2&gt;
byte:&lt;/h2&gt;
&lt;ul class="list"&gt;
&lt;li&gt;Byte data type is a 8-bit signed two's complement integer.&lt;/li&gt;
&lt;li&gt;Minimum value is -128 (-2^7)&lt;/li&gt;
&lt;li&gt;Maximum value is 127 (inclusive)(2^7 -1)&lt;/li&gt;
&lt;li&gt;Default value is 0&lt;/li&gt;
&lt;li&gt;Byte data type is used to save space in large arrays, mainly in 
place of integers, since a byte is four times smaller than an int.&lt;/li&gt;
&lt;li&gt;Example :  byte a = 100 , byte b = -50&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
short:&lt;/h2&gt;
&lt;ul class="list"&gt;
&lt;li&gt;Short data type is a 16-bit signed two's complement integer. &lt;/li&gt;
&lt;li&gt;Minimum value is -32,768 (-2^15)&lt;/li&gt;
&lt;li&gt;Maximum value is 32,767(inclusive) (2^15 -1)&lt;/li&gt;
&lt;li&gt;Short data type can also be used to save memory as byte data type. A short is 2 times smaller than an int&lt;/li&gt;
&lt;li&gt;Default value is 0.&lt;/li&gt;
&lt;li&gt;Example : short  s= 10000 , short r = -20000&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
int:&lt;/h2&gt;
&lt;ul class="list"&gt;
&lt;li&gt;Int data type is a 32-bit signed two's complement integer.&lt;/li&gt;
&lt;li&gt;Minimum value is - 2,147,483,648.(-2^31)&lt;/li&gt;
&lt;li&gt;Maximum value is 2,147,483,647(inclusive).(2^31 -1)&lt;/li&gt;
&lt;li&gt;Int is generally used as the default data type for integral values unless there is a concern about memory.&lt;/li&gt;
&lt;li&gt;The default value is 0.&lt;/li&gt;
&lt;li&gt;Example : int a = 100000, int b = -200000&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
long:&lt;/h2&gt;
&lt;ul class="list"&gt;
&lt;li&gt;Long data type is a 64-bit signed two's complement integer. &lt;/li&gt;
&lt;li&gt;Minimum value is -9,223,372,036,854,775,808.(-2^63)&lt;/li&gt;
&lt;li&gt;Maximum value is 9,223,372,036,854,775,807 (inclusive). (2^63 -1)&lt;/li&gt;
&lt;li&gt;This type is used when a wider range than int is needed.&lt;/li&gt;
&lt;li&gt;Default value is 0L.&lt;/li&gt;
&lt;li&gt;Example : long a = 100000L, int b = -200000L&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
float:&lt;/h2&gt;
&lt;ul class="list"&gt;
&lt;li&gt;Float data type is a single-precision 32-bit IEEE 754 floating point. &lt;/li&gt;
&lt;li&gt;Float is mainly used to save memory in large arrays of floating point numbers.&lt;/li&gt;
&lt;li&gt;Default value is 0.0f.&lt;/li&gt;
&lt;li&gt;Float data type is never used for precise values such as currency. &lt;/li&gt;
&lt;li&gt;Example : float f1 = 234.5f&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
double:&lt;/h2&gt;
&lt;ul class="list"&gt;
&lt;li&gt;double data type is a double-precision 64-bit IEEE 754 floating point.&lt;/li&gt;
&lt;li&gt;This data type is generally used as the default data type for decimal values. generally the default choice. &lt;/li&gt;
&lt;li&gt;Double data type should never be used for precise values such as currency.&lt;/li&gt;
&lt;li&gt;Default value is 0.0d.&lt;/li&gt;
&lt;li&gt;Example : double d1 = 123.4&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
boolean:&lt;/h2&gt;
&lt;ul class="list"&gt;
&lt;li&gt;boolean data type represents one bit of information.&lt;/li&gt;
&lt;li&gt;There are only two possible values : true and false.&lt;/li&gt;
&lt;li&gt;This data type is used for simple flags that track true/false conditions.&lt;/li&gt;
&lt;li&gt;Default value is false.&lt;/li&gt;
&lt;li&gt;Example : boolean one = true&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
char:&lt;/h2&gt;
&lt;ul class="list"&gt;
&lt;li&gt;char data type is a single 16-bit Unicode character. &lt;/li&gt;
&lt;li&gt;Minimum value is '\u0000' (or 0).&lt;/li&gt;
&lt;li&gt;Maximum value is  '\uffff' (or 65,535 inclusive).&lt;/li&gt;
&lt;li&gt;Char data type is used to store any character.&lt;/li&gt;
&lt;li&gt;Example . char letterA ='A'&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Reference Data Types:&lt;/h2&gt;
&lt;ul class="list"&gt;
&lt;li&gt;Reference variables are created using defined constructors of the
 classes. They are used to access objects. These variables are declared 
to be of a specific type that cannot be changed. For example, Employee, 
Puppy etc.&lt;/li&gt;
&lt;li&gt;Class objects, and various type of array variables come under reference data type.&lt;/li&gt;
&lt;li&gt;Default value of any reference variable is null.&lt;/li&gt;
&lt;li&gt;A reference variable can be used to refer to any object of the declared type or any compatible type.&lt;/li&gt;
&lt;li&gt;Example : Animal animal = new Animal("giraffe");&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Java Literals:&lt;/h2&gt;
A literal is a source code representation of a fixed value. They are represented directly in the code without any computation.&lt;br /&gt;
Literals can be assigned to any primitive type variable. For example:&lt;br /&gt;
&lt;span class="kwd"&gt;byte&lt;/span&gt;&lt;span class="pln"&gt; a &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;68&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;char&lt;/span&gt;&lt;span class="pln"&gt; a &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;'A'&lt;/span&gt;byte, int, long, and short can be expressed in decimal(base 10),hexadecimal(base 16) or octal(base 8) number systems as well.&lt;br /&gt;
Prefix 0 is used to indicates octal and prefix 0x indicates 
hexadecimal when using these number systems for literals. For example:&lt;br /&gt;
&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;decimal&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;100&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; octal &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0144&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; hexa &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt;  &lt;/span&gt;&lt;span class="lit"&gt;0x64&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;String literals in Java are specified like they are in most other 
languages by enclosing a sequence of characters between a pair of double
 quotes. Examples of string literals are:&lt;br /&gt;
&lt;span class="str"&gt;"Hello World"&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="str"&gt;"two\nlines"&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="str"&gt;"\"This is in quotes\""&lt;/span&gt;String and char types of literals can contain any Unicode characters. For example:&lt;br /&gt;
&lt;span class="kwd"&gt;char&lt;/span&gt;&lt;span class="pln"&gt; a &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;'\u0001'&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; a &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"\u0001"&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;Java language supports few special escape sequences for String and char literals as well. They are:&lt;br /&gt;
&lt;table class="src"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;Notation&lt;/th&gt;&lt;th&gt;Character represented&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;\n&lt;/td&gt;&lt;td&gt;Newline (0x0a)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;\r&lt;/td&gt;&lt;td&gt;Carriage return (0x0d)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;\f&lt;/td&gt;&lt;td&gt;Formfeed (0x0c)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;\b&lt;/td&gt;&lt;td&gt;Backspace (0x08)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;\s&lt;/td&gt;&lt;td&gt;Space (0x20)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;\t&lt;/td&gt;&lt;td&gt;tab&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;\" &lt;/td&gt;&lt;td&gt;Double quote&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;\'&lt;/td&gt;&lt;td&gt;Single quote&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;\\&lt;/td&gt;&lt;td&gt;backslash&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;\ddd&lt;/td&gt;&lt;td&gt;Octal character (ddd)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;\uxxxx&lt;/td&gt;&lt;td&gt;Hexadecimal UNICODE character (xxxx)&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;h1&gt;
Java Variable Types&lt;/h1&gt;
In Java, all variables must be declared before they can be used. The basic form of a variable declaration is shown here:&lt;br /&gt;
&lt;span class="pln"&gt;type identifier &lt;/span&gt;&lt;span class="pun"&gt;[&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; value&lt;/span&gt;&lt;span class="pun"&gt;][,&lt;/span&gt;&lt;span class="pln"&gt; identifier &lt;/span&gt;&lt;span class="pun"&gt;[=&lt;/span&gt;&lt;span class="pln"&gt; value&lt;/span&gt;&lt;span class="pun"&gt;]&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;...]&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;The &lt;i&gt;type&lt;/i&gt; is one of Java's datatypes. The &lt;i&gt;identifier&lt;/i&gt; is the name of the variable. To declare more than one variable of the specified type, use a comma-separated list.&lt;br /&gt;
Here are several examples of variable declarations of various types. Note that some include an initialization.&lt;br /&gt;
&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; a&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; b&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; c&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;         &lt;/span&gt;&lt;span class="com"&gt;// declares three ints, a, b, and c.&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; d &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;3&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; e&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; f &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;5&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="com"&gt;// declares three more ints, initializing&lt;/span&gt;&lt;span class="pln"&gt;
                     &lt;/span&gt;&lt;span class="com"&gt;// d and f.&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;byte&lt;/span&gt;&lt;span class="pln"&gt; z &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;22&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;         &lt;/span&gt;&lt;span class="com"&gt;// initializes z.&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; pi &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;3.14159&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="com"&gt;// declares an approximation of pi.&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="kwd"&gt;char&lt;/span&gt;&lt;span class="pln"&gt; x &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;'x'&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;        &lt;/span&gt;&lt;span class="com"&gt;// the variable x has the value 'x'.&lt;/span&gt;This chapter will explain various variable types available in Java Language. There are three kinds of variables in Java:&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;Local variables &lt;/li&gt;
&lt;li&gt;Instance variables &lt;/li&gt;
&lt;li&gt;Class/static variables&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Local variables :&lt;/h2&gt;
&lt;ul class="list"&gt;
&lt;li&gt;Local variables are declared in methods, constructors, or blocks.&lt;/li&gt;
&lt;li&gt;Local variables are created when the method, constructor or block
 is entered and the variable will be destroyed once it exits the method,
 constructor or block.&lt;/li&gt;
&lt;li&gt;Access modifiers cannot be used for local variables.&lt;/li&gt;
&lt;li&gt;Local variables are visible only within the declared method, constructor or block.&lt;/li&gt;
&lt;li&gt;Local variables are implemented at stack level internally.&lt;/li&gt;
&lt;li&gt;There is no default value for local variables so local variables 
should be declared and an initial value should be assigned before the 
first use.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Example:&lt;/h2&gt;
Here &lt;i&gt;age&lt;/i&gt; is a local variable. This is defined inside &lt;i&gt;pupAge()&lt;/i&gt; method and its scope is limited to this method only.&lt;br /&gt;
&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Test&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt; 
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; pupAge&lt;/span&gt;&lt;span class="pun"&gt;(){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; age &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;0&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      age &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; age &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;7&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Puppy age is : "&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; age&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; args&lt;/span&gt;&lt;span class="pun"&gt;[]){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;Test&lt;/span&gt;&lt;span class="pln"&gt; test &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;new&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Test&lt;/span&gt;&lt;span class="pun"&gt;();&lt;/span&gt;&lt;span class="pln"&gt;
      test&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;pupAge&lt;/span&gt;&lt;span class="pun"&gt;();&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;This would produce following result:&lt;br /&gt;
Puppy age is: 7
&lt;br /&gt;
&lt;h2&gt;
Example:&lt;/h2&gt;
Following example uses &lt;i&gt;age&lt;/i&gt; without initializing it, so it would give an error at the time of compilation.&lt;br /&gt;
&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Test&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt; 
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; pupAge&lt;/span&gt;&lt;span class="pun"&gt;(){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="kwd"&gt;int&lt;/span&gt;&lt;span class="pln"&gt; age&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      age &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; age &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;7&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Puppy age is : "&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; age&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; args&lt;/span&gt;&lt;span class="pun"&gt;[]){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;Test&lt;/span&gt;&lt;span class="pln"&gt; test &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;new&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Test&lt;/span&gt;&lt;span class="pun"&gt;();&lt;/span&gt;&lt;span class="pln"&gt;
      test&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;pupAge&lt;/span&gt;&lt;span class="pun"&gt;();&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;This would produce following error while compiling it:&lt;br /&gt;
Test.java:4:variable number might not have been initialized
age = age + 7;
         ^
1 error
&lt;br /&gt;
&lt;h2&gt;
Instance variables :&lt;/h2&gt;
&lt;ul class="list"&gt;
&lt;li&gt;Instance variables are declared in a class, but outside a method, constructor or any block.&lt;/li&gt;
&lt;li&gt;When a space is allocated for an object in the heap a slot for each instance variable value is created.&lt;/li&gt;
&lt;li&gt;Instance variables are created when an object is created with the
 use of the key word 'new' and destroyed when the object is destroyed.&lt;/li&gt;
&lt;li&gt;Instance variables hold values that must be referenced by more 
than one method, constructor or block, or essential parts of an object.s
 state that must be present through out the class.&lt;/li&gt;
&lt;li&gt;Instance variables can be declared in class level before or after use.&lt;/li&gt;
&lt;li&gt;Access modifiers can be given for instance variables.&lt;/li&gt;
&lt;li&gt;The instance variables are visible for all methods, constructors 
and block in the class. Normally it is recommended to make these 
variables private (access level).However visibility for subclasses can 
be given for these variables with the use of access modifiers.&lt;/li&gt;
&lt;li&gt;Instance variables have default values. For numbers the default 
value is 0, for Booleans it is false and for object references it is 
null. Values can be assigned during the declaration or within the 
constructor.&lt;/li&gt;
&lt;li&gt;Instance variables can be accessed directly by calling the 
variable name inside the class. However within static methods and 
different class ( when instance variables are given accessibility) the 
should be called using the fully qualified name . &lt;i&gt;ObjectReference.VariableName&lt;/i&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Example:&lt;/h2&gt;
&lt;span class="kwd"&gt;import&lt;/span&gt;&lt;span class="pln"&gt; java&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;io&lt;/span&gt;&lt;span class="pun"&gt;.*;&lt;/span&gt;&lt;span class="pln"&gt;

&lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Employee&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;// this instance variable is visible for any child class.&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; name&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   
   &lt;/span&gt;&lt;span class="com"&gt;// salary  variable is visible in Employee class only.&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;private&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; salary&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   
   &lt;/span&gt;&lt;span class="com"&gt;// The name variable is assigned in the constructor. &lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Employee&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; empName&lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
      name &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; empName&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="com"&gt;// The salary variable is assigned a value.&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; setSalary&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; empSal&lt;/span&gt;&lt;span class="pun"&gt;){&lt;/span&gt;&lt;span class="pln"&gt;
      salary &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; empSal&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
   
   &lt;/span&gt;&lt;span class="com"&gt;// This method prints the employee details.&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; printEmp&lt;/span&gt;&lt;span class="pun"&gt;(){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"name  : "&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; name &lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"salary :"&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; salary&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; args&lt;/span&gt;&lt;span class="pun"&gt;[]){&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;Employee&lt;/span&gt;&lt;span class="pln"&gt; empOne &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;new&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Employee&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Ransika"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      empOne&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;setSalary&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;1000&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
      empOne&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;printEmp&lt;/span&gt;&lt;span class="pun"&gt;();&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;This would produce following result:&lt;br /&gt;
name  : Ransika
salary :1000.0
&lt;br /&gt;
&lt;h2&gt;
Class/static variables :&lt;/h2&gt;
&lt;ul class="list"&gt;
&lt;li&gt;Class variables also known as static variables are declared with the &lt;i&gt;static&lt;/i&gt; keyword in a class, but outside a method, constructor or a block. &lt;/li&gt;
&lt;li&gt;There would only be one copy of each class variable per class, regardless of how many objects are created from it.&lt;/li&gt;
&lt;li&gt;Static variables are rarely used other than being declared as 
constants. Constants are variables that are declared as public/private, 
final and static. Constant variables never change from their initial 
value.&lt;/li&gt;
&lt;li&gt;Static variables are stored in static memory. It is rare to use 
static variables other than declared final and used as either public or 
private constants.&lt;/li&gt;
&lt;li&gt;Static variables are created when the program starts and destroyed when the program stops.&lt;/li&gt;
&lt;li&gt;Visibility is similar to instance variables. However, most static
 variables are declared public since they must be available for users of
 the class.&lt;/li&gt;
&lt;li&gt;Default values are same as instance variables. For numbers the 
default value is 0, for Booleans it is false and for object references 
it is null. Values can be assigned during the declaration or within the 
constructor. Additionally values can be assigned in special static 
initializer blocks.&lt;/li&gt;
&lt;li&gt;Static variables can be accessed by calling with the class name . &lt;i&gt;ClassName.VariableName&lt;/i&gt;.&lt;/li&gt;
&lt;li&gt;When declaring class variables as public static final, then 
variables names (constants) are all in upper case. If the static 
variables are not public and final the naming syntax is the same as 
instance and local variables.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Example:&lt;/h2&gt;
&lt;span class="kwd"&gt;import&lt;/span&gt;&lt;span class="pln"&gt; java&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;io&lt;/span&gt;&lt;span class="pun"&gt;.*;&lt;/span&gt;&lt;span class="pln"&gt;

&lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;Employee&lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="com"&gt;// salary  variable is a private static variable&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;private&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;double&lt;/span&gt;&lt;span class="pln"&gt; salary&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="com"&gt;// DEPARTMENT is a constant&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;final&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; DEPARTMENT &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="str"&gt;"Development "&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;

   &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; args&lt;/span&gt;&lt;span class="pun"&gt;[]){&lt;/span&gt;&lt;span class="pln"&gt;
      salary &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="lit"&gt;1000&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;
      &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;DEPARTMENT&lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="str"&gt;"average salary:"&lt;/span&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt;salary&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
   &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;This would produce following result:&lt;br /&gt;
Development average salary:1000
&lt;b&gt;Note:&lt;/b&gt; If the variables are access from an outside class the constant should be accessed as Employee.DEPARTMENT&lt;br /&gt;
&lt;h2&gt;
What is Next ?&lt;/h2&gt;
You already have used access modifiers ( public &amp;amp; private ) in 
this Part. The next Part will explain you Access Modifiers and Non
 Access Modifiers in detail.&lt;br /&gt;
&lt;br /&gt;
&lt;h1&gt;
&lt;/h1&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="lit"&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Java Tutorial Part-II</title><link>http://hamidkalu.blogspot.com/2013/09/java-tutorial-part-ii.html</link><category>Java Environment Setup</category><author>noreply@blogger.com (Hamid)</author><pubDate>Sun, 22 Sep 2013 12:21:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7786780271346850842.post-7900352571202651620</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;h1&gt;
Java Environment Setup&lt;/h1&gt;
Before we proceed further it is important that we set up the java 
environment correctly. This section guides you on how to download and 
set up Java on your machine. Please follow the following steps to set up
 the environment.&lt;br /&gt;
Java SE is freely available from the link &lt;a href="http://java.sun.com/javase/downloads/index_jdk5.jsp" target="_blank"&gt;Download Java&lt;/a&gt;. So you download a version based on your operating system.&lt;br /&gt;
Follow the instructions to download java and run the &lt;b&gt;.exe&lt;/b&gt; to 
install Java on your machine. Once you installed Java on your machine, 
you would need to set environment variables to point to correct 
installation directories:&lt;br /&gt;
&lt;h2&gt;
Setting up the path for windows 2000/XP:&lt;/h2&gt;
Assuming you have installed Java in &lt;i&gt;c:\Program Files\java\jdk&lt;/i&gt; directory:&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;Right-click on 'My Computer' and select 'Properties'. &lt;/li&gt;
&lt;li&gt;Click on the 'Environment variables' button under the 'Advanced' tab.&lt;/li&gt;
&lt;li&gt;Now alter the 'Path' variable so that it also contains the path 
to the Java executable. Example, if the path is currently set to 
'C:\WINDOWS\SYSTEM32', then change your path to read 
'C:\WINDOWS\SYSTEM32;c:\Program Files\java\jdk\bin'.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Setting up the path for windows 95/98/ME:&lt;/h2&gt;
Assuming you have installed Java in &lt;i&gt;c:\Program Files\java\jdk&lt;/i&gt; directory:&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;Edit the 'C:\autoexec.bat' file and add the following line at the end: &lt;br /&gt;'SET PATH=%PATH%;C:\Program Files\java\jdk\bin'&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Setting up the path for Linux, UNIX, Solaris, FreeBSD:&lt;/h2&gt;
Environment variable PATH should be set to point to where the java 
binaries have been installed. Refer to your shell documentation if you 
have trouble doing this.&lt;br /&gt;
Example, if you use &lt;i&gt;bash&lt;/i&gt; as your shell, then you would add the following line to the end of your '.bashrc: export PATH=/path/to/java:$PATH'&lt;br /&gt;
&lt;h2&gt;
Popular Java Editors:&lt;/h2&gt;
To write your java programs you will need a text editor. There are 
even more sophisticated IDE available in the market. But for now, you 
can consider one of the following:&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;&lt;b&gt;Notepad  :&lt;/b&gt; On Windows machine you can use any simple text editor like Notepad (Recommended for this tutorial), TextPad.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Netbeans :&lt;/b&gt;is a Java IDE that is open source and free which can be downloaded from &lt;a href="http://www.netbeans.org/index.html" target="_blank"&gt;http://www.netbeans.org/index.html&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Eclipse :&lt;/b&gt; is also a java IDE developed by the eclipse open source community and can be downloaded from &lt;a href="http://www.eclipse.org/" target="_blank"&gt;http://www.eclipse.org/&lt;/a&gt;.&lt;br /&gt;
&lt;h2&gt;
What is Next ?&lt;/h2&gt;
Next Part will teach you how to write and run your first java 
program and some of the important basic syntaxes in java needed for 
developing applications.&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;
&amp;nbsp;&lt;/h1&gt;
&lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>Java Tutorial Part-I</title><link>http://hamidkalu.blogspot.com/2013/09/java-tutorial-part-i.html</link><category>Java - Overview</category><author>noreply@blogger.com (Hamid)</author><pubDate>Sun, 22 Sep 2013 12:19:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7786780271346850842.post-6890632716944187526</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2eVc8vMM1e7LCwQoquRsFnfWVRtapYPzEBNSF56-Jwv4HqYAuR2Fk4C_qIR4nbufPP5X6MrozDbf0ibEVg6iTDluMoJhsQL9991Po3s-QaStmtR8XbCW3PpvOb3LZABxow41UnUEkWAJq/s1600/java-mini-logo.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2eVc8vMM1e7LCwQoquRsFnfWVRtapYPzEBNSF56-Jwv4HqYAuR2Fk4C_qIR4nbufPP5X6MrozDbf0ibEVg6iTDluMoJhsQL9991Po3s-QaStmtR8XbCW3PpvOb3LZABxow41UnUEkWAJq/s1600/java-mini-logo.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h1&gt;
Java Tutorial&lt;/h1&gt;
&lt;div&gt;
Java is a high-level programming language originally developed by Sun
 Microsystems and released in 1995. Java runs on a variety of platforms,
 such as Windows, Mac OS, and the various versions of UNIX. This 
tutorial gives a complete understanding on Java.&lt;br /&gt;
This reference will take you through simple and practical approach while learning Java Programming language.&lt;/div&gt;
&lt;h1&gt;
Audience&lt;/h1&gt;
This reference has been prepared for the beginners to help them 
understand the basic to advanced concepts related to Java Programming 
languages.&lt;br /&gt;
&lt;h1&gt;
Prerequisites&lt;/h1&gt;
Before you start doing practice with various types of examples given 
in this reference, I'm making an assumption that you are already aware 
about what is a computer program and what is a computer programming 
language.&lt;br /&gt;
&lt;h1&gt;
Compile/Execute Java Programs&lt;/h1&gt;
We have provided you an option to execute available Java code online. Just click on &lt;b&gt;Try it&lt;/b&gt;
 button avaiable at top-right corner of the code window to execute 
available code. There are certain examples involving multiple source 
files etc. which can not be executed using &lt;b&gt;Try it&lt;/b&gt; option but you can try them them using compileonline.com,
 which is available on a high capacity dedicated server giving you real 
programming experience with a comfort of single click compilation and 
execution. Yes! it is absolutely free and its online.&lt;br /&gt;
&lt;br /&gt;
&lt;h1&gt;
Java - Overview&lt;/h1&gt;
Java programming language was originally developed by Sun 
Microsystems, which was initiated by James Gosling and released in 1995 
as core component of Sun Microsystems.s Java platform (Java 1.0 [J2SE]).&lt;br /&gt;
As of December 08 the latest release of the Java Standard Edition is 6
 (J2SE). With the advancement of Java and its wide spread popularity, 
multiple configurations were built to suite various types of platforms. 
Ex: J2EE for Enterprise Applications, J2ME for Mobile Applications.&lt;br /&gt;
Sun Microsystems has renamed the new J2 versions as Java SE, Java EE and Java ME respectively. Java is guaranteed to be &lt;b&gt;Write Once, Run Anywhere&lt;/b&gt;&lt;br /&gt;
Java is:&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;&lt;b&gt;Object Oriented :&lt;/b&gt; In java everything is an Object. Java can be easily extended since it is based on the Object model.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Platform independent:&lt;/b&gt; Unlike many other programming 
languages including C and C++ when Java is compiled, it is not compiled 
into platform specific machine, rather into platform independent byte 
code. This byte code is distributed over the web and interpreted by 
virtual Machine (JVM) on whichever platform it is being run.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Simple :&lt;/b&gt;Java is designed to be easy to learn. If you understand the basic concept of OOP java would be easy to master.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Secure :&lt;/b&gt; With Java's secure feature it enables to develop 
virus-free, tamper-free systems. Authentication techniques are based on 
public-key encryption.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Architectural- neutral :&lt;/b&gt;Java compiler generates an 
architecture-neutral object file format which makes the compiled code to
 be executable on many processors, with the presence Java runtime 
system.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Portable :&lt;/b&gt;being architectural neutral and having no 
implementation dependent aspects of the specification makes Java 
portable. Compiler and Java is written in ANSI C with a clean 
portability boundary which is a POSIX subset.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Robust :&lt;/b&gt;Java makes an effort to eliminate error prone 
situations by emphasizing mainly on compile time error checking and 
runtime checking.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Multi-threaded :&lt;/b&gt; With Java's multi-threaded feature it is 
possible to write programs that can do many tasks simultaneously. This 
design feature allows developers to construct smoothly running 
interactive applications.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Interpreted :&lt;/b&gt;Java byte code is translated on the fly to 
native machine instructions and is not stored anywhere. The development 
process is more rapid and analytical since the linking is an incremental
 and light weight process. &lt;/li&gt;
&lt;li&gt;&lt;b&gt;High Performance:&lt;/b&gt; With the use of Just-In-Time compilers Java enables high performance.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Distributed :&lt;/b&gt;Java is designed for the distributed environment of the internet.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Dynamic :&lt;/b&gt; Java is considered to be more dynamic than C or 
C++ since it is designed to adapt to an evolving environment. Java 
programs can carry extensive amount of run-time information that can be 
used to verify and resolve accesses to objects on run-time.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
History of Java:&lt;/h2&gt;
James Gosling initiated the Java language project in June 1991 for 
use in one of his many set-top box projects. The language, initially 
called Oak after an oak tree that stood outside Gosling's office, also 
went by the name Green and ended up later renamed as Java, from a list 
of random words.&lt;br /&gt;
Sun released the first public implementation as Java 1.0 in 1995. It promised &lt;b&gt;Write Once, Run Anywhere&lt;/b&gt; (WORA), providing no-cost run-times on popular platforms. &lt;br /&gt;
On 13 November 2006, Sun released much of Java as free and open 
source software under the terms of the GNU General Public License (GPL).&lt;br /&gt;
On 8 May 2007 Sun finished the process, making all of Java's core 
code free and open-source, aside from a small portion of code to which 
Sun did not hold the copyright.&lt;br /&gt;
&lt;h2&gt;
Tools you will need:&lt;/h2&gt;
For performing the examples discussed in this tutorial, you will need
 a Pentium 200-MHz computer with a minimum of 64 MB of RAM (128 MB of 
RAM recommended).&lt;br /&gt;
You also will need the following softwares:&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;Linux 7.1 or Windows 95/98/2000/XP operating system.&lt;/li&gt;
&lt;li&gt;Java JDK 5&lt;/li&gt;
&lt;li&gt;Microsoft Notepad or any other text editor&lt;/li&gt;
&lt;/ul&gt;
This tutorial will provide the necessary skills to create GUI, networking, and Web applications using Java.&lt;br /&gt;
&lt;h2&gt;
Try It Option:&lt;/h2&gt;
We have provided you an option to compile and execute available code online. Just click on &lt;b&gt;Try it&lt;/b&gt;
 button avaiable at top-right corner of the code window to compile and 
execute available code. There are certain examples which can not be 
executed online, so we have skipped those examples.&lt;br /&gt;
&lt;pre class="prettyprint tryit prettyprinted" style="cursor: default;"&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;MyFirstJavaProgram&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;

    &lt;/span&gt;&lt;span class="kwd"&gt;public&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;static&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;void&lt;/span&gt;&lt;span class="pln"&gt; main&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;String&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;[]&lt;/span&gt;&lt;span class="pln"&gt;args&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;
       &lt;/span&gt;&lt;span class="typ"&gt;System&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="kwd"&gt;out&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;println&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="str"&gt;"Hello World"&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;span class="pln"&gt;
    &lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;/pre&gt;
There may be a case that you do not see the result of the 
compiled/executed code, in such case you can re-try to compile and 
execute the code using &lt;b&gt;execute&lt;/b&gt; button available in compliation pop-up window. &lt;br /&gt;
&lt;h2&gt;
What is Next ?&lt;/h2&gt;
Next Part will guide you to where you can obtain Java and its 
documentation. Finally, it instructs you on how to install Java and 
prepare an environment to develop Java applications.&lt;br /&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2eVc8vMM1e7LCwQoquRsFnfWVRtapYPzEBNSF56-Jwv4HqYAuR2Fk4C_qIR4nbufPP5X6MrozDbf0ibEVg6iTDluMoJhsQL9991Po3s-QaStmtR8XbCW3PpvOb3LZABxow41UnUEkWAJq/s72-c/java-mini-logo.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total></item><item><title>SQL Tutorial</title><link>http://hamidkalu.blogspot.com/2013/09/sql-tutorial.html</link><author>noreply@blogger.com (Hamid)</author><pubDate>Sat, 21 Sep 2013 15:33:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7786780271346850842.post-334362002089938970</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBiYhbj_mN2sbsznB23YZoRzf0DaXVH2meCDSPhJfysgG1Hm0h92XBm5iMDHzBtr20aG9Q456CcONPgA5RvxK6GnPfQlO0kLcPBoiabj2fdQJyDiPwG1Vowa-EWDNMOM7Ltqrdt2jtlF3O/s1600/sql-mini-logo.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img alt="Stuctured Query Language" border="0" height="143" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBiYhbj_mN2sbsznB23YZoRzf0DaXVH2meCDSPhJfysgG1Hm0h92XBm5iMDHzBtr20aG9Q456CcONPgA5RvxK6GnPfQlO0kLcPBoiabj2fdQJyDiPwG1Vowa-EWDNMOM7Ltqrdt2jtlF3O/s200/sql-mini-logo.png" title="SQL" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h1&gt;
SQL Tutorial&lt;/h1&gt;
&lt;div&gt;
SQL is a database computer language designed for the retrieval and 
management of data in relational database. SQL stands for Structured 
Query Language.&lt;br /&gt;
This tutorial will give you quick start with SQL.&lt;/div&gt;
&lt;h1&gt;
Audience&lt;/h1&gt;
This reference has been prepared for the beginners to help them 
understand the basic to advanced concepts related to SQL languages.&lt;br /&gt;
&lt;h1&gt;
Prerequisites&lt;/h1&gt;
Before you start doing practice with various types of examples given 
in this reference, I'm making an assumption that you are already aware 
about  what is database, specially RDBMS and what is a computer 
programming language.&lt;br /&gt;
&lt;h1&gt;
Compile/Execute SQL Programs&lt;/h1&gt;
If you are willing to compile and execute SQL programs with SQLite 
DBMS but you do not have a setup for the same, then do not worry. The compileonline.com
 is available on a high end dedciated server giving you real programming
 experience with a comfort of single click execution. Yes! it is 
absolutely free and its online.&lt;br /&gt;
&lt;br /&gt;
&lt;h1&gt;
SQL - Quick Guide&lt;/h1&gt;
&lt;h2&gt;
What is SQL?&lt;/h2&gt;
SQL is structured Query Language which is a computer language for 
storing, manipulating and retrieving data stored in relational database.&lt;br /&gt;
SQL is the standard language for Relation Database System. All 
relational database management systems like MySQL, MS Access, Oracle, 
Sybase, Informix, postgres and SQL Server uses SQL as standard database 
language.&lt;br /&gt;
Also they are using different dialects, Such as:&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;MS SQL Server using T-SQL,&lt;/li&gt;
&lt;li&gt;Oracle using PL/SQL, &lt;/li&gt;
&lt;li&gt;MS Access version of SQL is called JET SQL (native format )etc&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Why SQL?&lt;/h2&gt;
&lt;ul class="list"&gt;
&lt;li&gt;Allow users to access data in relational database management systems.&lt;/li&gt;
&lt;li&gt;Allow users to describe the data.&lt;/li&gt;
&lt;li&gt;Allow users to define the data in database and manipulate that data.&lt;/li&gt;
&lt;li&gt;Allow to embed within other languages using SQL modules, libraries &amp;amp; pre-compilers.&lt;/li&gt;
&lt;li&gt;Allow users to create and drop databases and tables.&lt;/li&gt;
&lt;li&gt;Allow users to create view, stored procedure, functions in a database.&lt;/li&gt;
&lt;li&gt;Allow users to set permissions on tables, procedures, and views&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
What is RDBMS?&lt;/h2&gt;
RDBMS stands for &lt;b&gt;&lt;u&gt;R&lt;/u&gt;&lt;/b&gt;elational &lt;b&gt;&lt;u&gt;D&lt;/u&gt;&lt;/b&gt;atabase &lt;b&gt;&lt;u&gt;M&lt;/u&gt;&lt;/b&gt;anagement &lt;b&gt;&lt;u&gt;S&lt;/u&gt;&lt;/b&gt;ystem.
 RDBMS is the basis for SQL, and for all modern database systems like MS
 SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access.&lt;br /&gt;
A Relational database management system (RDBMS) is a database 
management system (DBMS) that is based on the relational model as 
introduced by E. F. Codd. &lt;br /&gt;
&lt;h2&gt;
What is table ?&lt;/h2&gt;
The data in RDBMS is stored in database objects called &lt;b&gt;tables&lt;/b&gt;. The table is a collection of related data entries and it consists of columns and rows.&lt;br /&gt;
Remember, a table is the most common and simplest form of data storage in a relational database.&lt;br /&gt;
&lt;h2&gt;
What is field?&lt;/h2&gt;
Every table is broken up into smaller entities called fields. The 
fields in the CUSTOMERS table consist of ID, NAME, AGE, ADDRESS and 
SALARY.&lt;br /&gt;
A field is a column in a table that is designed to maintain specific information about every record in the table.&lt;br /&gt;
&lt;h2&gt;
What is record, or row?&lt;/h2&gt;
A record, also called a row of data, is each individual entry that 
exists in a table. For example there are 7 records in the above 
CUSTOMERS table.&lt;br /&gt;
A record is a horizontal entity in a table.&lt;br /&gt;
&lt;h2&gt;
What is column?&lt;/h2&gt;
A column is a vertical entity in a table that contains all information associated with a specific field in a table.&lt;br /&gt;
&lt;h2&gt;
What is NULL value?&lt;/h2&gt;
A NULL value in a table is a value in a field that appears to be 
blank which means A field with a NULL value is a field with no value.&lt;br /&gt;
It is very important to understand that a NULL value is different 
than a zero value or a field that contains spaces. A field with a NULL 
value is
one that has been left blank during record creation.&lt;br /&gt;
&lt;h2&gt;
SQL Constraints:&lt;/h2&gt;
Constraints are the rules enforced on data columns on table. These 
are used to limit the type of data that can go into a table. This 
ensures the accuracy and reliability of the data in the database. &lt;br /&gt;
Contraints could be column level or table level. Column level 
constraints are applied only to one column where as table level 
constraints are applied to the whole table.&lt;br /&gt;
&lt;h2&gt;
SQL Syntax:&lt;/h2&gt;
SQL is followed by unique set of rules and guidelines called Syntax. 
This tutorial gives you a quick start with SQL by listing all the basic 
SQL Syntax:&lt;br /&gt;
All the SQL statements start with any of the keywords like SELECT, 
INSERT, UPDATE, DELETE, ALTER, DROP, CREATE, USE, SHOW and all the 
statements end with a semicolon (;).&lt;br /&gt;
Important point to be noted is that SQL is &lt;b&gt;case insensitive&lt;/b&gt; 
which means SELECT and select have same meaning in SQL statements but 
MySQL make difference in table names. So if you are working with MySQL 
then you need to give table names as they exist in the database.&lt;br /&gt;
&lt;h2&gt;
SQL SELECT Statement:&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;SELECT column1&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; column2&lt;/span&gt;&lt;span class="pun"&gt;....&lt;/span&gt;&lt;span class="pln"&gt;columnN
FROM   table_name&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL DISTINCT Clause:&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;SELECT DISTINCT column1&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; column2&lt;/span&gt;&lt;span class="pun"&gt;....&lt;/span&gt;&lt;span class="pln"&gt;columnN
FROM   table_name&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL WHERE Clause:&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;SELECT column1&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; column2&lt;/span&gt;&lt;span class="pun"&gt;....&lt;/span&gt;&lt;span class="pln"&gt;columnN
FROM   table_name
WHERE  CONDITION&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL AND/OR Clause:&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;SELECT column1&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; column2&lt;/span&gt;&lt;span class="pun"&gt;....&lt;/span&gt;&lt;span class="pln"&gt;columnN
FROM   table_name
WHERE  CONDITION&lt;/span&gt;&lt;span class="pun"&gt;-&lt;/span&gt;&lt;span class="lit"&gt;1&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;AND&lt;/span&gt;&lt;span class="pun"&gt;|&lt;/span&gt;&lt;span class="pln"&gt;OR&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt; CONDITION&lt;/span&gt;&lt;span class="pun"&gt;-&lt;/span&gt;&lt;span class="lit"&gt;2&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL IN Clause:&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;SELECT column1&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; column2&lt;/span&gt;&lt;span class="pun"&gt;....&lt;/span&gt;&lt;span class="pln"&gt;columnN
FROM   table_name
WHERE  column_name IN &lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;val&lt;/span&gt;&lt;span class="pun"&gt;-&lt;/span&gt;&lt;span class="lit"&gt;1&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; val&lt;/span&gt;&lt;span class="pun"&gt;-&lt;/span&gt;&lt;span class="lit"&gt;2&lt;/span&gt;&lt;span class="pun"&gt;,...&lt;/span&gt;&lt;span class="pln"&gt;val&lt;/span&gt;&lt;span class="pun"&gt;-&lt;/span&gt;&lt;span class="pln"&gt;N&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL BETWEEN Clause:&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;SELECT column1&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; column2&lt;/span&gt;&lt;span class="pun"&gt;....&lt;/span&gt;&lt;span class="pln"&gt;columnN
FROM   table_name
WHERE  column_name BETWEEN val&lt;/span&gt;&lt;span class="pun"&gt;-&lt;/span&gt;&lt;span class="lit"&gt;1&lt;/span&gt;&lt;span class="pln"&gt; AND val&lt;/span&gt;&lt;span class="pun"&gt;-&lt;/span&gt;&lt;span class="lit"&gt;2&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL Like Clause:&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;SELECT column1&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; column2&lt;/span&gt;&lt;span class="pun"&gt;....&lt;/span&gt;&lt;span class="pln"&gt;columnN
FROM   table_name
WHERE  column_name LIKE &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt; PATTERN &lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL ORDER BY Clause:&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;SELECT column1&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; column2&lt;/span&gt;&lt;span class="pun"&gt;....&lt;/span&gt;&lt;span class="pln"&gt;columnN
FROM   table_name
WHERE  CONDITION
ORDER BY column_name &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;ASC&lt;/span&gt;&lt;span class="pun"&gt;|&lt;/span&gt;&lt;span class="pln"&gt;DESC&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL GROUP BY Clause:&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;SELECT SUM&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;column_name&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
FROM   table_name
WHERE  CONDITION
GROUP BY column_name&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL COUNT Clause:&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;SELECT COUNT&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;column_name&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
FROM   table_name
WHERE  CONDITION&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL HAVING Clause:&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;SELECT SUM&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;column_name&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
FROM   table_name
WHERE  CONDITION
GROUP BY column_name
HAVING &lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;arithematic &lt;/span&gt;&lt;span class="kwd"&gt;function&lt;/span&gt;&lt;span class="pln"&gt; condition&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL CREATE TABLE Statement:&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;CREATE TABLE table_name&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt;
column1 datatype&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt;
column2 datatype&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt;
column3 datatype&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;.....&lt;/span&gt;&lt;span class="pln"&gt;
columnN datatype&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt;
PRIMARY KEY&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; one &lt;/span&gt;&lt;span class="kwd"&gt;or&lt;/span&gt;&lt;span class="pln"&gt; more columns &lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL DROP TABLE Statement:&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;DROP TABLE table_name&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL CREATE INDEX Statement :&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;CREATE UNIQUE INDEX index_name
ON table_name &lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; column1&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; column2&lt;/span&gt;&lt;span class="pun"&gt;,...&lt;/span&gt;&lt;span class="pln"&gt;columnN&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL DROP INDEX Statement :&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;ALTER TABLE table_name
DROP INDEX index_name&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL DESC Statement :&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;DESC table_name&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL TRUNCATE TABLE Statement:&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;TRUNCATE TABLE table_name&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL ALTER TABLE Statement:&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;ALTER TABLE table_name &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;ADD&lt;/span&gt;&lt;span class="pun"&gt;|&lt;/span&gt;&lt;span class="pln"&gt;DROP&lt;/span&gt;&lt;span class="pun"&gt;|&lt;/span&gt;&lt;span class="pln"&gt;MODIFY&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt; column_name &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;data_ype&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL ALTER TABLE Statement (Rename) :&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;ALTER TABLE table_name RENAME TO new_table_name&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL INSERT INTO Statement:&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;INSERT INTO table_name&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; column1&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; column2&lt;/span&gt;&lt;span class="pun"&gt;....&lt;/span&gt;&lt;span class="pln"&gt;columnN&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;
VALUES &lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="pln"&gt; value1&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; value2&lt;/span&gt;&lt;span class="pun"&gt;....&lt;/span&gt;&lt;span class="pln"&gt;valueN&lt;/span&gt;&lt;span class="pun"&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL UPDATE Statement:&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;UPDATE table_name
SET column1 &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; value1&lt;/span&gt;&lt;span class="pun"&gt;,&lt;/span&gt;&lt;span class="pln"&gt; column2 &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; value2&lt;/span&gt;&lt;span class="pun"&gt;....&lt;/span&gt;&lt;span class="pln"&gt;columnN&lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt;valueN
&lt;/span&gt;&lt;span class="pun"&gt;[&lt;/span&gt;&lt;span class="pln"&gt; WHERE  CONDITION &lt;/span&gt;&lt;span class="pun"&gt;];&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL DELETE Statement:&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;DELETE FROM table_name
WHERE  &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;CONDITION&lt;/span&gt;&lt;span class="pun"&gt;};&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL CREATE DATABASE Statement:&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;CREATE DATABASE database_name&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL DROP DATABASE Statement:&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;DROP DATABASE database_name&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL USE Statement:&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;USE DATABASE database_name&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL COMMIT Statement:&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;COMMIT&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL ROLLBACK Statement:&lt;/h2&gt;
&lt;pre class="prettyprint prettyprinted"&gt;&lt;span class="pln"&gt;ROLLBACK&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;h2&gt;
SQL - Operators:&lt;/h2&gt;
&lt;h2&gt;
SQL Arithmetic Operators:&lt;/h2&gt;
Assume variable a holds 10 and variable b holds 20 then:&lt;br /&gt;
&lt;a href="http://www.blogger.com/null"&gt;Show Examples&lt;/a&gt;&lt;br /&gt;
&lt;table class="src"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th style="width: 20%;"&gt;Operator&lt;/th&gt;&lt;th style="width: 45%;"&gt;Description&lt;/th&gt;&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;+&lt;/td&gt;&lt;td&gt;Addition - Adds values on either side of the operator&lt;/td&gt;&lt;td&gt;a + b will give 30&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;-&lt;/td&gt;&lt;td&gt;Subtraction - Subtracts right hand operand from left hand operand&lt;/td&gt;&lt;td&gt;a - b will give -10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;*&lt;/td&gt;&lt;td&gt;Multiplication - Multiplies values on either side of the operator&lt;/td&gt;&lt;td&gt;a * b will give 200&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;/&lt;/td&gt;&lt;td&gt;Division - Divides left hand operand by right hand operand&lt;/td&gt;&lt;td&gt;b / a will give 2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;%&lt;/td&gt;&lt;td&gt;Modulus - Divides left hand operand by right hand operand and returns remainder&lt;/td&gt;&lt;td&gt;b % a will give 0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h2&gt;
SQL Comparison Operators:&lt;/h2&gt;
Assume variable a holds 10 and variable b holds 20 then:&lt;br /&gt;
&lt;a href="http://www.blogger.com/null"&gt;Show Examples&lt;/a&gt;&lt;br /&gt;
&lt;table class="src"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th style="width: 20%;"&gt;Operator&lt;/th&gt;&lt;th style="width: 45%;"&gt;Description&lt;/th&gt;&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;=&lt;/td&gt;&lt;td&gt;Checks if the value of two operands are equal or not, if yes then condition becomes true.&lt;/td&gt;&lt;td&gt;(a = b) is not true. &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;!=&lt;/td&gt;&lt;td&gt;Checks if the value of two operands are equal or not, if values are not equal then condition becomes true.&lt;/td&gt;&lt;td&gt;(a != b) is true. &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;lt;&amp;gt;&lt;/td&gt;&lt;td&gt;Checks if the value of two operands are equal or not, if values are not equal then condition becomes true.&lt;/td&gt;&lt;td&gt;(a &amp;lt;&amp;gt; b) is true. &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;gt;&lt;/td&gt;&lt;td&gt;Checks if the value of left  operand is greater than the value of right operand, if yes then condition becomes true.&lt;/td&gt;&lt;td&gt;(a &amp;gt; b) is not true. &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;lt;&lt;/td&gt;&lt;td&gt;Checks if the value of left  operand is less than the value of right operand, if yes then condition becomes true.&lt;/td&gt;&lt;td&gt;(a &amp;lt; b) is true. &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;gt;=&lt;/td&gt;&lt;td&gt;Checks if the value of left  operand is greater than 
or equal to the value of right operand, if yes then condition becomes 
true.&lt;/td&gt;&lt;td&gt;(a &amp;gt;= b) is not true. &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&amp;lt;=&lt;/td&gt;&lt;td&gt;Checks if the value of left  operand is less than or equal to the value of right operand, if yes then condition becomes true.&lt;/td&gt;&lt;td&gt;(a &amp;lt;= b) is true. &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;!&amp;lt;&lt;/td&gt;&lt;td&gt;Checks if the value of left  operand is not less than the value of right operand, if yes then condition becomes true.&lt;/td&gt;&lt;td&gt;(a !&amp;lt; b) is false. &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;!&amp;gt;&lt;/td&gt;&lt;td&gt;Checks if the value of left  operand is not greater than the value of right operand, if yes then condition becomes true.&lt;/td&gt;&lt;td&gt;(a !&amp;gt; b) is true. &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h2&gt;
SQL Logical Operators:&lt;/h2&gt;
Here is a list of all the logical operators available in SQL.&lt;br /&gt;
&lt;a href="http://www.blogger.com/null"&gt;Show Examples&lt;/a&gt;&lt;br /&gt;
&lt;table class="src"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th style="width: 20%;"&gt;Operator&lt;/th&gt;&lt;th style="width: 80%;"&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ALL&lt;/td&gt;&lt;td&gt;The ALL operator is used to compare a value to all values in another value set.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AND&lt;/td&gt;&lt;td&gt;The AND operator allows the existence of multiple conditions in an SQL statement's WHERE clause.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ANY&lt;/td&gt;&lt;td&gt;The ANY operator is used to compare a value to any applicable value in the list according to the condition.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BETWEE&lt;br /&gt;
N&lt;/td&gt;&lt;td&gt;The BETWEEN operator is used to search for values 
that are within a set of values, given the minimum value and the maximum
 value.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EXISTS&lt;/td&gt;&lt;td&gt;The EXISTS operator is used to search for the presence of a row in a specified table that meets certain criteria.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IN&lt;/td&gt;&lt;td&gt;The IN operator is used to compare a value to a list of literal values that have been specified.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LIKE&lt;/td&gt;&lt;td&gt;The LIKE operator is used to compare a value to similar values using wildcard operators.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NOT&lt;/td&gt;&lt;td&gt;The NOT operator reverses the meaning of the logical operator with which it is used. Eg. NOT EXISTS, NOT BETWEEN, NOT IN etc. &lt;b&gt;This is negate operator.&lt;/b&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OR&lt;/td&gt;&lt;td&gt;The OR operator is used to combine multiple conditions in an SQL statement's WHERE clause.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IS NULL&lt;/td&gt;&lt;td&gt;The NULL operator is used to compare a value with a NULL value.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UNIQUE&lt;/td&gt;&lt;td&gt;The UNIQUE operator searches every row of a specified table for uniqueness (no duplicates).&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h2&gt;
SQL - Useful Functions:&lt;/h2&gt;
SQL has many built-in functions for performing processing on string 
or numeric data. Following is the list of all useful SQL built-in 
functions:&lt;br /&gt;
&lt;ul class="list"&gt;
&lt;li&gt;&lt;a href="http://www.blogger.com/null"&gt;SQL COUNT Function&lt;/a&gt; - The SQL COUNT aggregate function is used to count the number of rows in a database table.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.blogger.com/null"&gt;SQL MAX Function&lt;/a&gt; - The SQL MAX aggregate function allows us to select the highest (maximum) value for a certain column.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.blogger.com/null"&gt;SQL MIN Function&lt;/a&gt; - The SQL MIN aggregate function allows us to select the lowest (minimum) value for a certain column.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.blogger.com/null"&gt;SQL AVG Function&lt;/a&gt; - The SQL AVG aggregate function selects the average value for certain table column.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.blogger.com/null"&gt;SQL SUM Function&lt;/a&gt; - The SQL SUM aggregate function allows selecting the total for a numeric column.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.blogger.com/null"&gt;SQL SQRT Functions&lt;/a&gt; - This is used to generate a square root of a given number.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.blogger.com/null"&gt;SQL RAND Function&lt;/a&gt; - This is used to generate a random number using SQL command.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.blogger.com/null"&gt;SQL CONCAT Function&lt;/a&gt; - This is used to concatenate any string inside any SQL command.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.blogger.com/null"&gt;SQL Numeric Functions&lt;/a&gt; - Complete list of  SQL functions required  to manipulate numbers in SQL.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.blogger.com/null"&gt;SQL String Functions&lt;/a&gt; - Complete list of  SQL functions required  to manipulate strings in SQL.&lt;br /&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;
&amp;nbsp;&lt;/h1&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBiYhbj_mN2sbsznB23YZoRzf0DaXVH2meCDSPhJfysgG1Hm0h92XBm5iMDHzBtr20aG9Q456CcONPgA5RvxK6GnPfQlO0kLcPBoiabj2fdQJyDiPwG1Vowa-EWDNMOM7Ltqrdt2jtlF3O/s72-c/sql-mini-logo.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Heavy rains in Rajasthan, Delhi disrupt normal life </title><link>http://hamidkalu.blogspot.com/2012/08/heavy-rains-in-rajasthan-delhi-disrupt.html</link><author>noreply@blogger.com (Hamid)</author><pubDate>Fri, 24 Aug 2012 22:25:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7786780271346850842.post-7530461944939318311</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div style="padding-top: 0px;"&gt;
&lt;b&gt;Jaipur/ New Delhi:&lt;/b&gt; Heavy rains have thrown normal live out of gear in several parts of the country including Rajasthan and the Delhi-NCR region.
&lt;/div&gt;
&lt;a href="http://static.ibnlive.in.com/ibnlive/pix/sitepix/08_2012/rajasthan_floods_271x181.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://static.ibnlive.in.com/ibnlive/pix/sitepix/08_2012/rajasthan_floods_271x181.jpg" /&gt;&lt;/a&gt;The Rajasthan Meteorological Department has predicted more rains 
even as 27 have died in two days of torrential rain in the state. 
According to the Met heavy rainfall is expected in Tonk and Jaipur in 
the next 24 hours. Of the 27 people who have lost their lives, 10 are 
from Jaipur. 
&lt;br /&gt;
The worst affected districts in the state are Sikar, Sawai 
Madhopur, Nagaur and Jhunjhunu. However, there was some respite for 
Jaipur and nearby areas as there was no rain during the intervening 
night of Thursday and Friday, making it easier for relief workers to 
speed up their work.&lt;br /&gt;
courtesy: IBN &lt;/div&gt;
</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></item><item><title>20 Ideas to make Money Online</title><link>http://hamidkalu.blogspot.com/2011/04/this-is-my-first-comment.html</link><category>Blogging</category><category>Money Online</category><author>noreply@blogger.com (Hamid)</author><pubDate>Tue, 5 Apr 2011 12:41:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7786780271346850842.post-1701918868055837251</guid><description>
&lt;div id="fb-root"&gt;&lt;/div&gt;
&lt;script&gt;(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&amp;appId=327933373929598";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));&lt;/script&gt;

&lt;div class="fb-like" data-href="http://hamidkalu.blogspot.in/2011/04/this-is-my-first-comment.html" data-width="450" data-show-faces="false" data-send="true"&gt;&lt;/div&gt;

&lt;hr&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOCvT3K9b0R-zyBA1mz9yCH1-wpY2GYQ-tdDFYZtojkZAVb0nu_LKrXHfs1fPSbcHtA6EFRp7UhD9ogCNMq3ufXLla14mG2z13RjcgsoiqkmtI4x5QT3aH0QINQPSrCDMrDaQRNo0rPe0O/s1600/make-money-online_325_012111035807.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="167" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOCvT3K9b0R-zyBA1mz9yCH1-wpY2GYQ-tdDFYZtojkZAVb0nu_LKrXHfs1fPSbcHtA6EFRp7UhD9ogCNMq3ufXLla14mG2z13RjcgsoiqkmtI4x5QT3aH0QINQPSrCDMrDaQRNo0rPe0O/s320/make-money-online_325_012111035807.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style="font-style: italic;"&gt;courtesy: business today &lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;A cash cow for the enterprising, the 
Internet is littered with opportunities to make a fast buck. While it 
rarely qualifies as a solitary source of income, the Net can easily help
 you supplement it. However, the amount you earn depends on the time and
 effort invested. Go through these 20 options and find out which ones 
work for you.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Blogging&lt;/span&gt;&lt;br style="font-weight: bold;" /&gt;If
 you're a passionate closet writer who wants to be published but can't 
find a way to do so, make each keystroke your way to wealth by penning 
your own blog. Starting a blog doesn't require extensive technical 
skills but it's important that you have expertise in the field you are 
writing on. This will attract visitors to your site. Building a large 
following will enable you to earn profit by luring advertisers, writing 
paid reviews or getting commissions for promoting other people's 
products.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Paid Writing&lt;/span&gt;&lt;br /&gt;If
 maintaining a blog is difficult for you but you still want to indulge 
your passion for writing, you can jot down articles for other blogs or 
sites such as Weblogs, Helium or PayPerPost. Writing an e-book can also 
be a good option. E-books are investment free, with no cost for printing
 and shipping. If you have a strong command over languages, you can 
become a copy editor, where Webmasters will pay you to read articles and
 correct grammatical errors, sentence fragments, etc.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;e-tuitions/Webinars&lt;/span&gt;&lt;br style="font-weight: bold;" /&gt;The
 demand for tutors is high and growing. So, if you like helping others 
learn, e-teaching could be the earning ticket for you. All you need to 
become an online tutor is expertise in your subject and a few spare 
hours per week. TutorVista, e-tutor, SmartThinking and Tutor.com are 
some of the sites you can enroll with. If you gain a good reputation as a
 coach, you could even conduct Webinars-lectures or seminars transmitted
 over the Net. College and university students are willing to pay to 
gain entry to a well-respected Webinar.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Affilliate/Reseller&lt;/span&gt;&lt;br style="font-weight: bold;" /&gt;For
 those who have the knack of selling, one of the best ways to make money
 online is to become an affiliate/reseller. An affiliate is a person who
 gets a commission for selling every product that he promotes, whether 
on his Website or through any other avenue such as eBay. You don't have 
to own the product. You only need to sign up for an affiliate program 
with a company and start selling its products under your referral link. 
Firms such as Commission Junction or Click Bank have a large pool of 
products.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Buying/Selling domains&lt;/span&gt;&lt;br style="font-weight: bold;" /&gt;Buying
 and selling domain names is another way to make money from home and 
requires very little investment or time. You can buy domains at their 
registration prices or even cheaper and trade them at a profit. However,
 always research on sites such as sedo.co.uk, afternic.com, ebay.com or 
other domain auction sites to get an estimate of the hottest selling 
names. The best way to find good ones is to use terminated domain lists,
 which contain several expired names that are back in the pool.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Freelancing for Professionals&lt;/span&gt;&lt;br style="font-weight: bold;" /&gt;Freelancing
 is a great option for professionals who are experts in their respective
 trades and know how to ensure customer satisfaction. Various 
freelancing and project-oriented sites allow companies that need help to
 describe their projects. Freelancers and small businesses offer bids, 
ideas or proposals, from which the buyers can choose what they find most
 suitable. Websites such as Elance cover everything from programming and
 writing to data entry and design, while RentACoder focuses on software 
programming.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Advertising&lt;/span&gt;&lt;br style="font-weight: bold;" /&gt;You
 can sell space on your Website or blog for advertisements and you earn 
when these ads are clicked by visitors to your site. The sorting and 
placing of ads is free. The profitability of pay-per-click advertising 
depends on the traffic level of the Website and, most importantly, on 
the clickthrough rate and cost per click. Google AdSense is the most 
popular option, while others are BidVertiser, Text Link Ads and Blogads.
 Direct banner and RSS feed are some other forms of online advertising.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;GPT Programme&lt;/span&gt;&lt;br style="font-weight: bold;" /&gt;GPT
 or Get-paid-to sites are becoming increasingly popular among teens. You
 get paid for signing up for free Websites, newsletters, playing games 
and filling out online surveys. These are suitable for people who don't 
have a skill set but want to earn extra money. Taking online surveys is 
simple- register with a few legitimate, paid survey sites and answer 
questions. The topics range from shopping to politics. This might not 
help you make a living, but you can earn good pocket money. Contests2win
 is one of the trusted GPT Websites.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Online Marketing&lt;/span&gt;&lt;br style="font-weight: bold;" /&gt;Once
 a Website is created and optimised for search engine (SEO), the SEM or 
Search Engine Marketing begins. A treasure trove lies hidden here. An 
SEO/SEM expert, who is responsible for marketing a Website, can promote 
it in various ways. These include article marketing, writing press 
releases, forum posting, blog posting, submitting your site to 
directories and search engines, social bookmarking, etc. Most companies 
don't do this in-house and pay you to conduct the SEM for them.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Making themes&lt;/span&gt;&lt;br style="font-weight: bold;" /&gt;As
 more and more people seek an online presence, the demand for Website 
templates and WordPress (Blog) themes will keep increasing. If you are 
good at Web designing and coding, you can earn a lot from designing Web 
themes. In this segment, there are mainstream Websites, such as 
TemplateMonster and ThemeForest, which act as a marketplace where you 
can sell your themes. Templates are sold and priced depending on the 
rights and features that are bundled with them.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Selling photos&lt;/span&gt;&lt;br style="font-weight: bold;" /&gt;If
 you enjoy photography and are good with a camera, you could be sitting 
on a huge reserve of revenue. There are people who will be interested in
 your collection of images. Nowadays, it's easy to take your photos to 
the public, providing a convenient way to build a secondary income 
stream. Many stock photo agencies, such as Fotolia, Dreamstime and 
Shutterstock, offer incentives for people to earn from their photos.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Support &amp;amp; service&lt;/span&gt;&lt;br style="font-weight: bold;" /&gt;Providing
 coding or fixing other Webmasters' issues is another great way to earn 
extra bucks. There are simple jobs ranging from adding a script to 
setting up sites, but knowledge of Web coding is essential. One can 
offer support for Web CMS (content management systems) like Drupal or 
Joomla. After you are comfortable with your own installation, you can 
help other people to set these up and configure them.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Stock/forex trading&lt;/span&gt;&lt;br style="font-weight: bold;" /&gt;Joining
 the stock/forex market may seem a bit risky. However, you can start 
small and continue researching till you gain experience in this area. 
Once you do, it will be easy to earn from exchanging foreign currencies 
and/or stocks. Their rates fluctuate depending on supply and demand, and
 economic and political influences in the world. The aim of any trader 
is to spot which currency/stock is likely to rise or fall in value 
against another. The more time you put in, the more you will earn.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Selling your own brand&lt;/span&gt;&lt;br style="font-weight: bold;" /&gt;If
 you have a flair for designing cool images, don't bother about creating
 your own inventory. As long as your design can be printed on a product,
 you can pocket some money. You can upload designs on various Websites 
such as CafePress, and if somebody orders these designs, the company 
will print them and distribute the products. It could be designs for 
T-shirts, hats, bags, books, posters, calendars, greeting cards, etc. 
You will receive a commission for each sale. Other such sites include 
Lulu and Zazzle.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Virtual Assistant&lt;/span&gt;&lt;br style="font-weight: bold;" /&gt;Small
 businesses always need help in running their processes, but may not be 
willing to hire a full-time employee. As a virtual assistant, you are 
expected to perform practically any administrative task that a 
traditional secretary or assistant would, such as make travel 
reservations, handle expense reimbursements or pay bills. You can do it 
from the comfort of your home, interacting with clients either online or
 by phone. Your expertise will decide how much moolah you rake in.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Inbound call centre&lt;/span&gt;&lt;br style="font-weight: bold;" /&gt;Many
 companies, who are facing space constraints, especially those in metro 
cities, prefer to hire workers outside their offices or outsource 
certain processes. You can set up an inbound call centre at home to 
handle such jobs. Research different companies that are outsourcing 
their work as they may have opportunities for inbound call centre 
agents. You can work for more than one company. This can be either a 
part-time or fulltime engagement, depending on your need.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;You Tube&lt;/span&gt;&lt;br style="font-weight: bold;" /&gt;If
 there's a dramatic performer hidden inside you who craves applause and 
adulation, upload yourself on YouTube. You can be a filmmaker, musician 
or comedian who wants a wider audience. Your earnings will come from ads
 displayed on your video page. This process is similar to the 
pay-per-click advertising program common to other Websites and blogs. 
Sites such as Flixya and Mediaflix can be helpful in this regard.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Researching for others&lt;/span&gt;&lt;br style="font-weight: bold;" /&gt;Don't
 be morose if you can't write, design or code. Lack of talent cannot 
stop you from making money online. If you're willing to work hard for a 
few hours a week, you can take up simple research jobs for other people 
who don't have the time to do it themselves. You could search for 
opportunities in organisations that provide funding for research and 
offer to assist them through online investigation.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Building Applications&lt;/span&gt;&lt;br style="font-weight: bold;" /&gt;With
 smartphones gaining popularity, the demand for their applications, or 
apps as they are popularly known, has also shot up. There are over 3 
million apps for the iPhone and over a million apps in Google's Android 
market. Most of these are selling like hot cakes. Developing and selling
 your own smartphone app is becoming a lucrative way to make money on 
the Internet. Apps cost virtually nothing to develop and entail no 
storage or shipping costs. So they enjoy the best profit margins.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Transcription&lt;/span&gt;&lt;br style="font-weight: bold;" /&gt;Medical
 transcription involves making written copies of oral material dictated 
by doctors or other medical experts. These may include history and 
physical reports, clinical notes, consultation notes, reports, letters, 
psychiatric evaluation and so on. The dictated material needs to be 
transcribed swiftly and accurately, which is the most challenging aspect
 of the job. To become a medical transcriptionist, you need to have a 
good knowledge of medical terminology and a high typing speed along with
 accuracy.&lt;/div&gt;
</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOCvT3K9b0R-zyBA1mz9yCH1-wpY2GYQ-tdDFYZtojkZAVb0nu_LKrXHfs1fPSbcHtA6EFRp7UhD9ogCNMq3ufXLla14mG2z13RjcgsoiqkmtI4x5QT3aH0QINQPSrCDMrDaQRNo0rPe0O/s72-c/make-money-online_325_012111035807.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">24</thr:total></item></channel></rss>