<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8177759477679540056</id><updated>2019-12-10T04:38:04.308-08:00</updated><category term="Java"/><title type='text'>Whale Code</title><subtitle type='html'>This Website is specially for those people who really want to learn programming and specially for those students who are going to appear for Computer board examination.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.whalecode.tk/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default'/><link rel='alternate' type='text/html' href='http://www.whalecode.tk/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Piyush Vishwakarma</name><uri>http://www.blogger.com/profile/09177463607902668136</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//3.bp.blogspot.com/-zU8qR36jdt0/XJS0uwdV1LI/AAAAAAAAAPo/gHBVkXw78BU7dclwZuHFvtoeUJAlNIgXQCK4BGAYYCw/s1600/images%253Fq%253Dtbn%253AANd9GcSqYjXvgxRmmc74Hyk8PCtkAsj-hS54KSYHAF1C6a2pSbAiRP2D'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8177759477679540056.post-5666767934315312495</id><published>2019-04-11T01:51:00.001-07:00</published><updated>2019-04-11T01:51:30.129-07:00</updated><title type='text'>Selection Statement (Part-II)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://2.bp.blogspot.com/-OYJVYmz21BY/XK7___OtmZI/AAAAAAAAAaY/RnJdPOBAkQAw37ZRWVkNNkn_p4QQz7BqQCLcBGAs/s1600/sketch-1554972616063.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1068&quot; data-original-width=&quot;1600&quot; height=&quot;213&quot; src=&quot;https://2.bp.blogspot.com/-OYJVYmz21BY/XK7___OtmZI/AAAAAAAAAaY/RnJdPOBAkQAw37ZRWVkNNkn_p4QQz7BqQCLcBGAs/s320/sketch-1554972616063.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Hi guys in this part of selection statement, we will learn about &lt;b&gt;&lt;i&gt;switch&lt;/i&gt;&lt;/b&gt; statement. To learn more about conditional statement , please refer to our previous post in which I have explained about if() statement and its type.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;Java provides one more multiway branching statement- &#39;&lt;b&gt;&lt;i&gt;switch&lt;/i&gt;&lt;/b&gt;&#39;. It can be used as an alternative form of if-else-if ladder. The switch statement has more flexibility and a clearer format than if-else-if ladder.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Definition:-&lt;/i&gt;&lt;br /&gt;&lt;i&gt;The switch keyword is a selection statement that allows to transfer the program control on the matching case depending upon the value of the variable.&amp;nbsp;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;The body of switch terminates as soon as the break statement appears. If no matching case is found then, the control transfers to default case abd execute the statement there, then terminates the switch body. It is not mandatory to write a default case in switch statement.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Absence of break statement for a case leads to a situation which is known as fall throung situation.&lt;/i&gt;&lt;br /&gt;In this situation all the statement starting from the matching case will be printed and the staments of other cases will also be printed. This will continue till the controller finds a break statement.&lt;br /&gt;&lt;br /&gt;The switch is also known as user&#39;s choice statement.&lt;br /&gt;Keywords used in switch statement:&lt;br /&gt;&lt;br /&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;switch&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;It is used to transfer the program control to the matching case depending upon the value of the variable.&lt;/div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;case&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;It contains one or more executable statements that ends with a break statement.&lt;/div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;break&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;It is a jump statement that terminates the execution of current case and comes out of the body of switch.&lt;/div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;default&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;It is the last statement of the switch body and executes if the matching case is not found. It is optional statement and can be used whenever requires.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;Important:&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&quot;A switch body can contain any number case statement but only one default statement.&quot;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;b&gt;Syntax of switch statement:&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;b&gt;switch(value or expression)&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;b&gt;{&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;b&gt;case constant-1: statement block-1&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;i&gt;&lt;b&gt;case constant-2: statement block-2&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;i&gt;&lt;b&gt;case constant-3: statement block-3&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;i&gt;&lt;b&gt;case constant-n: statement block-n&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;default: statement block-default&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;b&gt;}&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;In the above syntax &lt;b&gt;&lt;i&gt;switch, break, case, default &lt;/i&gt;&lt;/b&gt;are java keywords. The expression must be of type &lt;b&gt;&lt;i&gt;byte, short, int, long, char or string.&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;i&gt;Eg:&lt;/i&gt;&lt;br /&gt;&lt;i&gt;int m= 10;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;double n=20.0;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;switch(num)&lt;/i&gt;&lt;br /&gt;&lt;i&gt;{&lt;/i&gt;&lt;br /&gt;&lt;i&gt;case 1: m= m+1;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.out.println(&quot;m = &quot; +m);&amp;nbsp;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;break;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;case 2:&amp;nbsp; n= n*10;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;n = &quot; +n);&amp;nbsp;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;default:&amp;nbsp;&lt;/i&gt;&lt;i&gt;System.out.println(&quot;Wrong choice&quot;);&amp;nbsp;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;break;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;&lt;i&gt;System.out.println(&quot;You are out of switch block&quot;);&amp;nbsp;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;In the above code, two cases and a default statement are present. The case 1, contains two statements and a break statement, similarly case 2. The default statement contains one statement and a break statement. The cases of switch block can be executed in any order depending on the value of variable num present with switch.&lt;br /&gt;&lt;br /&gt;If value of num=1, then control searches for its matching case and reaches to case 1, then performs m=m+1 and the output will be printed as: &quot; m=11&quot;, then control reaches to break statement, which terminates the case 1 and control comes out of switch block.&lt;br /&gt;&lt;br /&gt;If value of num=2, then control searches for its matching case and reaches to case 2, then performs n= n*10 and the output will be printed as: &quot; n=200.0&quot;, then control reaches to break statement, which terminates the case 2 and control comes out of switch block.&lt;br /&gt;&lt;br /&gt;If the value of num is neither 1 nor 2 then the control search will move to default case and will print the statement present in it.&lt;br /&gt;&lt;br /&gt;That&#39;s all guys this is the end of this session and conditional statement. If you have any doubt related to conditional statement. Please contact us. We are always happy to help you.&lt;br /&gt;Thank you&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.whalecode.tk/feeds/5666767934315312495/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.whalecode.tk/2019/04/selection-statement-part-ii.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/5666767934315312495'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/5666767934315312495'/><link rel='alternate' type='text/html' href='http://www.whalecode.tk/2019/04/selection-statement-part-ii.html' title='Selection Statement (Part-II)'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://2.bp.blogspot.com/-OYJVYmz21BY/XK7___OtmZI/AAAAAAAAAaY/RnJdPOBAkQAw37ZRWVkNNkn_p4QQz7BqQCLcBGAs/s72-c/sketch-1554972616063.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8177759477679540056.post-3158497650966071460</id><published>2019-04-10T23:37:00.000-07:00</published><updated>2019-04-11T00:45:07.835-07:00</updated><title type='text'>Selection statement (Part-I)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://4.bp.blogspot.com/-mVj6Mdt_7kE/XK7hd-0FVrI/AAAAAAAAAaM/K4Bxn58Y13M_ETjWuo3ozVknctXzKNC2ACLcBGAs/s1600/sketch-1554964836403.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1068&quot; data-original-width=&quot;1600&quot; height=&quot;213&quot; src=&quot;https://4.bp.blogspot.com/-mVj6Mdt_7kE/XK7hd-0FVrI/AAAAAAAAAaM/K4Bxn58Y13M_ETjWuo3ozVknctXzKNC2ACLcBGAs/s320/sketch-1554964836403.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Hi guys today we will learn about selection statements. Conditional statements are also known as brancing statement or decision statement or selection statements. These are used to choose and execute a group of instructions depending on the outcome of a decision. Java provides two conditional statements.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;/div&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;if()&lt;/li&gt;&lt;li&gt;switch()&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;b&gt;Definition:-&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;The construct that choose and execute one or group of instructions depending on the outcome of a decision is known as Conditional statement or Selection statement.&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;There are many forms of if() conditional&amp;nbsp; statement and they are used depending upon the complexity of the conditions to be tested.&lt;/div&gt;&lt;div&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;i&gt;Simple if() statement&lt;/i&gt;&lt;/li&gt;&lt;li&gt;&lt;i&gt;Nested if() statement&lt;/i&gt;&lt;/li&gt;&lt;li&gt;&lt;i&gt;The if-else statement&lt;/i&gt;&lt;/li&gt;&lt;li&gt;&lt;i&gt;Nested if-else statement&lt;/i&gt;&lt;/li&gt;&lt;li&gt;&lt;i&gt;The if-else-if ladder&lt;/i&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;Simple if() statement&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;This statement is used to check one or more conditions and execute the block associated with if(), when the conditiom is TRUE, otherwise control skips the if() statement and runs the rest part of program.&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;Syntax of if() statement:-&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;if(condition)&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;{&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;statement&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;}&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The condition may represent&amp;nbsp; a relational expression, a logical expression or a boolean-type variable. It is mandatory to enclose the condition of if() statement in parenthesis.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;Eg:-&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;int height=5;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;int mark=2;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;if(height&amp;gt;=3)&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;{&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;mark= mark+3;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;}&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;The final value of mark is 5&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the above code if the value of variable height is more than&amp;nbsp; or equal to 3 then the mark will increase by 3 else it will not increase.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;b&gt;Nested if() statement&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;Presence of one or than one if() statement within an if() statement is known as nested if() statement.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;syntax for nested if() statement is:-&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;if(condition 1)&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;{&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;if(condition 2)&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;{&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;statement block;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;}&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;}&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In the above syntax if condition-1 stands true tnen, condition-2 will be evaluated; if it is also true then statement block will be executed. If any of the condition stands false then statement-block will be bypassed.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Eg:-&lt;/i&gt;&lt;br /&gt;&lt;i&gt;if(weight&amp;lt;45) &lt;b&gt;//outer if statement&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;{&lt;/i&gt;&lt;br /&gt;&lt;i&gt;if(height &amp;gt;175) &lt;b&gt;//inner if statement&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;{&lt;/i&gt;&lt;br /&gt;&lt;i&gt;count++; &lt;b&gt;//body of inner if statement&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;}&lt;b&gt; //end of inner if block&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;}&amp;nbsp;&lt;b&gt; //end of outer if block&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;In the above example, if the value of height is less than 45 then, the inner if() will be evaluated. If this condition also stands true then the value of count will be incremented by one, otherwise if any condition stands false then the process will be bypassed.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;The if-else Statement&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;i&gt;The if-else construct is used to check wheather the condition associated with if() block stands true or not, if the condition stands true then, it will be executed otherwise the statement associated will else block will be execute.&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;i&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;if(condition)&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;{&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;statement block-1&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;}&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;else&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;{&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;Statement block-2&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;}&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;If the condition in the if() block stands &lt;b&gt;true&lt;/b&gt; then, &lt;b&gt;Statement block-1&lt;/b&gt; will be executed. Otherwise &lt;b&gt;Statement block-2&lt;/b&gt; will be executed.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Eg:-&lt;/i&gt;&lt;br /&gt;&lt;i&gt;if(light==green)&lt;/i&gt;&lt;br /&gt;&lt;i&gt;{&lt;/i&gt;&lt;br /&gt;&lt;i&gt;System.out.println(&quot; You may go&quot;);&lt;/i&gt;&lt;br /&gt;&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;&lt;i&gt;else&lt;/i&gt;&lt;br /&gt;&lt;i&gt;{&lt;/i&gt;&lt;br /&gt;&lt;i&gt;System.out.println(&quot;Please stop&quot;);&lt;/i&gt;&lt;br /&gt;&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;In the above example if the traffic light is green; then the message &lt;i&gt;You may go &lt;/i&gt;will be printed otherwise message &lt;i&gt;Please stop&lt;/i&gt; will be printed.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;Nested if-else Statement&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;Presence of one or more than one if-else statement within an if-else statement is known as nested if-else statement.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;Syntax:&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;if(condition 1)&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;{&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;if(condition 2)&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;{&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;statement block-1;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;} // &lt;/b&gt;End of inner if statement&lt;/i&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;else&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;{&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;Statement block-2;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;} //&lt;/b&gt;end of inner else statement&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;} //&lt;/b&gt;end of outer if statement&lt;/i&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;else&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;{&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;statement block-3;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;} //&lt;/b&gt;end of outer else statement&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;In the above syntax, if the condition-1 evaluates true then condition-2 will be checked and if it also evaluates true then statement block-1 will be executed otherwise statement block-2 will be evaluate. If the condition-1 stands false then statement block-3 will be evaluated.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Eg:-&lt;/i&gt;&lt;br /&gt;&lt;i&gt;if(percentage&amp;gt;=85)&lt;/i&gt;&lt;br /&gt;&lt;i&gt;{&lt;/i&gt;&lt;br /&gt;&lt;i&gt;if(percentage&amp;gt;=92)&lt;/i&gt;&lt;br /&gt;&lt;i&gt;{&lt;/i&gt;&lt;br /&gt;&lt;i&gt;System.out.println(&quot;Eligible for 95% scholarship.&quot;);&lt;/i&gt;&lt;br /&gt;&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;&lt;i&gt;else&lt;/i&gt;&lt;br /&gt;&lt;i&gt;{&lt;/i&gt;&lt;br /&gt;&lt;i&gt;System.out.println(&quot;Eligible for 75% scholarship.&quot;);&lt;/i&gt;&lt;br /&gt;&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;&lt;i&gt;else&lt;/i&gt;&lt;br /&gt;&lt;i&gt;{&lt;/i&gt;&lt;br /&gt;&lt;i&gt;if(percentage&amp;gt;=70 &amp;amp;&amp;amp; percentage &amp;lt;=85)&lt;/i&gt;&lt;br /&gt;&lt;i&gt;{&lt;/i&gt;&lt;br /&gt;&lt;i&gt;System.out.println(&quot;Eligible for 60% scholarship.&quot;);&lt;/i&gt;&lt;br /&gt;&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;&lt;i&gt;else&lt;/i&gt;&lt;br /&gt;&lt;i&gt;{&lt;/i&gt;&lt;br /&gt;&lt;i&gt;System.out.println(&quot;Eligible for 40% scholarship.&quot;);&lt;/i&gt;&lt;br /&gt;&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;In the above example, if first condition&amp;nbsp;&lt;i&gt;(percentage&amp;gt;=85) &lt;/i&gt;evaluates true then second condition will be checked, i.e.&amp;nbsp;&lt;i&gt;(percentage&amp;gt;=92), &lt;/i&gt;if it also stands true then,&amp;nbsp;&lt;i&gt;Eligible for 95% scholarship&lt;/i&gt;. will be executed otherwise statement&amp;nbsp;E&lt;i&gt;ligible for 75% scholarship. &lt;/i&gt;will be executed. And if the condition&amp;nbsp;&lt;i&gt;(percentage&amp;gt;=85) &lt;/i&gt;evaluates false then the control will move to the else block and the condition&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;i&gt;(percentage&amp;gt;=70 &amp;amp;&amp;amp; percentage &amp;lt;=85) &lt;/i&gt;will be checked if it executes true then, statement&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;i&gt;Eligible for 60% scholarship. &lt;/i&gt;will execute otherwise statement&amp;nbsp;&lt;i&gt;Eligible for 40% scholarship. &lt;/i&gt;will be printed.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;The if-else-if Ladder&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;i&gt;The if-else-if ladder is used to control the multipath decisions where every else is associated with if() statement and terminates with else. As soon as any condition evaluated to true; the control bypasses rest of the if-else-if&#39;s and immediately exits from the condition statement body.&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/i&gt;&lt;i&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;if(condition-1)&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;{&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;statement-block-1;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;}&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;else if(condition-2)&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;{&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;statement-block-2&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;}&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;:&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;:&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;else if(condition-n)&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;{&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;statement-block-n&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;}&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;else&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;{&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;statement-block-s&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;}&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/i&gt;The above construct is known as if-else-if ladder. The condition are evaluated from top to bottom, and if any condition returns true then the statement block associated with that condition will execute, and control immediately comes out of whole chain. The last else part executes when all the chain of conditions are false.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Eg:-&lt;/i&gt;&lt;br /&gt;&lt;i&gt;if(percentage&amp;gt;=92)&lt;/i&gt;&lt;br /&gt;&lt;i&gt;System.out.println(&quot;Eligible for 95% scholarship&quot;);&lt;/i&gt;&lt;br /&gt;&lt;i&gt;else if(percentage&amp;gt;=85&amp;amp;&amp;amp;percentage&amp;lt;92)&lt;/i&gt;&lt;br /&gt;&lt;i&gt;System.out.println(&quot;Eligible for 75% scholarship&quot;);&lt;/i&gt;&lt;br /&gt;&lt;i&gt;else if(percentage&amp;gt;=70&amp;amp;&amp;amp; percentage&amp;lt;85)&lt;/i&gt;&lt;br /&gt;&lt;i&gt;System.out.println(&quot;Eligible for 60% scholarship&quot;);&lt;/i&gt;&lt;br /&gt;&lt;i&gt;else&lt;/i&gt;&lt;br /&gt;&lt;i&gt;System.out.println(&quot;Eligible for 40% scholarship&quot;);&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;The above code is self-explanatory, when the control starts with the condition; &lt;i&gt;(percentage&amp;gt;=92), &lt;/i&gt;if this is true; then a message,&amp;nbsp;&lt;i&gt;Eligible for 95% scholarship, &lt;/i&gt;will be printed, otherwise, if the condition is false; then the control jumps to else, where the condition;&amp;nbsp;&lt;i&gt;(percentage&amp;gt;=85&amp;amp;&amp;amp;percentage&amp;lt;92), &lt;/i&gt;will be checked, if it evaluates to true; then its corresponding message,&amp;nbsp;&lt;i&gt;Eligible for 75% scholarship, &lt;/i&gt;will be printed; similarly, all the conditions are checked and if all are false; then the control executes the last else and performs its associated task. This is the overall execution process of if-else-if ladder.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 15px; letter-spacing: 0.4px;&quot;&gt;That&#39;s all guys in next session we will learn about &lt;b&gt;&lt;i&gt;switch&lt;/i&gt;&lt;/b&gt; case.&lt;/span&gt;&lt;span style=&quot;background-color: white; box-sizing: border-box; color: #666666; font-family: &amp;quot;open sans&amp;quot;, arial, sans-serif; font-size: 15px; letter-spacing: 0.4px; list-style: none; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;I hope that you all&amp;nbsp; have understood all the the above if() conditional statement and its type. If you didn&#39;t understand any of the them please contact us. We will be happy to help you&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #666666; font-family: open sans, arial, sans-serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 15px; letter-spacing: 0.4px;&quot;&gt;Thank you&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.whalecode.tk/feeds/3158497650966071460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.whalecode.tk/2019/04/selection-stateme.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/3158497650966071460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/3158497650966071460'/><link rel='alternate' type='text/html' href='http://www.whalecode.tk/2019/04/selection-stateme.html' title='Selection statement (Part-I)'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://4.bp.blogspot.com/-mVj6Mdt_7kE/XK7hd-0FVrI/AAAAAAAAAaM/K4Bxn58Y13M_ETjWuo3ozVknctXzKNC2ACLcBGAs/s72-c/sketch-1554964836403.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8177759477679540056.post-2145395979069002648</id><published>2019-04-04T08:02:00.000-07:00</published><updated>2019-04-05T02:34:05.587-07:00</updated><title type='text'>Input Function(Scanner Class)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://2.bp.blogspot.com/-5_H199FaQzY/XKUIOVUghJI/AAAAAAAAAZs/wj87u3ChfJU7gAs-HEcJvEXdc10hAnQnwCLcBGAs/s1600/sketch-1554319396546.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1068&quot; data-original-width=&quot;1600&quot; height=&quot;213&quot; src=&quot;https://2.bp.blogspot.com/-5_H199FaQzY/XKUIOVUghJI/AAAAAAAAAZs/wj87u3ChfJU7gAs-HEcJvEXdc10hAnQnwCLcBGAs/s320/sketch-1554319396546.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;Hi friends, in this post we we learn about various input fuctions used in Scanner class to receive input from the user. If you don&#39;t know how to create object and import package of Scanner and BufferedReader class please refer to our previous post.&lt;br /&gt;The Scanner class include many functions that allows to input values for primitive datatypes and other type Strings.&lt;br /&gt;These functions are described below with syntax and definitions:&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;Object of Scanner class:&lt;br /&gt;Scanner src= new Scanner (System.in);&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;1. nextShort()&lt;br /&gt;Use:- To take short integer value as input.&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;i&gt;Eg:&lt;/i&gt;&lt;br /&gt;&lt;i&gt;short num;&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;i&gt;num= src.nextShort();&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;2. nextInt()&lt;br /&gt;Use:- To take&amp;nbsp; integer value as input.&lt;br /&gt;Eg:&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;i&gt;int num;&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;i&gt;num= src.nextInt();&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;3. nextLong()&lt;br /&gt;Use:- To take Long integer value as input.&lt;br /&gt;Eg:&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;i&gt;long num;&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;i&gt;num= src.nextLong();&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;4. nextFloat()&lt;br /&gt;Use: To take float value as input.&lt;br /&gt;Eg:&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;i&gt;float num;&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;i&gt;num= src.nextFloat();&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;5. nextDouble()&lt;br /&gt;Use: To take double value as input.&lt;br /&gt;Eg:&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;i&gt;double num;&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;i&gt;num= src.nextDouble();&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;6. nextLine()&lt;br /&gt;Use: To take a line&amp;nbsp; as input.&lt;br /&gt;Eg:&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;i&gt;String n= src.nextLine();&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;i&gt;7. next()&lt;/i&gt;&lt;br /&gt;&lt;i&gt;Use: To take a word as input.&lt;/i&gt;&lt;br /&gt;&lt;i&gt;Eg:&lt;/i&gt;&lt;br /&gt;&lt;i&gt;String n=src.next();&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;i&gt;8. close()&lt;/i&gt;&lt;br /&gt;&lt;i&gt;To close the scanner class.&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;background-color: white; box-sizing: border-box; color: #666666; font-family: &amp;quot;open sans&amp;quot;, arial, sans-serif; font-size: 15px; letter-spacing: 0.4px; list-style: none; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;That&#39;s all guys.&lt;i style=&quot;box-sizing: border-box; list-style: none !important; margin: 0px; outline: 0px !important; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/i&gt;&lt;span style=&quot;box-sizing: border-box; font-family: &amp;quot;open sans&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; letter-spacing: 0.4px; list-style: none; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;I hope that you have understood the basic input operations and input function if you didn&#39;t understand either of them please inform us. We will be happy to help you.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;br style=&quot;background-color: white; box-sizing: border-box; color: #666666; font-family: &amp;quot;open sans&amp;quot;, arial, sans-serif; font-size: 15px; letter-spacing: 0.4px; list-style: none; margin: 0px; outline: 0px; padding: 0px;&quot; /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;span style=&quot;background-color: white; box-sizing: border-box; color: #666666; font-family: &amp;quot;open sans&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 15px; letter-spacing: 0.4px; list-style: none; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;Thank You.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.whalecode.tk/feeds/2145395979069002648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.whalecode.tk/2019/04/input-functionscanner-class.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/2145395979069002648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/2145395979069002648'/><link rel='alternate' type='text/html' href='http://www.whalecode.tk/2019/04/input-functionscanner-class.html' title='Input Function(Scanner Class)'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://2.bp.blogspot.com/-5_H199FaQzY/XKUIOVUghJI/AAAAAAAAAZs/wj87u3ChfJU7gAs-HEcJvEXdc10hAnQnwCLcBGAs/s72-c/sketch-1554319396546.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8177759477679540056.post-8867857321789464856</id><published>2019-04-03T03:59:00.000-07:00</published><updated>2019-04-05T02:35:03.493-07:00</updated><title type='text'>Input Function/Method(BufferedReader and DataInputStream class)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://4.bp.blogspot.com/-OwvD3Kv3OZU/XKR0UXtt4AI/AAAAAAAAAX0/yh9IbSEYxQ0unBsMSYcaNBXpQ_IaLXFkwCLcBGAs/s1600/sketch-1554281349959.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1068&quot; data-original-width=&quot;1600&quot; height=&quot;213&quot; src=&quot;https://4.bp.blogspot.com/-OwvD3Kv3OZU/XKR0UXtt4AI/AAAAAAAAAX0/yh9IbSEYxQ0unBsMSYcaNBXpQ_IaLXFkwCLcBGAs/s320/sketch-1554281349959.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Hi friends, in this post we we learn about various input fuctions used in DataInputStream and BufferedReader class to receive input from the user. If you don&#39;t know how to create object and import package of Scanner and BufferedReader class please refer to our previous post.&lt;br /&gt;&lt;br /&gt;Input Functions(BufferedReader and DataInput)&lt;br /&gt;To perform the input operations using BufferedReader and DataInputStream class following functions are used:&lt;br /&gt;&lt;br /&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;i&gt;read()&lt;/i&gt;&lt;/li&gt;&lt;li&gt;&lt;i&gt;readLine()&lt;/i&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;b&gt;1. The read() function&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;This function is used to input or read a character from the input stream and returns -1 when the end of the stream is encountered.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Syntax:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;character&#39;_variable= (char) System.in.read();&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Or&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;character&#39;_variable=(char) buffervariable.read();&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;Eg:&amp;nbsp;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;char ch= (char)System.in.read(); //to input a character on terminal window&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;Eg:&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;BufferedReader br= new BufferedReader (new InputStreamReader(System.in));&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;char ch= (char)br.read(); //to input a character&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;2. The readLine() function&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;This function is used to read or input a line of text from the input stream.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Syntax to input a numeric value:&lt;/b&gt;&lt;br /&gt;&lt;b&gt;[data_type] variable name = wrapper_class_of_datatype.parsedatatype(buffer_variable.readLine());&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Syntax to input a string:&lt;/b&gt;&lt;br /&gt;&lt;b&gt;String variable_name = buffer_variable.readLine();&lt;/b&gt;&lt;br /&gt;&lt;i&gt;Eg:&lt;/i&gt;&lt;br /&gt;&lt;i&gt;BufferedReader br= new BufferedReader (new InputStreamReader (System.in());&lt;/i&gt;&lt;br /&gt;&lt;i&gt;int num = Integer.parseInt(br.readLine());&lt;/i&gt;&lt;br /&gt;&lt;i&gt;Eg:&lt;/i&gt;&lt;br /&gt;&lt;i&gt;String str= br.readLine();&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Basic Input operations using both classes:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1.To take short integer value from input:&lt;br /&gt;&lt;i&gt;short num;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;num= Short.parseShort(br.readLine());&lt;/i&gt;&lt;br /&gt;&lt;i&gt;Or&lt;/i&gt;&lt;br /&gt;&lt;i&gt;String n= br.readLine();&lt;/i&gt;&lt;br /&gt;&lt;i&gt;short num= Short.parseShort(n);&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;2. To take&amp;nbsp; integer value from input:&lt;br /&gt;&lt;i&gt;int num;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;num= Integer.parseInt(br.readLine());&lt;/i&gt;&lt;br /&gt;&lt;i&gt;Or&lt;/i&gt;&lt;br /&gt;&lt;i&gt;String n= br.readLine();&lt;/i&gt;&lt;br /&gt;&lt;i&gt;int num= Integer.parseInt(n);&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;3. To take Long integer value from input:&lt;br /&gt;&lt;i&gt;long num;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;num= Long.parseLong(br.readLine());&lt;/i&gt;&lt;br /&gt;&lt;i&gt;Or&lt;/i&gt;&lt;br /&gt;&lt;i&gt;String n= br.readLine();&lt;/i&gt;&lt;br /&gt;&lt;i&gt;long num= Long.parseLong(n);&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;4. To take float value from input:&lt;br /&gt;&lt;i&gt;float num;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;num= Float.parseFloat(br.readLine());&lt;/i&gt;&lt;br /&gt;&lt;i&gt;Or&lt;/i&gt;&lt;br /&gt;&lt;i&gt;String n= br.readLine();&lt;/i&gt;&lt;br /&gt;&lt;i&gt;float num= Float.parseFloat(n);&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;5. To take double value from input:&lt;br /&gt;&lt;i&gt;double num;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;num= Double.parseDouble(br.readLine());&lt;/i&gt;&lt;br /&gt;&lt;i&gt;Or&lt;/i&gt;&lt;br /&gt;&lt;i&gt;String n= br.readLine();&lt;/i&gt;&lt;br /&gt;&lt;i&gt;double num= Double.parseDouble(n);&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;6. To take string&amp;nbsp; value from input:&lt;br /&gt;&lt;i&gt;String n= br.readLine();&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;background-color: white; box-sizing: border-box; color: #666666; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 15px; letter-spacing: 0.4px; list-style: none !important; margin: 0px; outline: 0px !important; padding: 0px;&quot;&gt;That&#39;s all guys.&lt;i style=&quot;box-sizing: border-box; list-style: none !important; margin: 0px; outline: 0px !important; padding: 0px;&quot;&gt;&amp;nbsp;&lt;/i&gt;&lt;span style=&quot;box-sizing: border-box; font-family: &amp;quot;open sans&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; letter-spacing: 0.4px; list-style: none; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;I hope that you have understood the basic input operations and input function if you didn&#39;t understand either of them please inform us. We will be happy to help you.&lt;/span&gt;&lt;/div&gt;&lt;br style=&quot;background-color: white; box-sizing: border-box; color: #666666; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 15px; letter-spacing: 0.4px; list-style: none !important; margin: 0px; outline: 0px !important; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: white; box-sizing: border-box; color: #666666; font-family: &amp;quot;open sans&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 15px; letter-spacing: 0.4px; list-style: none; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;Thank You.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.whalecode.tk/feeds/8867857321789464856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.whalecode.tk/2019/04/input-functionmethodbufferedreader-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/8867857321789464856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/8867857321789464856'/><link rel='alternate' type='text/html' href='http://www.whalecode.tk/2019/04/input-functionmethodbufferedreader-and.html' title='Input Function/Method(BufferedReader and DataInputStream class)'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://4.bp.blogspot.com/-OwvD3Kv3OZU/XKR0UXtt4AI/AAAAAAAAAX0/yh9IbSEYxQ0unBsMSYcaNBXpQ_IaLXFkwCLcBGAs/s72-c/sketch-1554281349959.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8177759477679540056.post-5626396207258676186</id><published>2019-04-01T03:35:00.000-07:00</published><updated>2019-04-01T03:36:45.176-07:00</updated><title type='text'>Concept Of Input</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://1.bp.blogspot.com/--inI2229HvI/XKHfGkZHHII/AAAAAAAAAXc/KIcIvmZOKn4nQE95dHi6j-0_n-iTpNzlACLcBGAs/s1600/sketch-1554112231901.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1068&quot; data-original-width=&quot;1600&quot; height=&quot;213&quot; src=&quot;https://1.bp.blogspot.com/--inI2229HvI/XKHfGkZHHII/AAAAAAAAAXc/KIcIvmZOKn4nQE95dHi6j-0_n-iTpNzlACLcBGAs/s320/sketch-1554112231901.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Hi guys in this session we will come to know about input class.&lt;br /&gt;The term input means receiving information from the user will the help of keyboard or mouse.&lt;br /&gt;The are 3 stream classes that are used to receive input from the user. They are as mentioned:&lt;br /&gt;&lt;br /&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;i&gt;DataInputStream class&lt;/i&gt;&lt;/li&gt;&lt;li&gt;&lt;i&gt;BufferedReader class&lt;/i&gt;&lt;/li&gt;&lt;li&gt;&lt;i&gt;Scanner class&lt;/i&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;To use any of the above stream classes, we have to import their respective packages in our program.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Packages are the collection of similar type of classes and interface.&lt;/div&gt;&lt;div&gt;&lt;b&gt;java.io.*;&lt;/b&gt; package is used to import &lt;b&gt;DataInputStream&lt;/b&gt; and &lt;b&gt;BufferedReader&lt;/b&gt; class in our program whereas &lt;b&gt;java.util.*; &lt;/b&gt;is used to import &lt;b&gt;scanner&lt;/b&gt; class in our program.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. &lt;b&gt;&lt;i&gt;DataInputStream class&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To receive an input using this class, firstly , we have to use import statement at the beginning of our program.&lt;/div&gt;&lt;div&gt;e.g: &lt;i&gt;import java.io.*;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;After importing the package we have to create an object of this class.&lt;/div&gt;&lt;div&gt;Syntax for creating object of DataInputStream class is:&lt;/div&gt;&lt;div&gt;&lt;b&gt;DataInputStream variable_name = new DataInputStream (System.in);&lt;/b&gt;&lt;/div&gt;&lt;div&gt;e.g: &lt;i&gt;DataInputStream src = new DataInputStream (System.in);&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;2. &lt;b&gt;BufferedReader class&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To receive an input using this class, firstly , we have to use import statement at the beginning of our program.&lt;/div&gt;&lt;div&gt;&lt;div&gt;e.g: &lt;i&gt;import java.io.*;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;After importing the package we have to create an object of this class.&lt;/div&gt;&lt;div&gt;Syntax for creating object of BufferedReader class is:&lt;/div&gt;&lt;div&gt;&lt;b&gt;BufferedReader variable_name = new BufferedReader (new InputStreamReader(System.in));&lt;/b&gt;&lt;/div&gt;&lt;div&gt;e.g:&amp;nbsp;BufferedReader src&lt;i&gt;&amp;nbsp;= new BufferedReader (new InputStreamReader ((System.in));&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;3. &lt;b&gt;&lt;i&gt;Scanner Class&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;div&gt;To receive an input using this class, firstly , we have to use import statement at the beginning of our program.&lt;/div&gt;&lt;div&gt;&lt;div&gt;e.g:&amp;nbsp;&lt;i&gt;import java.util.*;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;After importing the package we have to create an object of this class.&lt;/div&gt;&lt;div&gt;Syntax for creating object of Scanner class is:&lt;/div&gt;&lt;div&gt;&lt;b&gt;Scanner variable_name = new Scanner(System.in);&lt;/b&gt;&lt;/div&gt;&lt;div&gt;e.g: Scanner src&lt;i&gt;&amp;nbsp;= new Scanner(System.in);&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;That&#39;s all guys in next session we will learn about BufferedReader and Scanner class in deep.&lt;span style=&quot;box-sizing: border-box; color: #666666; font-family: &amp;quot;open sans&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; letter-spacing: 0.4px; list-style: none; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;I hope that you all&amp;nbsp; have understood all the three stream classes. If you didn&#39;t understand any of the class please contact us.&lt;/span&gt;&lt;br /&gt;&lt;br style=&quot;background-color: white; box-sizing: border-box; color: #666666; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 15px; letter-spacing: 0.4px; list-style: none !important; margin: 0px; outline: 0px !important; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: white; box-sizing: border-box; color: #666666; font-family: &amp;quot;open sans&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 15px; letter-spacing: 0.4px; list-style: none; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;Thank You.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.whalecode.tk/feeds/5626396207258676186/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.whalecode.tk/2019/04/concept-of-input.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/5626396207258676186'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/5626396207258676186'/><link rel='alternate' type='text/html' href='http://www.whalecode.tk/2019/04/concept-of-input.html' title='Concept Of Input'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://1.bp.blogspot.com/--inI2229HvI/XKHfGkZHHII/AAAAAAAAAXc/KIcIvmZOKn4nQE95dHi6j-0_n-iTpNzlACLcBGAs/s72-c/sketch-1554112231901.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8177759477679540056.post-339241282022383744</id><published>2019-03-29T02:55:00.001-07:00</published><updated>2019-04-01T02:45:14.365-07:00</updated><title type='text'>Looping statement</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://2.bp.blogspot.com/-FhBnXttwY2U/XKFyiKb3q1I/AAAAAAAAAQs/DkK51kzE2e4iNDJeiVeGSClvWIh_a2ezwCLcBGAs/s1600/loop.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;427&quot; data-original-width=&quot;640&quot; height=&quot;213&quot; src=&quot;https://2.bp.blogspot.com/-FhBnXttwY2U/XKFyiKb3q1I/AAAAAAAAAQs/DkK51kzE2e4iNDJeiVeGSClvWIh_a2ezwCLcBGAs/s320/loop.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;Hi guys, this is a short but very important session related to looping statement. In this session we will learn about the difference between the different while() loop and do-while() loop.&lt;br /&gt;&lt;br /&gt;Since while() loop and for() loop both are entry controlled loop. There is no difference between both of them. They only differ from each other in terms of syntax only.&lt;br /&gt;&lt;br /&gt;Knowing the difference between while() and do-while() loop is very important because in board examination there are many question in &lt;b&gt;section-I&lt;/b&gt;&amp;nbsp;asking the output of the program.&lt;br /&gt;&lt;br /&gt;The most important difference between while and do-while loop is that in do-while , the block of code is executed at least once, even though the condition given is false.&lt;br /&gt;In While loop, the condition is first tested and then the block of code is executed if the test result is true.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;while() loop&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;i&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;q_serif&amp;quot; , &amp;quot;georgia&amp;quot; , &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , &amp;quot;hiragino kaku gothic pro&amp;quot; , &amp;quot;meiryo&amp;quot; , serif; font-size: 15px;&quot;&gt;while loop first check the condition then enter the body.&lt;/span&gt;&lt;/i&gt;&lt;/li&gt;&lt;li&gt;&lt;i&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;q_serif&amp;quot; , &amp;quot;georgia&amp;quot; , &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , &amp;quot;hiragino kaku gothic pro&amp;quot; , &amp;quot;meiryo&amp;quot; , serif; font-size: 15px;&quot;&gt;while is a entry -controlled loop.&lt;/span&gt;&lt;/i&gt;&lt;/li&gt;&lt;li&gt;&lt;i&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;q_serif&amp;quot; , &amp;quot;georgia&amp;quot; , &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , &amp;quot;hiragino kaku gothic pro&amp;quot; , &amp;quot;meiryo&amp;quot; , serif; font-size: 15px;&quot;&gt;In while, condition comes before the body.&lt;/span&gt;&lt;/i&gt;&lt;/li&gt;&lt;li&gt;&lt;i&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: &amp;quot;q_serif&amp;quot; , &amp;quot;georgia&amp;quot; , &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , &amp;quot;hiragino kaku gothic pro&amp;quot; , &amp;quot;meiryo&amp;quot; , serif; font-size: 15px;&quot;&gt;There is no semi-colon at the end loop body.&lt;/span&gt;&lt;/i&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;q_serif&amp;quot; , &amp;quot;georgia&amp;quot; , &amp;quot;times&amp;quot; , &amp;quot;times new roman&amp;quot; , &amp;quot;hiragino kaku gothic pro&amp;quot; , &amp;quot;meiryo&amp;quot; , serif;&quot;&gt;&lt;span style=&quot;font-size: 15px;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;b&gt;do-while() loop&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;i&gt;do-while first enter the body and then check the condition.&lt;/i&gt;&lt;/li&gt;&lt;li&gt;&lt;i&gt;do-while is an exit-controlled loop.&lt;/i&gt;&lt;/li&gt;&lt;li&gt;&lt;i&gt;In do-while, condition comes after the body.&lt;/i&gt;&lt;/li&gt;&lt;li&gt;&lt;i&gt;There is semi-colon at the end of loop body.&lt;/i&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;That&#39;s all guys.&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;open sans&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 15px; letter-spacing: 0.4px;&quot;&gt;I hope that you have understood the difference between both of them. If you didn&#39;t understand either while() loop or&amp;nbsp; do-while () loop please inform us.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; box-sizing: border-box; color: #666666; font-family: &amp;quot;open sans&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 15px; letter-spacing: 0.4px; list-style: none; margin: 0px; outline: 0px; padding: 0px;&quot;&gt;Thank You.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.whalecode.tk/feeds/339241282022383744/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.whalecode.tk/2019/03/looping-statement.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/339241282022383744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/339241282022383744'/><link rel='alternate' type='text/html' href='http://www.whalecode.tk/2019/03/looping-statement.html' title='Looping statement'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://2.bp.blogspot.com/-FhBnXttwY2U/XKFyiKb3q1I/AAAAAAAAAQs/DkK51kzE2e4iNDJeiVeGSClvWIh_a2ezwCLcBGAs/s72-c/loop.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8177759477679540056.post-8281670747850166366</id><published>2019-03-29T02:34:00.000-07:00</published><updated>2019-03-29T02:34:15.670-07:00</updated><title type='text'>do-while() loop</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://1.bp.blogspot.com/-0u8Ytc3tpzI/XJ3evBvr22I/AAAAAAAAAW0/xDvR7Oe8n2YTZr7kOR_zh_05icj86G1rQCLcBGAs/s1600/images%2B%25281%2529.jpeg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;400&quot; data-original-width=&quot;400&quot; height=&quot;320&quot; src=&quot;https://1.bp.blogspot.com/-0u8Ytc3tpzI/XJ3evBvr22I/AAAAAAAAAW0/xDvR7Oe8n2YTZr7kOR_zh_05icj86G1rQCLcBGAs/s320/images%2B%25281%2529.jpeg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Hi friends, in this session we will learn about do-while () loop.&lt;br /&gt;This loop is used to execute a set of statements till the condition stands true and the loop will terminate when the condition stands false. It is an &lt;b&gt;exit controlled loop&lt;/b&gt;. That means first it will get executed and then it will check the condition. In do-while loop even though the condition stands false the loop will get executed at least once.&lt;br /&gt;Having knowledge about do-while() loop is mandatory for better programming in Java. But it is not very important for board examination.&lt;br /&gt;&lt;br /&gt;Syntax for do-while() loop is:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Starting value of loop variable;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;do&lt;/b&gt;&lt;br /&gt;&lt;b&gt;{&lt;/b&gt;&lt;br /&gt;&lt;b&gt;statement;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;statement;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;update statement;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;}while(condition);&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Let us learn about do-while () loop with the help of an example so that we can learn about do-while() loop more easily.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Write a program in BlueJ to find the sum of all the values of variable with the help of do-while() loop.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Program&lt;/i&gt;:&lt;br /&gt;&lt;b&gt;class loop // class declaration&lt;/b&gt;&lt;br /&gt;&lt;b&gt;{&lt;/b&gt;&lt;br /&gt;&lt;b&gt;public static void loop() // method declaration&amp;nbsp;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;{&lt;/b&gt;&lt;br /&gt;&lt;b&gt;int a=0; // variable initialization to control loop&lt;/b&gt;&lt;br /&gt;&lt;b&gt;int sum = 0; // variable to store value of a&lt;/b&gt;&lt;br /&gt;&lt;b&gt;do // starting of do-while () loop&lt;/b&gt;&lt;br /&gt;&lt;b&gt;{&lt;/b&gt;&lt;br /&gt;&lt;b&gt;a++&lt;/b&gt;&lt;br /&gt;&lt;b&gt;sum= sum+a;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;}&lt;/b&gt;&lt;br /&gt;&lt;b&gt;while(a&amp;lt;=5); // end of do-while () loop&lt;/b&gt;&lt;br /&gt;&lt;b&gt;System.out.println(&quot;Sum of values of a is = &quot;+ sum); //output statement&lt;/b&gt;&lt;br /&gt;&lt;b&gt;}&lt;/b&gt;&lt;br /&gt;&lt;b&gt;}&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;b&gt;Output:&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Sum of values of a is = 21&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The loop will get executed 6 times because the starting value of a is 0 and the loop will executed till the value of a becomes 6.&lt;br /&gt;Since it is an exit controlled looping statement the the loop with first get executed and then it will check the condition. That is why even though the condition is &quot;a less than or equal to 5.&quot; The value a= 6 will be executed.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; box-sizing: border-box; color: #666666; font-family: &amp;quot;open sans&amp;quot;, arial, sans-serif; font-size: 15px; letter-spacing: 0.4px; list-style: none !important; margin: 0px; outline: 0px !important; padding: 0px;&quot;&gt;I hope that all of you have understood the program as well as concept.If you didn&#39;t understand either the program or the concept please inform us.&lt;/span&gt;&lt;br style=&quot;background-color: white; box-sizing: border-box; color: #666666; font-family: &amp;quot;Open Sans&amp;quot;, Arial, sans-serif; font-size: 15px; letter-spacing: 0.4px; list-style: none !important; margin: 0px; outline: 0px !important; padding: 0px;&quot; /&gt;&lt;span style=&quot;background-color: white; box-sizing: border-box; color: #666666; font-family: &amp;quot;open sans&amp;quot;, arial, sans-serif; font-size: 15px; letter-spacing: 0.4px; list-style: none !important; margin: 0px; outline: 0px !important; padding: 0px;&quot;&gt;Thank You.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.whalecode.tk/feeds/8281670747850166366/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.whalecode.tk/2019/03/do-while-loop.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/8281670747850166366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/8281670747850166366'/><link rel='alternate' type='text/html' href='http://www.whalecode.tk/2019/03/do-while-loop.html' title='do-while() loop'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://1.bp.blogspot.com/-0u8Ytc3tpzI/XJ3evBvr22I/AAAAAAAAAW0/xDvR7Oe8n2YTZr7kOR_zh_05icj86G1rQCLcBGAs/s72-c/images%2B%25281%2529.jpeg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8177759477679540056.post-6841639673822706290</id><published>2019-03-28T02:31:00.000-07:00</published><updated>2019-03-28T08:54:37.630-07:00</updated><title type='text'>while() loop</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Hi friends. In this session, we will learn about while loop. First of all let me tell you something about while() loop:&lt;br /&gt;&lt;br /&gt;while() loop is used to execute a set of statements till the condition stands true and the loop will terminate if the condition stands false. It is an entry controlled loop. That means first it will check the condition and if the condition stands true then loop will execute else the loop will terminate.&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://2.bp.blogspot.com/-2TWjgxEHrxQ/XJyUB8f33nI/AAAAAAAAAWo/5qh2puEA0cEH5zDOS3ztI5KhcX4HMPk3QCLcBGAs/s1600/images.jpeg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;400&quot; data-original-width=&quot;400&quot; height=&quot;320&quot; src=&quot;https://2.bp.blogspot.com/-2TWjgxEHrxQ/XJyUB8f33nI/AAAAAAAAAWo/5qh2puEA0cEH5zDOS3ztI5KhcX4HMPk3QCLcBGAs/s320/images.jpeg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;It is very important to know about while() loop because there are many questions related to it in board examination.&lt;br /&gt;&lt;br /&gt;Syntax for while() loop is:&lt;br /&gt;&lt;b&gt;initial value of variable;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;while(condition)// beginning of while loop.&lt;/b&gt;&lt;br /&gt;&lt;b&gt;{&lt;/b&gt;&lt;br /&gt;&lt;b&gt;statement;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;update expression&lt;/b&gt;&lt;br /&gt;&lt;b&gt;}//end of while loop.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Guys let me explain this loop with an example as it will help you to understand easily.&lt;br /&gt;Question: Write a program with the help of while() loop to find the sum of values of a number.&lt;br /&gt;&lt;br /&gt;Program:&lt;br /&gt;&lt;b&gt;class looping //beginning of class;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;{&lt;/b&gt;&lt;br /&gt;&lt;b&gt;public static void main() // method declaration&lt;/b&gt;&lt;br /&gt;&lt;b&gt;{&lt;/b&gt;&lt;br /&gt;&lt;b&gt;int a = 0; //initial value of variable a;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;int sum = 0; //this variable will store sum;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;while(a&amp;lt;=5) //beginning of while() loop&lt;/b&gt;&lt;br /&gt;&lt;b&gt;{&lt;/b&gt;&lt;br /&gt;&lt;b&gt;sum= sum+a; //addition of values;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;a++;//update expression&lt;/b&gt;&lt;br /&gt;&lt;b&gt;} // End of while() loop;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;System.out.println(&quot;sum of all the values of a = &quot; + sum); //output statement&lt;/b&gt;&lt;br /&gt;&lt;b&gt;}&lt;/b&gt;&lt;br /&gt;&lt;b&gt;}&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;Output of above program will be:&lt;br /&gt;sum of all values of a= 15&lt;br /&gt;&lt;br /&gt;Friends let me explain this program to you.&lt;br /&gt;In the first line of program, I have declared a class with name looping.&lt;br /&gt;Second line of program contains opening bracket of class.&lt;br /&gt;Third line of program contains a public method whose name is main. It has no return data type.&lt;br /&gt;Fourth line contains opening bracket of main method.&lt;br /&gt;In the fifth line, I have declared a variable with initial value of 0.&lt;br /&gt;In the sixth line, I have declared a variable to store the sum of values variable declared in fifth line.&lt;br /&gt;Seventh line of program is the starting line of while() loop.&lt;br /&gt;In Eighth line of program, we store the sum of in the variable sum.&lt;br /&gt;The ninth line of program contain an update expression which increases the value of a by 1.&lt;br /&gt;The loop will execute till the value of a is less than or equal to 5. When the value of a goes above 5 the loop will terminate.&lt;br /&gt;Once the loop is terminated the output statement of the program will execute and the output message will be displayed.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;open sans&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 15px; letter-spacing: 0.4px;&quot;&gt;I hope that you have understand the program as well as concept.If you didn&#39;t understand either the program or the concept please inform us.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;open sans&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 15px; letter-spacing: 0.4px;&quot;&gt;Thank You.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;open sans&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 15px; letter-spacing: 0.4px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: &amp;quot;open sans&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif; font-size: 15px; letter-spacing: 0.4px;&quot;&gt;To understand more easily subscribe to our youtube channel whale code. Just click on the given link to subscribe our youtube channel:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; color: #666666; font-family: open sans, arial, sans-serif; font-size: 15px; letter-spacing: 0.4px;&quot;&gt;https://www.youtube.com/channel/UCV7Lk88wls6Q8Jbc0IhElAQ&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.whalecode.tk/feeds/6841639673822706290/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.whalecode.tk/2019/03/while-loop.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/6841639673822706290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/6841639673822706290'/><link rel='alternate' type='text/html' href='http://www.whalecode.tk/2019/03/while-loop.html' title='while() loop'/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/blank.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://2.bp.blogspot.com/-2TWjgxEHrxQ/XJyUB8f33nI/AAAAAAAAAWo/5qh2puEA0cEH5zDOS3ztI5KhcX4HMPk3QCLcBGAs/s72-c/images.jpeg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8177759477679540056.post-2100422147050147701</id><published>2019-02-22T05:35:00.001-08:00</published><updated>2019-02-22T05:52:05.755-08:00</updated><title type='text'>for() loop</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Definition:It allows a set statements to be repeated or looped through a fixed number of times.&lt;/h3&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://3.bp.blogspot.com/-jbpUhT2NDl0/XG_-ds2XHAI/AAAAAAAAALE/384_4wFz1TkBJ9ZlPPKJmR5oRapko4i-gCLcBGAs/s1600/for%2528%2529loop.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;720&quot; data-original-width=&quot;1280&quot; height=&quot;180&quot; src=&quot;https://3.bp.blogspot.com/-jbpUhT2NDl0/XG_-ds2XHAI/AAAAAAAAALE/384_4wFz1TkBJ9ZlPPKJmR5oRapko4i-gCLcBGAs/s320/for%2528%2529loop.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;Syntax:&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;for(initial value;condition-checking;update-statements)&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Statements;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}//end of for loop&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Let&#39;s understand for() loop in a better way by using an example.I&#39;m sure that by reading this content you will master of for() loop and if you&lt;br /&gt;have any doubt related with for() loop please inform us using conatct box or Comment box or send your doubt to urspiyushvishwakarma@gmail.com&lt;br /&gt;I will try to clear your doubt because loop are very important for Board Exams as well as making a good program.&lt;br /&gt;&lt;br /&gt;So,let&#39;s look on the example:&lt;br /&gt;&lt;br /&gt;Imagine if we want to print numbers from 1 to 100 what&amp;nbsp; we will do.I know it&#39;s quite difficult to print 1 to 100 if you don&#39;t know the concept of loop.&lt;br /&gt;So, let&#39;s use the technique of for()loop:&lt;br /&gt;&lt;br /&gt;Open your BlueJ and create a new project as well as class.If you have already created,just skip this step.&lt;br /&gt;Now start working on the program&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Here is the Program:&lt;/div&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;class prnt&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public static void main()&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; int i;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;for(i=1;i&amp;lt;=100;i++);&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;System.out.println(i);&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}//end of the for()loop&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}//end of the main method&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}//end of the class&lt;/blockquote&gt;&lt;br /&gt;&amp;nbsp;Now the output will be printed from 1 to 100 in different lines(Because we have use println())&lt;br /&gt;&lt;br /&gt;Let&#39;s understand the program line by line&lt;br /&gt;&lt;br /&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;In the first line I have created a class name prnt.&lt;/li&gt;&lt;li&gt;In the Third line I have written a main method.&lt;/li&gt;&lt;li&gt;In the fifth line I have declared an variable name &quot;i&quot; which is in integer type.&lt;/li&gt;&lt;li&gt;In the sixth line I have used the concept of for()loop(refer to the syntax of for()loop above).&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Here in the bracket firstly I have initialized the value of i to 1,secondly I have created a condition that the value of i should not go above 100 and thirdly I have used the update process in which i value will be increased by 1 every time till the loop ends.&lt;br /&gt;Note*:Why we have initialized the value of i to 1?&lt;br /&gt;Ans:Because we have to print from 1 to 100.&lt;br /&gt;5.In the eighth line I have used the printing statement and printed the value of i(i.e;1 to 100).&lt;br /&gt;&lt;br /&gt;I hope that you have understand the program as well as concept.If you didn&#39;t understand either the program or the concept please inform us.&lt;br /&gt;Thank You.&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.whalecode.tk/feeds/2100422147050147701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.whalecode.tk/2019/02/for-loop.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/2100422147050147701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/2100422147050147701'/><link rel='alternate' type='text/html' href='http://www.whalecode.tk/2019/02/for-loop.html' title='for() loop'/><author><name>Piyush Vishwakarma</name><uri>http://www.blogger.com/profile/09177463607902668136</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//3.bp.blogspot.com/-zU8qR36jdt0/XJS0uwdV1LI/AAAAAAAAAPo/gHBVkXw78BU7dclwZuHFvtoeUJAlNIgXQCK4BGAYYCw/s1600/images%253Fq%253Dtbn%253AANd9GcSqYjXvgxRmmc74Hyk8PCtkAsj-hS54KSYHAF1C6a2pSbAiRP2D'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://3.bp.blogspot.com/-jbpUhT2NDl0/XG_-ds2XHAI/AAAAAAAAALE/384_4wFz1TkBJ9ZlPPKJmR5oRapko4i-gCLcBGAs/s72-c/for%2528%2529loop.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8177759477679540056.post-8755797928340545710</id><published>2019-02-15T05:38:00.004-08:00</published><updated>2019-02-23T07:51:11.511-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>ITERARTION STATEMENTS</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Sometimes we require that a statement(s) should be repeated upto certain time.To fulfill this task iteration statements are used.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;These statements covers for(), while() and do-while() functions.These iteration statements repeats set of instruction(s) upto a limit and terminates as soon as the condition is fulfilled.&lt;/blockquote&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://1.bp.blogspot.com/-FqAZ6jhTJBU/XHFr6nGc3XI/AAAAAAAAAMA/L1Yh3qI8uHcjsNXQ_bWIpEUJqJod2UzrQCLcBGAs/s1600/Easy%2BTo%2Blearn.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;900&quot; data-original-width=&quot;1600&quot; height=&quot;180&quot; src=&quot;https://1.bp.blogspot.com/-FqAZ6jhTJBU/XHFr6nGc3XI/AAAAAAAAAMA/L1Yh3qI8uHcjsNXQ_bWIpEUJqJod2UzrQCLcBGAs/s320/Easy%2BTo%2Blearn.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Iterations also called as Loops&lt;/div&gt;&lt;div&gt;Whenever we want to perform any operation(s) more than one time we use iteration/loop statements.&lt;/div&gt;&lt;div&gt;Any iteration/loop statement has 3 parts or parameters as its syntax namely:&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;a. Initial or starting value of the iteration/loop statement.&lt;/div&gt;&lt;div&gt;b.Ending or stopping condition of the iteration/loop statement.&lt;/div&gt;&lt;div&gt;c.Step increment/decrement value of the iteration/loop statement(also know as update statement).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The placement of the 3 parameters mentioned above change in the different iteration/loop statements&lt;/div&gt;&lt;div&gt;The loop statements are these types namely: for(), while() and do-while() loops.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.whalecode.tk/feeds/8755797928340545710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.whalecode.tk/2019/02/iterartion-statements.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/8755797928340545710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/8755797928340545710'/><link rel='alternate' type='text/html' href='http://www.whalecode.tk/2019/02/iterartion-statements.html' title='ITERARTION STATEMENTS'/><author><name>Piyush Vishwakarma</name><uri>http://www.blogger.com/profile/09177463607902668136</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//3.bp.blogspot.com/-zU8qR36jdt0/XJS0uwdV1LI/AAAAAAAAAPo/gHBVkXw78BU7dclwZuHFvtoeUJAlNIgXQCK4BGAYYCw/s1600/images%253Fq%253Dtbn%253AANd9GcSqYjXvgxRmmc74Hyk8PCtkAsj-hS54KSYHAF1C6a2pSbAiRP2D'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://1.bp.blogspot.com/-FqAZ6jhTJBU/XHFr6nGc3XI/AAAAAAAAAMA/L1Yh3qI8uHcjsNXQ_bWIpEUJqJod2UzrQCLcBGAs/s72-c/Easy%2BTo%2Blearn.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8177759477679540056.post-6076155055026554437</id><published>2019-02-14T18:20:00.000-08:00</published><updated>2019-02-23T21:18:35.790-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>Program of adding two Numbers.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Program&lt;/h3&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://1.bp.blogspot.com/-ml6jtdOXfnQ/XHIpHsUyKtI/AAAAAAAAAMU/r5RPWBB_iYcaG2Cz3bmyDzulcU7LT52DgCLcBGAs/s1600/Program%2Bto%2Badd%2Bto%2Bnumbers.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1123&quot; data-original-width=&quot;794&quot; src=&quot;https://1.bp.blogspot.com/-ml6jtdOXfnQ/XHIpHsUyKtI/AAAAAAAAAMU/r5RPWBB_iYcaG2Cz3bmyDzulcU7LT52DgCLcBGAs/s1600/Program%2Bto%2Badd%2Bto%2Bnumbers.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;Class add&lt;br /&gt;{&lt;br /&gt;public static void main(Strings args)&lt;br /&gt;{&lt;br /&gt;int a=2;&lt;br /&gt;int b=5;&lt;br /&gt;int c=a+b;&lt;br /&gt;System.out.println(&quot;The sum is:&quot;+c);&lt;br /&gt;}&lt;br /&gt;}//end of the class&amp;nbsp;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;Output:&lt;br /&gt;The sum is:7&amp;nbsp;&lt;/blockquote&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.whalecode.tk/feeds/6076155055026554437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.whalecode.tk/2019/02/how-to-add-two-numbers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/6076155055026554437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/6076155055026554437'/><link rel='alternate' type='text/html' href='http://www.whalecode.tk/2019/02/how-to-add-two-numbers.html' title='Program of adding two Numbers.'/><author><name>Piyush Vishwakarma</name><uri>http://www.blogger.com/profile/09177463607902668136</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//3.bp.blogspot.com/-zU8qR36jdt0/XJS0uwdV1LI/AAAAAAAAAPo/gHBVkXw78BU7dclwZuHFvtoeUJAlNIgXQCK4BGAYYCw/s1600/images%253Fq%253Dtbn%253AANd9GcSqYjXvgxRmmc74Hyk8PCtkAsj-hS54KSYHAF1C6a2pSbAiRP2D'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://1.bp.blogspot.com/-ml6jtdOXfnQ/XHIpHsUyKtI/AAAAAAAAAMU/r5RPWBB_iYcaG2Cz3bmyDzulcU7LT52DgCLcBGAs/s72-c/Program%2Bto%2Badd%2Bto%2Bnumbers.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8177759477679540056.post-8518756597941077276</id><published>2019-02-14T08:04:00.001-08:00</published><updated>2019-02-15T05:29:20.903-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>How to Install BlueJ</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h4&gt;Having downloaded your BlueJ you need to install it.&lt;/h4&gt;&lt;h4&gt;Follow the steps below to install BlueJ on your computer:&lt;/h4&gt;&lt;div&gt;&lt;div&gt;1.Double Click the file which you have downloaded.&lt;/div&gt;&lt;div&gt;2.After Clicking on it ,it will take to different window.Click on &quot;Run&quot;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://1.bp.blogspot.com/-AE-QzQo8qTI/XGWQfXh-jKI/AAAAAAAAAF0/CVxJYQhVFkg66vaiiGhP6cxUcqWDUgNrACLcBGAs/s1600/Run.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;345&quot; data-original-width=&quot;468&quot; height=&quot;235&quot; src=&quot;https://1.bp.blogspot.com/-AE-QzQo8qTI/XGWQfXh-jKI/AAAAAAAAAF0/CVxJYQhVFkg66vaiiGhP6cxUcqWDUgNrACLcBGAs/s320/Run.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;3.After Clicking on Run, a new window will open,Click on Next.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://2.bp.blogspot.com/-mHZHJKbyYQw/XGWQwFmu2BI/AAAAAAAAAF4/vg2EpmwrzXYx4Bi_QQWw7PMV8HOKwd0xQCLcBGAs/s1600/Next.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;389&quot; data-original-width=&quot;497&quot; height=&quot;250&quot; src=&quot;https://2.bp.blogspot.com/-mHZHJKbyYQw/XGWQwFmu2BI/AAAAAAAAAF4/vg2EpmwrzXYx4Bi_QQWw7PMV8HOKwd0xQCLcBGAs/s320/Next.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;4.After Clicking on Next, a new window will open,Click on Next.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://2.bp.blogspot.com/-wTi7-hVBn6Q/XGWQ1Gy6TMI/AAAAAAAAAGA/ChzuDZFfU80eWUNYH0wSwMSt37NRCvkfgCLcBGAs/s1600/Next2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;386&quot; data-original-width=&quot;494&quot; height=&quot;250&quot; src=&quot;https://2.bp.blogspot.com/-wTi7-hVBn6Q/XGWQ1Gy6TMI/AAAAAAAAAGA/ChzuDZFfU80eWUNYH0wSwMSt37NRCvkfgCLcBGAs/s320/Next2.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;5.After Clicking on Next, a new window will open,Choose your path where you want to Install The BlueJ and Click on Next.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://1.bp.blogspot.com/-7AGDEy-cM1s/XGWQ8lnSP9I/AAAAAAAAAGE/G_A39QRiDOU0q97_yviPCKVH1ajpULrrACLcBGAs/s1600/Selection%2BFolder.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;388&quot; data-original-width=&quot;493&quot; height=&quot;251&quot; src=&quot;https://1.bp.blogspot.com/-7AGDEy-cM1s/XGWQ8lnSP9I/AAAAAAAAAGE/G_A39QRiDOU0q97_yviPCKVH1ajpULrrACLcBGAs/s320/Selection%2BFolder.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;6.After Clicking on Next, a new window will open,it will ask you for creating Shortcuts,Click on Next.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://3.bp.blogspot.com/-LXDjEp2XgzI/XGWRBaM_wFI/AAAAAAAAAGM/wcbiPK3nvq0kIF2LgIFaQ1OfGcu1sw3gQCLcBGAs/s1600/Selection%2BFolder.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;388&quot; data-original-width=&quot;493&quot; height=&quot;251&quot; src=&quot;https://3.bp.blogspot.com/-LXDjEp2XgzI/XGWRBaM_wFI/AAAAAAAAAGM/wcbiPK3nvq0kIF2LgIFaQ1OfGcu1sw3gQCLcBGAs/s320/Selection%2BFolder.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;7.After Clicking on Next, a new window will open,Click on Install.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://1.bp.blogspot.com/-rRAlYO38818/XGWRJcXH99I/AAAAAAAAAGU/sYmmz3VkCqgtG2ZGUHQ9KqYcz8BsrhSYQCLcBGAs/s1600/Install.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;384&quot; data-original-width=&quot;495&quot; height=&quot;248&quot; src=&quot;https://1.bp.blogspot.com/-rRAlYO38818/XGWRJcXH99I/AAAAAAAAAGU/sYmmz3VkCqgtG2ZGUHQ9KqYcz8BsrhSYQCLcBGAs/s320/Install.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;8.After Clicking on Install,Click On Finish and your BlueJ will be install in your selected folder.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://4.bp.blogspot.com/-02eLebt-g6I/XGWRPM-j2tI/AAAAAAAAAGc/Vv9s70H6XccEkagCM_pJ91So4HwTx-qrQCLcBGAs/s1600/Finish.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;388&quot; data-original-width=&quot;494&quot; height=&quot;251&quot; src=&quot;https://4.bp.blogspot.com/-02eLebt-g6I/XGWRPM-j2tI/AAAAAAAAAGc/Vv9s70H6XccEkagCM_pJ91So4HwTx-qrQCLcBGAs/s320/Finish.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;*Note:If we have miss any step please inform us using contact Box.&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.whalecode.tk/feeds/8518756597941077276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.whalecode.tk/2019/02/how-to-install-bluej.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/8518756597941077276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/8518756597941077276'/><link rel='alternate' type='text/html' href='http://www.whalecode.tk/2019/02/how-to-install-bluej.html' title='How to Install BlueJ'/><author><name>Piyush Vishwakarma</name><uri>http://www.blogger.com/profile/09177463607902668136</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//3.bp.blogspot.com/-zU8qR36jdt0/XJS0uwdV1LI/AAAAAAAAAPo/gHBVkXw78BU7dclwZuHFvtoeUJAlNIgXQCK4BGAYYCw/s1600/images%253Fq%253Dtbn%253AANd9GcSqYjXvgxRmmc74Hyk8PCtkAsj-hS54KSYHAF1C6a2pSbAiRP2D'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://1.bp.blogspot.com/-AE-QzQo8qTI/XGWQfXh-jKI/AAAAAAAAAF0/CVxJYQhVFkg66vaiiGhP6cxUcqWDUgNrACLcBGAs/s72-c/Run.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8177759477679540056.post-84507781901349425</id><published>2019-02-13T02:25:00.001-08:00</published><updated>2019-02-23T21:22:26.797-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>Write Your First Program</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div style=&quot;text-align: left;&quot;&gt;In this section you will be able to know how write a Java Program.For Writing a Java Program we must have a Editor you can also use Notepad but here we will use BlueJ.&lt;br /&gt;So,Let&#39;s start our first program by using BlueJ:&lt;/div&gt;&lt;div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Before writing any Program we must know the Syntax(It&#39;s very important).&lt;/h3&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://3.bp.blogspot.com/-YvtFpFxjyNc/XHIpYZb7SrI/AAAAAAAAAMc/Z3FXPn3ykagj111GbcClWaQYI-xrZJraQCLcBGAs/s1600/Program%2Bto%2Badd%2Bto%2Bnumbers%2B%25281%2529.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1123&quot; data-original-width=&quot;794&quot; src=&quot;https://3.bp.blogspot.com/-YvtFpFxjyNc/XHIpYZb7SrI/AAAAAAAAAMc/Z3FXPn3ykagj111GbcClWaQYI-xrZJraQCLcBGAs/s1600/Program%2Bto%2Badd%2Bto%2Bnumbers%2B%25281%2529.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;Syntax:&lt;/blockquote&gt;&lt;div&gt;&lt;blockquote&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;class class_name&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;{&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;public static void main(String args[])&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;{&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Statements;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}//closing of the main method&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}//end of class&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Let&#39;s work on Program.Here we will learn how to print &quot;Hello World!This is my first Program in BlueJ&quot;.&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Program:&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;class Hello&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;public static void main(String args[])&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;System.out.println(&quot;Hello World!This is my first Program in BlueJ&quot;);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}//closing of the main method&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}//end of class&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Let&#39;s see the Output.&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Output:&lt;/div&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Hello World!This is my first Program in BlueJ&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.whalecode.tk/feeds/84507781901349425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.whalecode.tk/2019/02/write-your-first-program.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/84507781901349425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/84507781901349425'/><link rel='alternate' type='text/html' href='http://www.whalecode.tk/2019/02/write-your-first-program.html' title='Write Your First Program'/><author><name>Piyush Vishwakarma</name><uri>http://www.blogger.com/profile/09177463607902668136</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//3.bp.blogspot.com/-zU8qR36jdt0/XJS0uwdV1LI/AAAAAAAAAPo/gHBVkXw78BU7dclwZuHFvtoeUJAlNIgXQCK4BGAYYCw/s1600/images%253Fq%253Dtbn%253AANd9GcSqYjXvgxRmmc74Hyk8PCtkAsj-hS54KSYHAF1C6a2pSbAiRP2D'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://3.bp.blogspot.com/-YvtFpFxjyNc/XHIpYZb7SrI/AAAAAAAAAMc/Z3FXPn3ykagj111GbcClWaQYI-xrZJraQCLcBGAs/s72-c/Program%2Bto%2Badd%2Bto%2Bnumbers%2B%25281%2529.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8177759477679540056.post-8405916118039969924</id><published>2019-02-13T02:18:00.003-08:00</published><updated>2019-02-15T05:28:31.697-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>Working With BlueJ</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;After having installed your BlueJ(If you are not knowing,how to downlaod BlueJ,check our last post or click this link to know &lt;a href=&quot;https://leanoncode.blogspot.com/2019/02/about-bluej-and-how-to-download.html&quot;&gt;Last Post&lt;/a&gt;).&lt;/h4&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://2.bp.blogspot.com/-Cu7x0vjNla8/XGPvvh6WFQI/AAAAAAAAAFA/yBu9rjz2fQQ5qELOkJegVas2IueYa-2fQCLcBGAs/s1600/pexels-photo-1561914.jpeg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;750&quot; data-original-width=&quot;500&quot; height=&quot;320&quot; src=&quot;https://2.bp.blogspot.com/-Cu7x0vjNla8/XGPvvh6WFQI/AAAAAAAAAFA/yBu9rjz2fQQ5qELOkJegVas2IueYa-2fQCLcBGAs/s320/pexels-photo-1561914.jpeg&quot; width=&quot;213&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Follow the Steps Below to work on BlueJ and write your Programs:&lt;br /&gt;1.Open the BlueJ&lt;br /&gt;2.Click on File under file open you will see New Project option click on it.&lt;br /&gt;3.After clicking on it,it will ask you to save your project,select your path where you want to save your project.&lt;br /&gt;4.After selecting the path,write file name and click on save button or directly hit enter.&lt;br /&gt;5.After saving your project you will able to see New class on the left side of your window, click on it.&lt;br /&gt;6.After clicking on New Class,it will ask you to enter your class Name(Before entering the class name read the rules of writing the class name),Enter your class name and&lt;br /&gt;hit enter or click on &quot;Ok&quot; button.&lt;br /&gt;7.After clicking on it, it will take you to a different window.&lt;br /&gt;8.In this window you will be seeing on codes,just select all the code and press delete/backspace button.&lt;br /&gt;9.Start writing your program and Enjoy.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.whalecode.tk/feeds/8405916118039969924/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.whalecode.tk/2019/02/working-with-bluej.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/8405916118039969924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/8405916118039969924'/><link rel='alternate' type='text/html' href='http://www.whalecode.tk/2019/02/working-with-bluej.html' title='Working With BlueJ'/><author><name>Piyush Vishwakarma</name><uri>http://www.blogger.com/profile/09177463607902668136</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//3.bp.blogspot.com/-zU8qR36jdt0/XJS0uwdV1LI/AAAAAAAAAPo/gHBVkXw78BU7dclwZuHFvtoeUJAlNIgXQCK4BGAYYCw/s1600/images%253Fq%253Dtbn%253AANd9GcSqYjXvgxRmmc74Hyk8PCtkAsj-hS54KSYHAF1C6a2pSbAiRP2D'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://2.bp.blogspot.com/-Cu7x0vjNla8/XGPvvh6WFQI/AAAAAAAAAFA/yBu9rjz2fQQ5qELOkJegVas2IueYa-2fQCLcBGAs/s72-c/pexels-photo-1561914.jpeg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8177759477679540056.post-1784125531565500183</id><published>2019-02-13T02:15:00.001-08:00</published><updated>2019-02-15T05:28:13.947-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>About BlueJ and How to Download</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;In order to write any Program we should have a editor in which we can write our program.So, here will be using BlueJ.&lt;/h4&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;So,Firstly let&#39;s know how to download BlueJ.&lt;/h4&gt;Follow the step below to know how to download BlueJ and have your BlueJ(Editor):&lt;br /&gt;Open the official website of BlueJ&amp;nbsp;&lt;a href=&quot;https://www.bluej.org/&quot;&gt;Click Here(Official Website)&lt;/a&gt; and follow the instruction and have your BlueJ.&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://1.bp.blogspot.com/-NtaJSE_1xKM/XGPuQB-kCNI/AAAAAAAAAE0/wB_MS9JX8RQ9T75vuPSq9YsTRJMGVhZ8ACLcBGAs/s1600/java.jpeg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;750&quot; data-original-width=&quot;500&quot; height=&quot;320&quot; src=&quot;https://1.bp.blogspot.com/-NtaJSE_1xKM/XGPuQB-kCNI/AAAAAAAAAE0/wB_MS9JX8RQ9T75vuPSq9YsTRJMGVhZ8ACLcBGAs/s320/java.jpeg&quot; width=&quot;213&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.whalecode.tk/feeds/1784125531565500183/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.whalecode.tk/2019/02/about-bluej-and-how-to-download.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/1784125531565500183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/1784125531565500183'/><link rel='alternate' type='text/html' href='http://www.whalecode.tk/2019/02/about-bluej-and-how-to-download.html' title='About BlueJ and How to Download'/><author><name>Piyush Vishwakarma</name><uri>http://www.blogger.com/profile/09177463607902668136</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//3.bp.blogspot.com/-zU8qR36jdt0/XJS0uwdV1LI/AAAAAAAAAPo/gHBVkXw78BU7dclwZuHFvtoeUJAlNIgXQCK4BGAYYCw/s1600/images%253Fq%253Dtbn%253AANd9GcSqYjXvgxRmmc74Hyk8PCtkAsj-hS54KSYHAF1C6a2pSbAiRP2D'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://1.bp.blogspot.com/-NtaJSE_1xKM/XGPuQB-kCNI/AAAAAAAAAE0/wB_MS9JX8RQ9T75vuPSq9YsTRJMGVhZ8ACLcBGAs/s72-c/java.jpeg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8177759477679540056.post-954442003202635177</id><published>2019-02-12T06:44:00.001-08:00</published><updated>2019-02-23T21:23:46.908-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>Java Program-Structure</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;Every programming language requires sequence of instructions to fulfill a task in which some&lt;br /&gt;are optional and some are compulsory.The Java program needs following steps while writing&lt;br /&gt;a Java source code:&lt;/h4&gt;&lt;div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;Documentation Section&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Package statement&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Import statements&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Interface statements&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Main class&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; Data Declaration;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp; Main Method definition/method definitions&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&amp;nbsp;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}//end of the main method&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://4.bp.blogspot.com/-nFwdH0mUiQE/XHIqWAp58sI/AAAAAAAAAMo/R7bqdoYDmqoNduFVsZLCAIVdvZVSxGB6gCLcBGAs/s1600/Program%2Bto%2Badd%2Bto%2Bnumbers%2B%25282%2529.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1123&quot; data-original-width=&quot;794&quot; src=&quot;https://4.bp.blogspot.com/-nFwdH0mUiQE/XHIqWAp58sI/AAAAAAAAAMo/R7bqdoYDmqoNduFVsZLCAIVdvZVSxGB6gCLcBGAs/s1600/Program%2Bto%2Badd%2Bto%2Bnumbers%2B%25282%2529.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.whalecode.tk/feeds/954442003202635177/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.whalecode.tk/2019/02/java-program-structure.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/954442003202635177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/954442003202635177'/><link rel='alternate' type='text/html' href='http://www.whalecode.tk/2019/02/java-program-structure.html' title='Java Program-Structure'/><author><name>Piyush Vishwakarma</name><uri>http://www.blogger.com/profile/09177463607902668136</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//3.bp.blogspot.com/-zU8qR36jdt0/XJS0uwdV1LI/AAAAAAAAAPo/gHBVkXw78BU7dclwZuHFvtoeUJAlNIgXQCK4BGAYYCw/s1600/images%253Fq%253Dtbn%253AANd9GcSqYjXvgxRmmc74Hyk8PCtkAsj-hS54KSYHAF1C6a2pSbAiRP2D'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://4.bp.blogspot.com/-nFwdH0mUiQE/XHIqWAp58sI/AAAAAAAAAMo/R7bqdoYDmqoNduFVsZLCAIVdvZVSxGB6gCLcBGAs/s72-c/Program%2Bto%2Badd%2Bto%2Bnumbers%2B%25282%2529.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8177759477679540056.post-2869905195431716283</id><published>2019-02-12T06:41:00.001-08:00</published><updated>2019-02-15T05:27:45.365-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>Java Virtual Machine(JVM)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;A program written in any programming language must be compiled or interpreted in the form of&lt;br /&gt;machine language and after that the program is executed to produce the output.&lt;br /&gt;The combination of Java Virtual Machine and Java API(Application Program Interface) is treated&lt;br /&gt;as Java Working Platform.Actually Java API&#39;s are the libraries that consist of pre-processed&lt;br /&gt;codes(variables constants and functions )that a programmer uses to perform some specific task while&lt;br /&gt;writing a program.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;The following Describes the Steps involved from Java program writing to final run:&lt;/h4&gt;&lt;div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Java Program&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;Java Compiler&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;Java byte code&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;Java interpreter for system&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;final run and display of output&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://4.bp.blogspot.com/-M6cEPBrRkvk/XGLbFw-ujeI/AAAAAAAAAEM/pHv1t3SLz1AMhvF0G3sisvDoHB3Uq3cawCLcBGAs/s1600/beverage-coffee-computer-877695.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;961&quot; data-original-width=&quot;1600&quot; height=&quot;192&quot; src=&quot;https://4.bp.blogspot.com/-M6cEPBrRkvk/XGLbFw-ujeI/AAAAAAAAAEM/pHv1t3SLz1AMhvF0G3sisvDoHB3Uq3cawCLcBGAs/s320/beverage-coffee-computer-877695.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.whalecode.tk/feeds/2869905195431716283/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.whalecode.tk/2019/02/java-virtual-machinejvm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/2869905195431716283'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/2869905195431716283'/><link rel='alternate' type='text/html' href='http://www.whalecode.tk/2019/02/java-virtual-machinejvm.html' title='Java Virtual Machine(JVM)'/><author><name>Piyush Vishwakarma</name><uri>http://www.blogger.com/profile/09177463607902668136</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//3.bp.blogspot.com/-zU8qR36jdt0/XJS0uwdV1LI/AAAAAAAAAPo/gHBVkXw78BU7dclwZuHFvtoeUJAlNIgXQCK4BGAYYCw/s1600/images%253Fq%253Dtbn%253AANd9GcSqYjXvgxRmmc74Hyk8PCtkAsj-hS54KSYHAF1C6a2pSbAiRP2D'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://4.bp.blogspot.com/-M6cEPBrRkvk/XGLbFw-ujeI/AAAAAAAAAEM/pHv1t3SLz1AMhvF0G3sisvDoHB3Uq3cawCLcBGAs/s72-c/beverage-coffee-computer-877695.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8177759477679540056.post-2967637270245848878</id><published>2019-02-12T06:34:00.000-08:00</published><updated>2019-02-22T06:39:55.019-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>Feautres of Java</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;The following are some common features of Java:&lt;/h4&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://2.bp.blogspot.com/-RciYJRb3950/XHAJm5wS-xI/AAAAAAAAALs/PpgnkPkVIoUu0ni9YyTMa-mxVjtv2aJ6gCLcBGAs/s1600/for%2528%2529loop%2B%25282%2529.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;720&quot; data-original-width=&quot;1280&quot; src=&quot;https://2.bp.blogspot.com/-RciYJRb3950/XHAJm5wS-xI/AAAAAAAAALs/PpgnkPkVIoUu0ni9YyTMa-mxVjtv2aJ6gCLcBGAs/s1600/for%2528%2529loop%2B%25282%2529.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Object Oriented&lt;/li&gt;&lt;li&gt;Platform- Independent and portable&lt;/li&gt;&lt;li&gt;Distributed&lt;/li&gt;&lt;li&gt;Compiled and Interpreted&amp;nbsp;&lt;/li&gt;&lt;li&gt;Small and Simple programming concepts&lt;/li&gt;&lt;li&gt;Security&lt;/li&gt;&lt;li&gt;High Performance&lt;/li&gt;&lt;li&gt;Dynamic and Extensible&lt;/li&gt;&lt;li&gt;Multithreaded and interactive&lt;/li&gt;&lt;li&gt;Robust&lt;/li&gt;&lt;li&gt;Worm (Write Once Read Many)&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.whalecode.tk/feeds/2967637270245848878/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.whalecode.tk/2019/02/feautres-of-java.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/2967637270245848878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/2967637270245848878'/><link rel='alternate' type='text/html' href='http://www.whalecode.tk/2019/02/feautres-of-java.html' title='Feautres of Java'/><author><name>Piyush Vishwakarma</name><uri>http://www.blogger.com/profile/09177463607902668136</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//3.bp.blogspot.com/-zU8qR36jdt0/XJS0uwdV1LI/AAAAAAAAAPo/gHBVkXw78BU7dclwZuHFvtoeUJAlNIgXQCK4BGAYYCw/s1600/images%253Fq%253Dtbn%253AANd9GcSqYjXvgxRmmc74Hyk8PCtkAsj-hS54KSYHAF1C6a2pSbAiRP2D'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://2.bp.blogspot.com/-RciYJRb3950/XHAJm5wS-xI/AAAAAAAAALs/PpgnkPkVIoUu0ni9YyTMa-mxVjtv2aJ6gCLcBGAs/s72-c/for%2528%2529loop%2B%25282%2529.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8177759477679540056.post-8544775437597320885</id><published>2019-02-12T06:27:00.000-08:00</published><updated>2019-03-28T07:31:02.505-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>Introduction To Java &amp; It&#39;s History</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;It is a very popular programming language of third generation.It can perform various tasks as other Programming Language&lt;br /&gt;including internet and intranet applications. This language also helps to manage networks.&lt;br /&gt;It can be treated as a platform to various applications.&lt;br /&gt;&lt;br /&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;History&lt;/b&gt;&lt;/h3&gt;&lt;br /&gt;Java is general purpose object oriented programming language as well as a platform to perform various tasks related to programming and World Wide Web(WWW) applications.&lt;br /&gt;Read Below to know the development of Java Language with to Years.&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://4.bp.blogspot.com/-9caTFxmk0cg/XJzaV8AKH9I/AAAAAAAAAQU/O4S_fgW1zXk5UUn4QcThqnG73x5yU-zhACLcBGAs/s1600/Intro.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;720&quot; data-original-width=&quot;1280&quot; height=&quot;112&quot; src=&quot;https://4.bp.blogspot.com/-9caTFxmk0cg/XJzaV8AKH9I/AAAAAAAAAQU/O4S_fgW1zXk5UUn4QcThqnG73x5yU-zhACLcBGAs/s200/Intro.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;In 1990,there was a need of software to manipulate consumer electronic devices and the engineers of Sun Microsoft has decided to develope this software.&lt;br /&gt;In 1991,A programming language &quot;Oak&quot; was Introduced by the team of the software engineers headed by James Gosling.&lt;br /&gt;In 1992,The team of engineers demonstrated the programming language to handle electronic devices.&lt;br /&gt;In 1993,The World Wide Web applications were in use and the team has planned to develop small program(Applets)that can be executed through the computers that are connected to internet.&lt;br /&gt;In 1994,The team has developed a web browser by the name Hot Java to run applet programs on internet.&lt;br /&gt;In 1995,Java Language were announced after renaming Oak.Other companies like Microsoft and Netscape has announced their support to Java.&lt;br /&gt;In 1996,Now Java has become a very popular for object oriented programming language as well as for internet programming. Launch of Java Development Kit(JDK) 1.0 version.&lt;br /&gt;In 1997,Launch of Java Development Kit(JDK) 1.1 version with API (Applicaion Program Interface)&lt;br /&gt;In 1998,Lanch of Java Development Kit(JDK) 1.2 version and Sun produces JDK 1.2 for Linux.&lt;br /&gt;From 1999-2003,JDK 1.3 version released and some other Java softwares like J2EE (Java 2 Enterprise Edition),J2ME (Java 2 Micro Edition),J2SE (Java 3 Standard Edition) and&lt;br /&gt;also release of Java^TM Web Service Developer Pack.&lt;br /&gt;From 2004-2007,Other releases like Java 2 Platform,Standard Edition 5,Sun Java Studio Creator and Net Beans IDE 5.0 etc.&lt;br /&gt;(copywright)Computer Applications CLASS Xth.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.whalecode.tk/feeds/8544775437597320885/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.whalecode.tk/2019/02/introduction-to-java-its-history.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/8544775437597320885'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8177759477679540056/posts/default/8544775437597320885'/><link rel='alternate' type='text/html' href='http://www.whalecode.tk/2019/02/introduction-to-java-its-history.html' title='Introduction To Java &amp; It&#39;s History'/><author><name>Piyush Vishwakarma</name><uri>http://www.blogger.com/profile/09177463607902668136</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//3.bp.blogspot.com/-zU8qR36jdt0/XJS0uwdV1LI/AAAAAAAAAPo/gHBVkXw78BU7dclwZuHFvtoeUJAlNIgXQCK4BGAYYCw/s1600/images%253Fq%253Dtbn%253AANd9GcSqYjXvgxRmmc74Hyk8PCtkAsj-hS54KSYHAF1C6a2pSbAiRP2D'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://4.bp.blogspot.com/-9caTFxmk0cg/XJzaV8AKH9I/AAAAAAAAAQU/O4S_fgW1zXk5UUn4QcThqnG73x5yU-zhACLcBGAs/s72-c/Intro.jpg" height="72" width="72"/><thr:total>0</thr:total></entry></feed>