<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Damitha karunarathne on Medium]]></title>
        <description><![CDATA[Stories by Damitha karunarathne on Medium]]></description>
        <link>https://medium.com/@nkdamitha?source=rss-1cc1570d1a1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*Gt7g_Lszj3I3ptytEgbTsQ.jpeg</url>
            <title>Stories by Damitha karunarathne on Medium</title>
            <link>https://medium.com/@nkdamitha?source=rss-1cc1570d1a1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 19:52:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nkdamitha/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Let us create a Simple Food Order form by using HTML ,CSS and javaScript]]></title>
            <link>https://nkdamitha.medium.com/let-us-create-a-simple-food-order-form-by-using-html-css-and-javascript-dfb9f25e5e12?source=rss-1cc1570d1a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/dfb9f25e5e12</guid>
            <category><![CDATA[js]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Damitha karunarathne]]></dc:creator>
            <pubDate>Thu, 18 Feb 2021 14:29:22 GMT</pubDate>
            <atom:updated>2021-02-18T14:29:22.694Z</atom:updated>
            <content:encoded><![CDATA[<h3>Let us create a Simple Food Order form by using HTML ,CSS and javaScript</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*noM8i-3j8chg6k6URtEjsA.jpeg" /></figure><p>Hello guys, this article shows you how can we make a simple food ordering web page by using HTML ,CSS and javaScript.Here I used checkbox,textarea,button,paragrapgh and option by using HTML and added colours,font styles ,padding and alignment by using CSS Styles.Also to have alerts,validations,final calculations and to get data for the backend javaScript language is used.</p><h4>First let us consider HTML and css part of this form.</h4><p>This is a simple food ordering form.The Items with the pricelist shows at the begining. You can select any branch from the given branches where you prefer to order.You have to simply provide the Name and the telephone number in appropriate places.Buyer can select at least 4 items which are available in food-shop with quantities(According to form here I mentioned 4 items,if want more items options can be added to select).After seeing pricelist buyer can either submit it or clear.</p><p>This is how we are going to implement it with HTML and CSS.We are going to implement this web page according to the following diagram.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d-jrDE5MknwRt6_-yXC6gA.png" /></figure><p>First I am going to implement the css part which supports to beautify the form.We can use notepad or notepad++ as a text-editor.The border,colour styles,Font styles to the form, all are added via css styles.Following code shows how we use css styles to this form.</p><pre>th{<br>    text-align:left;<br>    <br><br>}<br><br>body{<br>font-size: 20pt;<br><br>}<br><br>.button {<br>    background-color: #4CAF50; /* Green */<br>    border: none;<br>    color: white;<br>    padding: 15px 32px;<br>    text-align: center;<br>    text-decoration: none;<br>    display: inline-block;<br>    font-size: 16px;<br>  }<br><br>  div {<br>    text-align: center;<br>    border-style: solid;<br>    margin-left: 300px;<br>    width:60%<br>}<br>#alignment{<br>    margin-left: auto;<br>    margin-right: auto;<br><br>}</pre><p>The css web page we are saving as “Styles.css” as an external file type.Here all the styles that should added to the web-page added via css file. Therefore we can simply edit and do prferences. A good look to the form comes via css styles.As I told text-align,font-size,background-color,border,padding,margin all are done by this css style.</p><p>There after here we enter to the HTML file, where the whole body of the form includes.Every html file opens with &lt;html&gt; tag and ends with the html close tag&lt;/html&gt;.</p><pre>&lt;html&gt; <br>&lt;head&gt;<br>&lt;title&gt;FOOD ORDER FORM&lt;/title&gt;<br>&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;<a href="https://medium.com/formCssFile.css">formCssFile.css</a>&quot;&gt;<br>&lt;script type=&quot;text/javascript&quot; src=&quot;<a href="https://medium.com/scriptfile.js">scriptfile.js</a>&quot;&gt;  &lt;/script&gt; &lt;/head&gt;<br>&lt;/html &gt;</pre><p>After&lt;html&gt; tag, we use &lt;head&gt; tag what we use before &lt;body&gt; tag.Here with in &lt;head&gt; tag we link the css file and javaScript file to the html file. By using &lt;link href&gt;we link the css File .We use &lt;script src&gt;to link the javaScript file.</p><pre>&lt;body &gt;  <br>&lt;div&gt; <br>&lt;h2&gt;==========Price list==========&lt;/h2&gt; <br></pre><p>Before close the &lt;/html&gt; tag ,after &lt;/head&gt; we apply &lt;body&gt; tag where all the body of the form include.At the begining of the &lt;body&gt;here we use &lt;div&gt; to make the devisions of content in the webpage. with in header tag&lt;h2&gt; we can write topics.Here I have written “Price List” between &lt;h2&gt; tags,and that’s the reason we can see it in large and bolded letters.</p><pre>&lt;table width=&quot;40%&quot; id=&quot;alignment&quot; &gt; <br>&lt;tr&gt;  <br>&lt;th&gt;Food Item&lt;/th&gt; <br>&lt;th&gt;&lt;/th&gt;<br>&lt;th&gt;Price(Rs.)&lt;/th&gt;<br>&lt;/tr&gt; </pre><pre>&lt;tr&gt;<br>&lt;td&gt;Chicken pizza&lt;/td&gt; <br>&lt;td&gt; - &lt;/td&gt;<br>&lt;td&gt;700.00&lt;/td&gt; <br>&lt;/tr&gt; </pre><pre>&lt;tr&gt;<br>&lt;td&gt;Vegetable Pizza&lt;/td&gt;<br>&lt;td&gt; - &lt;/td&gt; <br>&lt;td&gt;500.00&lt;/td&gt; <br>&lt;/tr&gt;</pre><pre>&lt;tr&gt; <br>&lt;td&gt;Chiken Kottu&lt;/td&gt;<br>&lt;td&gt; - &lt;/td&gt;  <br>&lt;td&gt;300.00&lt;/td&gt;<br>&lt;/tr&gt; </pre><pre>&lt;tr&gt;  <br>&lt;td&gt;Vegetable Kottu &lt;/td&gt;<br>&lt;td&gt; - &lt;/td&gt; <br>&lt;td&gt;200.00&lt;/td&gt; <br>&lt;/tr&gt;  </pre><pre>&lt;tr&gt;<br>&lt;td&gt;Water Bottle&lt;/td&gt;<br>&lt;td&gt; - &lt;/td&gt; <br>&lt;td&gt;70.00&lt;/td&gt;<br>&lt;/tr&gt;<br>&lt;/table&gt;</pre><p>To make this form I have created a table.In side the table here we created the pricelist with fooditem and price.table tag opens with &lt;table&gt; and ends with &lt;/table&gt;.Each and every row of a table starts with a &lt;tr&gt;tag and ends with &lt;/tr&gt;.Here I did not use a table border.If I did there you can see a table border.We write table head via &lt;th&gt; tag and ends with &lt;/th&gt;.We use in side of the&lt;th&gt; what we want to highlight.We use &lt;td&gt; tag what we want to include inside of the table furthur.Here “ Food Item” and the “Price(Rs)” have written with in &lt;th&gt; tag and we can see them in bold letters.</p><p>Here let us see what we have implemented in our food ordering web page up to now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CG8pAO4jOmOyGzi7elrVbw.png" /></figure><pre>&lt;h&gt;FIT Food - Order Form&lt;/h1&gt;<br>&lt;table style=&quot;background-color:aquamarine;margin-left: 100px;&quot;&gt;  &lt;tr&gt;<br>&lt;td&gt;Branch : &lt;/td&gt;<br>&lt;td&gt; <br>&lt;select&gt; <br>&lt;option&gt;--Select Item--&lt;/option&gt;<br>&lt;option&gt;Galle&lt;/option&gt;<br>&lt;option&gt;Colombo&lt;/option&gt; <br>&lt;/select&gt;<br>&lt;/td&gt; <br>&lt;/tr&gt;<br>&lt;tr&gt;<br>&lt;td&gt;User name:&lt;/td&gt;<br>&lt;td&gt;<br>&lt;input type=&quot;text&quot; &gt;<br>&lt;/td&gt;<br>&lt;/tr&gt;<br>&lt;tr&gt;&lt;td&gt;Mobile: &lt;/td&gt;<br>&lt;td&gt;&lt;input type=&quot;text&quot; id=&quot;mblenmb&quot; onfocusout=&quot;checkmob()&quot;&gt;&lt;/td&gt;&lt;/tr&gt; <br>&lt;/table&gt;<br>&lt;br&gt;</pre><p>Here I wrote the main topic of the web page as “FIT Food- Order Form” with in &lt;h&gt; tag.Here I added option method where we can select the branch.&lt;option&gt;tag use inbetween&lt;select&gt; tag. Any option can be given and we can select the option as per our requirenments.Here I created another table because it is easy to mange the content in side a table.User name and the Mobile phone number also should be provided.Following figure shows the implemented part we have done up to now and there you can see how to select the branch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jx_rhTfF_IyVwZu5Kx6nCQ.png" /></figure><p>Now let us see how can we see the form after completing.We have to supply our name and the Mobile number.The backgroud color of the table visible due to css style.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rd41jC3rcf3_opmP2Zmq7g.png" /></figure><p>Now let us apply food items, price of a selected item and the quantity.Here also I have given option value to select the Items what we want. This also I have created inside of a &lt;table&gt; as I can manage it easily rather than keep spacing.Here I have given a name to the form as “tblform”.</p><pre>&lt;form name=&quot;tblform&quot; &gt;<br>&lt;table width=&quot;80%&quot;  id=&quot;alignment&quot; &gt;<br>&lt;tr&gt;<br>&lt;th&gt;Food Item&lt;/th&gt;<br>&lt;th&gt; &lt;/th&gt;<br>&lt;th&gt;Quantity&lt;/th&gt;<br>&lt;th&gt;Price&lt;/th&gt; <br>&lt;/tr&gt;</pre><pre>&lt;tr&gt; <br>&lt;td&gt;Item 1:&lt;/td&gt; <br>&lt;td&gt;<br>&lt;select id=&quot;item1&quot;&gt;<br>&lt;option value=&quot;1&quot;&gt;--Select Item--&lt;/option&gt; <br>&lt;option value=&quot;Chicken pizza&quot;&gt;Chicken pizza&lt;/option&gt; <br>&lt;option value=&quot;Vegetable Pizza&quot;&gt;Vegetable Pizza&lt;/option&gt; <br>&lt;option value=&quot;Chicken Kottu&quot;&gt;Chicken Kottu&lt;/option&gt; <br>&lt;option value=&quot;Vegetable Kottu&quot;&gt;Vegetable Kottu&lt;/option&gt; <br>&lt;option value=&quot;Water Bottle &quot;&gt;Water Bottle &lt;/option&gt; <br>&lt;/select&gt;<br>&lt;/td&gt; <br>&lt;td&gt;&lt;input type=&quot;number&quot; value=&quot;0&quot; id=&quot;q1&quot;&gt;&lt;/td&gt;<br>&lt;td&gt;&lt;input type=&quot;text&quot; id=&quot;p1&quot;&gt;&lt;/td&gt;<br>&lt;/tr&gt;   </pre><pre>&lt;tr&gt;<br>&lt;td&gt;Item 2:&lt;/td&gt;<br>&lt;td&gt;<br>&lt;select id=&quot;item2&quot;&gt; <br>&lt;option value=&quot;1&quot;&gt;--Select Item--&lt;/option&gt; <br>&lt;option value=&quot;Chicken pizza&quot;&gt;Chicken pizza&lt;/option&gt; <br>&lt;option value=&quot;Vegetable Pizza&quot;&gt;Vegetable Pizza&lt;/option&gt; <br>&lt;option value=&quot;Chicken Kottu&quot;&gt;Chicken Kottu&lt;/option&gt;  <br>&lt;option value=&quot;Vegetable Kottu&quot;&gt;Vegetable Kottu&lt;/option&gt;<br>&lt;option value=&quot;Water Bottle &quot;&gt;Water Bottle &lt;/option&gt;  <br>&lt;/select&gt;<br>&lt;/td&gt;<br>&lt;td&gt;&lt;input  type=&quot;number&quot; value=&quot;0&quot; id=&quot;q2&quot;&gt;&lt;/td&gt;  <br>&lt;td&gt;&lt;input type=&quot;text&quot;  id=&quot;p2&quot;&gt;&lt;/td&gt;  <br>&lt;/tr&gt; </pre><pre>&lt;tr&gt;<br>&lt;td&gt;Item 3:&lt;/td&gt;<br>&lt;td&gt;&lt;select id=&quot;item3&quot;&gt;  <br>&lt;option value=&quot;1&quot;&gt;--Select Item--&lt;/option&gt; <br>&lt;option value=&quot;Chicken pizza&quot;&gt;Chicken pizza&lt;/option&gt;  <br>&lt;option value=&quot;Vegetable Pizza&quot;&gt;Vegetable Pizza&lt;/option&gt; <br>&lt;option value=&quot;Chicken Kottu&quot;&gt;Chicken Kottu&lt;/option&gt;<br>&lt;option value=&quot;Vegetable Kottu&quot;&gt;Vegetable Kottu&lt;/option&gt; <br>&lt;option value=&quot;Water Bottle &quot;&gt;Water Bottle &lt;/option&gt; <br>&lt;/select&gt;<br>&lt;/td&gt;<br>&lt;td&gt;&lt;input type=&quot;number&quot; value=&quot;0&quot; id=&quot;q3&quot;&gt;&lt;/td&gt;<br>&lt;td&gt;&lt;input type=&quot;text&quot;  id=&quot;p3&quot;&gt;&lt;/td&gt; <br>&lt;/tr&gt; </pre><pre>&lt;tr&gt;<br>&lt;td&gt;Item 4:&lt;/td&gt;<br>&lt;td&gt;&lt;select id=&quot;item4&quot;&gt;   <br>&lt;option value=&quot;1&quot;&gt;--Select Item--&lt;/option&gt; <br>&lt;option value=&quot;Chicken pizza&quot;&gt;Chicken pizza&lt;/option&gt;   <br>&lt;option value=&quot;Vegetable Pizza&quot;&gt;Vegetable Pizza&lt;/option&gt; <br>&lt;option value=&quot;Chicken Kottu&quot;&gt;Chicken Kottu&lt;/option&gt; <br>&lt;option value=&quot;Vegetable Kottu&quot;&gt;Vegetable Kottu&lt;/option&gt; <br>&lt;option value=&quot;Water Bottle &quot;&gt;Water Bottle &lt;/option&gt;   <br>&lt;/select&gt;<br>&lt;/td&gt;<br>&lt;td&gt;&lt;input type=&quot;number&quot; value=&quot;0&quot; id=&quot;q4&quot;&gt;&lt;/td&gt;<br>&lt;td&gt;&lt;input type=&quot;text&quot;  id=&quot;p4&quot;&gt;&lt;/td&gt; <br>&lt;/tr&gt;    </pre><pre>&lt;tr&gt;<br>&lt;td&gt;&lt;/td&gt; <br>&lt;td&gt;&lt;/td&gt; <br>&lt;td&gt;&lt;input type=&quot;submit&quot; class=&quot;button&quot; value=&quot;Create Bill&quot; onclick=createBill()&gt;&lt;/td&gt;<br>&lt;td&gt;&lt;input type=&quot;reset&quot; class=&quot;button&quot; value=&quot;Clear&quot;&gt;&lt;/td&gt;<br>&lt;/tr&gt;<br>&lt;/table&gt;<br>&lt;/form&gt;</pre><p>Here I have given an input type called “submit” to submit the orders after we have done.Also here we can clear what we have ordered.For this I have put input type called “reset”.Following figure shows you the output of the form according to above code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QY81l7kBo-AK-BmYs263gg.png" /></figure><p>So this is end of the interface of our simple web page. It is a food order form. We can simply use HTML,CSS and make more creative web pages like this.It is easy and free for both customer and for the buyer.Now let us see how we used javaScript for our “FIT-Food order form”. We can use notepad or notepad++ as text editor.</p><h4>Now let us see how we used javaScript to this food order form</h4><pre>function checkmob(){<br>			var str=document.getElementById(&quot;mblenmb&quot;).value;<br>	var ptr=/^07[072568][0-9]{7}$/;<br>	<br>	var chck=ptr.test(str);<br>	<br>	if(!chck)<br>	alert(&quot;Moblie Number is Incorrect&quot;);<br>}</pre><p>To check whether the given telephone number is correct or not we have implemented a validation part in javaScript.Here first two numbers of telephone number should be start with 07, and the third letter should be 0,7,2,5,6 or 8.And the other 7 letters can be any numbers between 0 to 9.If we have entered a wrong mobile number,An alert message comes as follows.There we can see ,</p><p>“This page says</p><p>Mobile Number is Incorrect”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3hEFuiKWenkJo2PYg4zXWw.png" /></figure><pre><br>function createBill(){</pre><pre>var index=0;<br>var items = [&quot;null&quot;, &quot;null&quot;, &quot;null&quot;,&quot;null&quot;];<br>var quantities = [&quot;null&quot;, &quot;null&quot;, &quot;null&quot;,&quot;null&quot;];<br>var prices = [&quot;null&quot;, &quot;null&quot;, &quot;null&quot;,&quot;null&quot;];<br>						<br>						<br>						<br>var e1 = document.getElementById(&quot;item1&quot;);<br>var itemselected1 = e1.options[e1.selectedIndex].value;<br>if(itemselected1!=&quot;1&quot;){<br>items[index]=itemselected1;<br>quantities[index] = document.getElementById(&quot;q1&quot;).value;<br>prices[index] = document.getElementById(&quot;p1&quot;).value;<br>index++;<br>}<br>			<br><br>var e2 = document.getElementById(&quot;item2&quot;);<br>var itemselected2 = e2.options[e2.selectedIndex].value;<br>if(itemselected2!=&quot;1&quot;){<br>items[index]=itemselected2;<br>quantities[index] = document.getElementById(&quot;q2&quot;).value;<br>prices[index] = document.getElementById(&quot;p2&quot;).value;<br>index++;<br>}<br><br>var e3 = document.getElementById(&quot;item3&quot;);<br>var itemselected3 = e3.options[e3.selectedIndex].value;<br>if(itemselected3!=&quot;1&quot;){<br>items[index]=itemselected3;<br>quantities[index] = document.getElementById(&quot;q3&quot;).value;<br>prices[index] = document.getElementById(&quot;p3&quot;).value;<br>index++;<br>}<br><br>var e4 = document.getElementById(&quot;item4&quot;);<br>itemselected4 = e4.options[e4.selectedIndex].value;<br>if(itemselected4!=&quot;1&quot;){<br>items[index]=itemselected4;<br>quantities[index] = document.getElementById(&quot;q4&quot;).value;<br>prices[index] = document.getElementById(&quot;p4&quot;).value;<br>index++;<br>}<br><br>var fTot=0;<br>strt(1);<br>for(var i=0;i&lt;index;i++){<br>document.write(&quot;&lt;tr&gt;&quot;);<br>createtbl(items[i]);<br>createtbl(quantities[i]);<br>createtbl(prices[i]);<br>var tot=parseInt(quantities[i])*parseInt(prices[i]);<br>document.write(&quot;&lt;td&gt;&quot;+tot+&quot;&lt;/td&gt;&quot;);<br>fTot+=tot;<br>document.write(&quot;&lt;/tr&gt;&quot;);<br>}</pre><pre>document.write(&quot;&lt;tr&gt;&lt;td colspan=\&quot;3\&quot;&gt;&lt;strong&gt;TOTAL&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&quot;+fTot+&quot;&lt;/td&gt;&lt;tr&gt;&quot;);<br>strt(2);	<br>}</pre><pre>function createtbl(x){		<br>document.write(&quot;&lt;td&gt;&quot;+x+&quot;&lt;/td&gt;&quot;);<br>}<br><br>function strt(n){<br>if(n==1){<br>document.writeln(&quot;&lt;h1 style=\&quot;text-align:center;\&quot;&gt;The Bill&lt;/h1&gt;&quot;);<br>document.writeln(&quot;&lt;table width=\&quot;90%\&quot; border=\&quot;1\&quot;&gt;&quot;);<br>document.writeln(&quot;&lt;tr&gt;&lt;th&gt;ITEMS&lt;/th&gt;&lt;th&gt;QUANTITY&lt;/th&gt;&lt;th&gt;PRICE&lt;/th&gt;&lt;th&gt;&lt;/th&gt;&lt;/tr&gt;&quot;);<br>}<br>	else<br>	document.write(&quot;&lt;/table&gt;&quot;);<br>}<br><br>function createTot(x,y){<br>var tot=parseInt(x)*parseInt(y);<br>document.write(&quot;&lt;td&gt;&quot;+tot+&quot;&lt;/td&gt;&quot;);<br>}</pre><p>Above javaScript code shows the furthur implementations of our form.Here get input parameters from the user and pass them to the backend of the form.Calculation parts of the form done via this javaScript part.</p><p>Following figure shows you how to fill the form. We can select any food item given in the form with number of quantity and the price.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P6HmLIQKCoTMIeOwNNSFaw.png" /></figure><p>After we submit Create Bill option,we can see bill is created as following diagram.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hkVoYGsDWRSkfeBRZBpcZw.png" /></figure><p>Finally we can receive the bill.The bill is created with javaScript programming.When we enter input ,the output of the bill comes as above.</p><h4>Here let us see , how another programme works by using PHP.</h4><p>This part shows you how we get data from the PHP server.The user interface of this form have created by using html and css.Backend has developed with PHP. PHP is an another server side programming language that is embedded in html.It is used to manage database.PHP scripts are executed in PHP server.</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>&lt;meta charset=&quot;utf-8&quot;&gt;<br>&lt;title&gt;Contract form tutorial&lt;/title&gt;<br>&lt;link href=&quot;https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700&quot; rel=&quot;stylesheet&quot;&gt;<br>&lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot;&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>&lt;main&gt;<br>&lt;p&gt;Send E-mail&lt;/p&gt;<br>&lt;form class=&quot;contact-form&quot; action=&quot;contactform.php&quot; method=&quot;post&quot;&gt;</pre><pre>&lt;input type=&quot;text&quot; name=&quot;name&quot; placeholder=&quot;Full name&quot;&gt;<br>&lt;input type=&quot;text&quot; name=&quot;mail&quot; placeholder=&quot;Your email&quot;&gt;<br>&lt;input type=&quot;text&quot; name=&quot;subject&quot; placeholder=&quot;Subject&quot;&gt;<br>&lt;textarea name=&quot;message&quot; placeholder=&quot;message&quot;&gt;&lt;/textarea&gt;<br>&lt;button type=&quot;submit&quot; name=&quot;submit&quot;&gt;Send mail&lt;/button&gt;</pre><pre>&lt;/form&gt;</pre><pre>&lt;/main&gt;<br>&lt;/body&gt;</pre><pre>&lt;/html&gt;</pre><p>This form is created by using html and css.And the out put of the above form is as below.To connect it to the PHP server,POST method is used. There are mainly two types of methods called GET and POST.POST method is the most common method that often use. POST method is used here to send the data to the server.POST method is more secure than GET method.The action is “contactform.php”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*egB87FnBEURFnbimGwvVcQ.png" /></figure><p>Now let us create PHP contact form for the above form.Here also we can use notepad++ as the text editor.Here you can see all the inputs send to the server with POST method.PHP script opens with &lt;?php and ends with?&gt;.A PHP File is save as a .php file.</p><pre>&lt;?php<br>if (isset($_POST[&#39;submit&#39;])){<br>$name=$_POST[&#39;name&#39;];<br>$subject=$_POST[&#39;subject&#39;];<br>$mailFrom=$_POST[&#39;mail&#39;];<br>$message=$_POST[&#39;message&#39;];</pre><pre>$mailTo=&quot;dani@mmtuts.net&quot;;<br>$headers=&quot;From: &quot;.$mailFrom;<br>$txt=&quot;You have received an email from&quot;.$name.&quot;.\n\n&quot;.$message;</pre><pre>mail($mailTo,$subject,$txt,$headers);<br>header(&quot;Location:index.php?mailsend&quot;);<br></pre><pre>}</pre><p>Now let us fill above form as below diagram.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*BFl_-3M0_Y6KA24pcD_Fgg.png" /></figure><p>Now after submitting SEND MAIL button, the datails that entered by the user goes to the backend. This is happened via &lt;form class=”contact-form” action=”contactform.php” method=”post”&gt; in the html file. The data we input and the backend connected via this POST method.</p><p>So thank you guys for reading my article about how to create a food order form by using HTML and CSS.Here I have supplied you the sample code and the output of each code.Try this out.Hope you guys enjoy and got an knowledge regarding with html,css and PHP.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dfb9f25e5e12" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Loops(part1)]]></title>
            <link>https://nkdamitha.medium.com/loops-part1-44d909dd9ee9?source=rss-1cc1570d1a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/44d909dd9ee9</guid>
            <category><![CDATA[simple]]></category>
            <category><![CDATA[for]]></category>
            <category><![CDATA[loop]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Damitha karunarathne]]></dc:creator>
            <pubDate>Sun, 31 May 2020 16:59:25 GMT</pubDate>
            <atom:updated>2020-05-31T16:59:25.635Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*me8zL3QQ2LupTRWjGipc7w.jpeg" /></figure><p>Hi readers!!! Hope you read out my previous articles which were all about Java programming languages.This is my eight article and I am going to discuss here about loops in Java.Mainly here I am going to discuss about for loop from this article and I may go further about loops with in next articles.</p><h4>Loops in Java</h4><p>Loops are handy in cases in which you want to run the same code repeatedly, adding a different value each time.Java has three types of loops: <strong>for</strong>, <strong>while</strong>, and <strong>do while</strong>.</p><h3>for loop</h3><p>The <strong>for </strong>loop is commonly used when creating a loop.</p><pre>for ( initialization ; condition ; iteration))<br> {<br>   code block to be executed<br>}</pre><p>Ex:1</p><pre>public class ThirdProgram{<br>    public static void main(String args[]){</pre><pre>for (int a = 1; a &lt;= 10; a++)</pre><pre>System.out.println(a + &quot;\n&quot;);<br>    <br>    } <br>    }<br>//out put as follow<br>1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10</pre><p>Also above loop can be written as below,initialization is optional, and can be omitted, if your values are set before the loop starts.In here we get same result as above</p><pre>int a=1;<br>for(;a&lt;=10;a++)</pre><p>Also we can write above statement as below.Iteration can be omitted if you increment your values inside the loop.</p><pre>int i = 0;<br>for (; i &lt; 10; ) {<br>System.out.println(i);<br>i++;<br>}</pre><p>Ex:2</p><pre>int x=0;<br>for(x=0;x&lt;=10;x+=2)<br>System.out.println(x);<br>//output <br>0 2 4 6 8 10</pre><p>This is another try,</p><pre>int x=0;<br>for(x=0;x&lt;=10;x+=2)<br>System.out.println(&quot;number is&quot;+x+&quot;\n&quot;);</pre><p>Ex:3</p><pre>int i,j;<br>for (i=1, j=7; i&lt;=5 &amp;&amp; j&lt;=10; i++,j++) <br>System.out.println(&quot;i: &quot; + i + &quot; j: &quot; +j + &quot;\n&quot;);</pre><pre>//output<br>i:1 j:7<br>i:2 j:8<br>i:3 j:9<br>i:4 j:10</pre><p>Ex:4</p><p>Below examples answers are depend on the curly braces.</p><pre>var x=1;<br>for(x; x&lt;10;x++){}<br>x+=x+100;<br>System.out.println(x) //output:120  [[[....nothing in the curly braces]]]</pre><pre>var x=1;<br>for(x; x&lt;10;x++)<br>{ <br>x+=x+100;<br>}<br>System.out.println(x) //output:103</pre><pre>In similar for this we can get below example too</pre><pre>var i = 1;   <br>for (; i&lt;=5; i++)<br>{       <br>System.out.println(i)<br>}<br>System.out.println(&#39;Now, i = &#39;+i)  <br>//It will give : 1 2 3 4 5 Now, i = 6</pre><pre>var x=1; <br>for(x; x&lt;10;x++)<br>{ <br>x+=x+100;<br>System.out.println(x);<br>} <br>//output:102   [</pre><p>Ex:5</p><pre>for (int i = 0; i &lt;= 10; i ++)  <br>{     <br>if (i % 2 != 0)<br>{<br>System.out.println(i); <br>}<br>}<br>//output<br>1 3 5 7 9                 </pre><p>Ex:6</p><pre>int x;<br>  System.out.println(&quot;enter a number&quot;);<br>  int num=sc.nextInt();<br>     <br>     for(x = num; x &lt; 10;x++)<br>     System.out.println(&quot;Next number is &quot;+x);<br>     <br>     System.out.println(&quot;Done.&quot;);<br>//out put is</pre><pre>enter a number  // let us think that entered number is 5, This may continues as<br>Next number is 5<br>Next number is 6<br>Next number is 7<br>Next number is 8<br>Next number is 9<br></pre><p>Ex:7</p><p>Let us see to add these for loops for Strings too.Here we can’t use two data types in side a loop.If we added char we can’t add again int there.</p><pre>int i=1; <br>for(char x=&#39;a&#39;; x&lt;=&#39;z&#39;; x++)<br>{  <br>System.out.println(&quot;Alphabet&#39;s &quot;+i+&quot;. letter is &quot; + x);         <br>i++;     <br>}  <br>//out put is<br>Alphabet&#39;s 1.letter is a<br>Alphabet&#39;s 2.letter is b<br>Alphabet&#39;s 3.letter is c<br>Alphabet&#39;s 4.letter is d</pre><pre>Alphabet&#39;s 26.letter is z</pre><p>Ex:8</p><p>To type same words for 10 times we can use for loop</p><pre>int i;<br>for(int i=0; i&lt;=10; i++) <br>{    <br>System.out.println(&quot;Great&quot;);<br>}<br>//out put is typing &#39;Gtreat&#39; for 10 types</pre><p>Ex:9</p><pre>for(int x=2; x&lt;=1000; x=x*x) <br>{             <br>System.out.println(x);<br>}<br>//output is <br>2 4 16 256</pre><p>I have discussed here 9 Examples regarding with for loop.Loops are highly used in when we create software products.I may discuss about whileloop and dowhile loop with in my next article and also about star patterns.Thank you for reading.Keep in touch.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44d909dd9ee9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Operators in Java(part4)]]></title>
            <link>https://nkdamitha.medium.com/operators-in-java-part4-1b6a7c12aa92?source=rss-1cc1570d1a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b6a7c12aa92</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[shift]]></category>
            <category><![CDATA[operators]]></category>
            <category><![CDATA[bitwise]]></category>
            <dc:creator><![CDATA[Damitha karunarathne]]></dc:creator>
            <pubDate>Sun, 24 May 2020 06:49:09 GMT</pubDate>
            <atom:updated>2020-05-24T06:49:09.970Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ejWSkALIVkRtojOFSISopg.png" /></figure><p>Hi readers,This is my seventh article and it is the fourth part of operators in Java.On my previous articles I have discussed types of operators with in examples.This is the last part of Operators,and it is Bit Wise operators.</p><h3>Bit Wise Operators</h3><p>Bit wise operators in java are shown in below diagram.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*trP86NWUvQJOrRr47I4BdQ.png" /></figure><p>Expressions of AND(&amp;),OR(|) Operators are shown in below diagram.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*8Sgx9dWBswX16p9rKDQlSw.png" /></figure><p>We have to convert decimal numbers in to binary numbers when we use AND,OR and XOR operators.Result is coming as decimal number,but the process is there with binary numbers.With in go through following examples you may able to study about BitWise operators.</p><h4>AND operator</h4><pre>int a=25; // 1 1 0 0 1   (binary form of 25)<br>int b=15; // 0 1 1 1 1   (binary form of 15) </pre><pre>int c=a&amp;b;// 0 1 0 0 1   <br>System.out.println(c);   // 9</pre><h4>OR operator</h4><pre>int  a=25;  // 1 1 0 0 1<br>int  b=15;  // 0 1 1 1 1</pre><pre>int  c=a|b; // 1 1 1 1 1<br>System.out.println(c); // 31</pre><h4>XOR operator</h4><pre>int a=25;  // 1 1 0 0 1<br>int b=15;  // 0 1 1 1 1</pre><pre>int c=a^b; // 1 0 1 1 0</pre><pre>System.out.println(c); // 22</pre><h4>Bit Wise Compliment</h4><pre>int number=35,result;<br>result=~number;<br>System.out.println(result);// -36<br> <br>Why -36 has come as result?</pre><pre>35   -&gt;   0 0 1 0 0 0 1 1 <br>220  -&gt;   1 1 0 1 1 1 0 0 // The compliment of 35<br>-36  -&gt; - 0 0 1 0 0 1 0 0 // 2’s compliment of 35 </pre><h4>Signed left shift</h4><pre>int num=212;                 //        1 1 0 1 0 1 0 0<br>System.out.println(212&lt;&lt;1);  //      1 1 0 1 0 1 0 0 0 //  424<br>System.out.println(212&lt;&lt;0); //         1 1 0 1 0 1 0 0 //  212<br>System.out.println(212&lt;&lt;4); // 1 1 0 1 0 1 0 0 0 0 0 0 // 3392</pre><h4>Signed Right shift</h4><pre>int num=212;<br>System.out.println(212&gt;&gt;1); //     1 1 0 1 0 1 0 //106  System.out.println(212&gt;&gt;0);//    1 1 0 1 0 1 0 0 //212<br>System.out.println(212&gt;&gt;4); //           1 1 0 1 // 13</pre><p>In my this blog I have discussed mainly about BitWise Operators in Java.I have completed about operators in Java with in four articles.In my next article I hope to discuss about loops in java,step by step.Thank you for reading.Keep in touch with hoping the next.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b6a7c12aa92" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Operators in Java(Part3)]]></title>
            <link>https://nkdamitha.medium.com/operators-in-java-part3-28f766c0d9c9?source=rss-1cc1570d1a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/28f766c0d9c9</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[operators]]></category>
            <category><![CDATA[assignment]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Damitha karunarathne]]></dc:creator>
            <pubDate>Tue, 12 May 2020 17:12:08 GMT</pubDate>
            <atom:updated>2020-05-12T17:12:08.998Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ejWSkALIVkRtojOFSISopg.png" /></figure><p>Hi readers You are with my Sixth article Of Java.Thank you very much for being with me so far and I thoroughly believe that you have read my previous articles and go through with my simple examples.I am pretty sure that they are very useful.This article is third part of java operators.Mainly here I discuss about Assignment Operators in java.</p><h4>Assignment operators in java</h4><p><strong>Assignment </strong>operator (=), which assigns a value to a variable.</p><p>x+=y means x=x+y</p><p>x-=y means x=x-y</p><p>x*=y means x=x*y</p><p>x/=y means x=x/y</p><p>x%=y means x=x%y</p><p>With in some examples it may easy to understand more about Assignment Operators in Java.</p><p>ex:</p><pre>int num1=5;<br>int num2=2;<br>num2*=num1+num2;           //num2=num2(num1+num2)<br>System.out.println(num2); // num2=2(5+2)=14<br>                          </pre><p>ex:</p><pre>int var1 = 7;<br>int var2 = 3;         <br>int var3 = var2;         <br>int var4 = var2;         <br>int var7 = var2;         <br>int var5 = var1%(++var2);          //(++var2)=4,7%4=3     <br>System.out.println(var1%(++var3));//(++var3)=4, 7%4=3         System.out.println(var1%++var7); // (++var7)=4, 7%4=3        System.out.println(var1%var4++);// (var4++)=3, 7%3=1       System.out.println(var4);      // (var4++)=3,(var4)=4       <br>System.out.println(var5);     // (++var2)=4,7%4=3       <br>System.out.println(var5++);  //3 (postfix)        <br>System.out.println(var5);   //(var5++)=3, (var5)=4        <br>System.out.println(++var5);// 5 (prefix)</pre><p>ex:</p><pre>int num1 = 4;         <br>int num2 = 8;         <br>int num3 = 50;         <br>int num4 = 100;</pre><pre>num2 += num1; //num2=(num2+num1)=8+4=12<br>num3 += num2; //num3=(num3+num2)=50+12=62<br>num4 += num3; //num4=(num4+num3)=100+62=162<br>num4 += num3 += num2 += num1; //num4=(162+62+12+4)=240</pre><pre>System.out.println(num1);   //4<br>System.out.println(num2);  // num2=(num2+num1)=12+4=16<br>System.out.println(num3); // num3=(num3+num2)=62+16=78<br>System.out.println(num4); // num4=(num4+num3)=78+162=240</pre><p>ex:</p><p>Not only for integers,But also for Strings we can use operators.</p><pre>String first = &quot;hello&quot;;   //here we use &quot;&quot; because,this is a string<br>String second = &quot; world&quot;;   <br>String together = &quot;&quot;; <br>together += first;       //together=(together+first)=hello<br>together += second;     //together=(together+second)=hello world<br>System.out.println(together)  //hello world</pre><p>Here are few examples of conclusion in operators in java,that we discussed so far,Try them.</p><p>ex:</p><pre>int i,j,m,n,k;<br>float f,g;<br>char c=&#39;x&#39;;<br>k=i=j=2;<br>m=n=5;<br>f=12.0f;<br>g=4.0f;</pre><pre>System.out.println(k+12*m+j+m%n);    //(2+(12*5)+2+0)=64<br>System.out.println(-12L*(g-k)+&#39;c&#39;); //<br>System.out.println(i++*n*++j);     //(2*5*3)=30 <br>System.out.println(k*m/(j*n));    //(2*5/(2*5))=0<br>System.out.println(k*m-n%g);     // (2*5-(1)=9)<br>System.out.println(m/k/n*j);    // (5/2/(5*2))=0<br>System.out.println(k==2);      //true<br>System.out.println(k=2);      // 2<br>System.out.println(m-++n);   //(5-6)=-1<br>System.out.println(k+12*m); //(2+(12*5))=62<br>System.out.println(m/j);   //2<br>System.out.println(n%j);  //1 <br>System.out.println(m/j*j);  //(5/(2*2))=1<br>System.out.println(f+10*5+g); //(12+50+4)=66.0<br>System.out.println(++i*n);   //(3*5) =15//i=3=prefix<br>System.out.println(i++*n);  //(3*5)=15 //i=3=postfix </pre><pre>int a=2,b=3,c=4,d=5;<br>float k=4.3f;<br>System.out.println(--b*a+c*d--);  //  (2*2)+(4*5)=24<br>System.out.println(a++);         //   2(postfix)<br>System.out.println(c=c++);      //    4(postfix)<br>System.out.println(++c);       //     5(prefix)<br>System.out.println(c=++c*a++);//      6*3=18 </pre><p>Here I discussed mainly about assignment operator.If you guys follow my previous articles in operators in Java,you can have a better idea about operators.With in my next article I hope to discuss about last part of operators,Bit wise operators.Keep in touch.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28f766c0d9c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Operators in Java(part2)]]></title>
            <link>https://nkdamitha.medium.com/operators-in-java-part2-38382e2fbe62?source=rss-1cc1570d1a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/38382e2fbe62</guid>
            <category><![CDATA[operators]]></category>
            <category><![CDATA[postfix]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[prefix]]></category>
            <dc:creator><![CDATA[Damitha karunarathne]]></dc:creator>
            <pubDate>Wed, 06 May 2020 17:20:02 GMT</pubDate>
            <atom:updated>2020-05-06T17:20:02.950Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ejWSkALIVkRtojOFSISopg.png" /></figure><p>Hi readers!This is my Fifth article and it is ,second part of the Operators in java.I think you have read first part of operators and got an idea about operators.With in this article I may go some deep with operators.</p><h4>Increment /decrement operators</h4><p>An <strong>increment </strong>or <strong>decrement </strong>operator provides a more convenient and compact way to increase or decrease the value of a variable by <strong>one</strong>.</p><ul><li>++i = Pre-increment = first increase then asign</li><li>i++ = Post-increment = first asign then increase</li></ul><p>This applies to decrement too.</p><pre>int x=5;<br>++x;  //answer is 6<br>--x;  //answer is 4</pre><h3>prefix and postfix</h3><p><strong>prefix </strong>and <strong>postfix</strong>, may be used with both the increment and decrement operators.while in postfix form, the operator appears after the operand.</p><p><strong>Prefix</strong></p><p>Increments the variable’s value and uses the new value in the expression.With prefix form, the operator appears before the operand.</p><pre>int x = 34;<br>int y = ++x; // y is 35</pre><h4><strong>Postfix</strong></h4><p>The variable’s value is first used in the expression and is then increased.with in postfix form, the operator appears after the operand.</p><pre>int x = 34;<br>int y = x++; // y is 34</pre><p>To understand more about this prefixes and postfixes let us see following examples.I hope it will help you to understand them well.</p><p>ex:1</p><pre>int test=5;<br>System.out.println(test++); // output: 5 (postfix)  //a<br>System.out.println(++test); // output: 7 (prefix)   //b<br>System.out.println(test+1); // output: 8 (addition) //c</pre><p>Here in ‘a’ answer comes as 5.As it is postfix. But when it goes to the ‘ b ‘ the value of the test is 6.In ‘b’ there is prefix.So first increase the value and the answer is 7.When it goes to ‘c’ the value of test is 7 and adding 1.Then the answer is 8.</p><p>ex:2</p><pre>int x=5;<br>++x; <br>System.out.println(++x) //  answer = 7</pre><p>Here at first++x there is prefix.So first add one value.At that time answer is 6.Then again at second ++x adding one value.So the answer is 7.</p><p>ex:3</p><pre><br>int x=42;<br>int y=++x;<br>System.out.println(x);  //  answer is 43<br>System.out.println(y);  //  answer is 43 </pre><pre>}}</pre><p>ex:4</p><pre>x=42 ;<br>y=x++;<br>System.out.println(x);  //  answer is 43<br>System.out.println(y);  //  answer is 42</pre><p>ex:5</p><pre>int test = 5;<br>++test;       <br>System.out.println(test); //output is 6     //a    <br>test++;                   //b<br>System.out.println(test++); //output is 7,  //c<br>System.out.println(test);  //output now reveals itself as 8  //d</pre><p>Here at first ++test there is prefix.So at ‘a’ answer is 6.Now the value is 6.At second test++ , there is postfix and now value is 6.At c test++ value comes as 8, but output is 7.At ‘d’ now the value is 8.</p><ul><li>++x is pre increment // result comes before the statement.</li><li>x++ is post increment // result comes after the statement.</li></ul><p>There are some more examples in following.Follow them carefully and take an idea about more about prefixes and postfixes.</p><p>ex:6</p><pre>int test = 5;<br>test++;<br>System.out.println((test+2)*2);  //  16</pre><p>ex:7</p><pre>int test = 2;<br>int result= (test++ + ++test );  // output=6(2+4)</pre><p>ex:8</p><pre>int x = 34;  <br>System.out.println(x++);    //34           <br>System.out.println(x);      //35<br>System.out.println(++x);    //36<br>System.out.println(x--);    //36<br>System.out.println(--x);    //34</pre><p>ex:9</p><pre>c=5;                         // assign 5 to c      <br>System.out.println(c);      //prints c <br>System.out.println(c++);    // prints 5 then post increment System.out.println(c);     //prints 6</pre><p>ex:10</p><pre><br>int a=7,b=2;<br>System.out.println(a+&quot; &quot;+b);  // 7 2<br>a++;                         //  7<br>++b;                        //   3<br>System.out.println(a+&quot; &quot;+b); //  8 3</pre><p>ex:11</p><pre><br>int a=7,b=2;<br>System.out.println(a+&quot; &quot;+b);  //  7 2<br>--a;                         //   6<br>b--;                        //    2<br>System.out.println(a+&quot; &quot;+b); //   6 1</pre><p>ex:12</p><pre>int x = 34;         <br>int y = x++; // y holds a value of x first, 34. then int x is added by 1, int x is now 35 //         <br>System.out.println(x++); // x will print first, 35, then int x will be added by 1. now int x = 36 //         <br>System.out.println(y);// y still holds original value of x, 34        System.out.println(x); // now we print the value of x, 36 <br></pre><p>ex:13</p><pre>int x = 34; <br>System.out.println(x++-x++);         //output: -1  (34-35)<br></pre><p>ex:14</p><pre>int x = 34;<br>int a =++x; <br>int b =x++;<br>System.out.println(a);  //35<br>System.out.println(b);  //35<br>System.out.println(x);  //36</pre><p>ex:15</p><pre>int z, x=0;   <br>z = ++x;   <br>System.out.println(z+x) ;    //Output: 2  (1+1) <br>System.out.println(z+&quot;&quot;+x); // Output: 11</pre><p>ex:16</p><pre>int test = 5;   <br>++test;            <br>System.out.println(test);    // 6 (5+1)<br>System.out.println(test++);  // 6  <br>System.out.println(test--);  // 7  (6+1)</pre><p>ex:17</p><pre>int x = 34;        <br>int y = x++;        <br>int z = ++x;           <br>System.out.println(z);     // 36</pre><p>ex:18</p><pre>int x = 34;         <br>System.out.println(x--);   //   34<br> System.out.println(x--);   //  33<br>System.out.println(x++);   //   32  <br>System.out.println(x++);   //   33  <br>System.out.println(--x);   //   33   <br>System.out.println(x--);   //   33<br>System.out.println(++x);  //    33<br>System.out.println(x++);  //    33<br>System.out.println(++x);  //    35</pre><p>ex19:</p><pre>int a=7,b=2;<br>System.out.println(a+&quot; &quot;+b);  // 7 2<br>a=b++;<br>System.out.println(a+&quot; &quot;+b);  // 2 3</pre><p>ex20:</p><pre>int a=7,b=2;<br>System.out.println(a+&quot; &quot;+b);   // 7 2<br>b=a--;<br>System.out.println(a+&quot; &quot;+b);   // 6 7</pre><p>ex21:</p><pre>int a=7,b=2;<br>System.out.println(a+&quot; &quot;+b);   // 7 2<br>a=a++;<br>System.out.println(a+&quot; &quot;+b);   // 7 2</pre><p>ex22:</p><pre>int a=7,b=2;<br>System.out.println(a+&quot; &quot;+b);  // 7 2<br>b=b++;<br>System.out.println(a+&quot; &quot;+b);  // 7 2</pre><p>ex23:</p><pre>int a=7,b=2;<br>System.out.println(a++ + a++ + a++);  // (7+8+9=24)</pre><p>ex24:</p><pre>int a=7,b=2;<br>System.out.println(a++ + b++ - --b);  // (7+2-2=7)</pre><p>ex25:</p><pre>int a=7,b=2;<br>System.out.println(++a + ++a + ++a);  //(8+9+10=27)</pre><p>ex26:</p><pre>int a=7,b=2;<br>System.out.println(a++ + b++ - --b);  //(7+2-2=7)</pre><p>These are some few examples that can get more idea about prefixes and postfixes. With in next article I hope to discuss about assignment operators and bit-wise operators. Thank you for reading.Keep in touch.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38382e2fbe62" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Operators in Java]]></title>
            <link>https://nkdamitha.medium.com/operators-in-java-a668dc0b49c2?source=rss-1cc1570d1a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/a668dc0b49c2</guid>
            <category><![CDATA[operators]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[operand]]></category>
            <category><![CDATA[arithmetic-operations]]></category>
            <dc:creator><![CDATA[Damitha karunarathne]]></dc:creator>
            <pubDate>Mon, 04 May 2020 08:27:41 GMT</pubDate>
            <atom:updated>2020-05-04T17:20:40.455Z</atom:updated>
            <content:encoded><![CDATA[<h3>Operators in Java(part1)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ejWSkALIVkRtojOFSISopg.png" /></figure><p>Hi readers! This is my fourth article and it is about Java operators.I hope you all have read my other three articles and I was really happy to see many of your comments and opinions which made me forced to write my fourth article.</p><h4>Operators and Operands</h4><p>•An <strong><em>operator</em></strong> is a function that has a special symbolic name and is invoked by using that symbol with an expression.A value used on either side of an operator is called an <strong>operand</strong>.</p><pre>int x=6+3;</pre><p>In above example + is an operator.6 &amp; 3 are operands</p><h4>TYPES OF OPERATOR</h4><ol><li>Arithmetic Operator [ +, -, *, /, % ]</li><li>Assignment Operator [ =, +=, -=, *=, /=, %= etc…]</li><li>Increment / Decrement Operator [ ++, — ]</li><li>Relational Operator [ &gt;, &lt;, &gt;=, &lt;=, !=, == ]</li><li>Logical Operator [ &amp;&amp;, ||, ! ]</li><li>Bit wise Operator [ &amp;, |, ^, ~ ]</li><li>Conditional Operator [ ? : ]</li></ol><p>Also according to the way of we are using operators, they can be categorized as follows.</p><ol><li>Unary(++, — , ==, !)// use one operand</li><li>Binary(+, -, /, *, %) // use two operand</li><li>Ternary( ? : ) // use three operand</li></ol><h3><strong>Arithmetic Operators</strong></h3><p>Arithmetic operators are used in mathematical expressions in the same way that they are used in algebraic equations.</p><p><strong>Addition</strong></p><p>The + operator adds together two values such as two constants, a constant and a variable, or a variable and a variable. Here are a few examples of addition</p><pre>int sum1 = 50 + 10;//two constants <br>int sum2 = sum1 + 66;//constant and a variable<br>int sum3 = sum2 + sum2;//two variables</pre><p>ex1:</p><pre>int x=2;<br>int y=7;<br>int z=x+y;//answer is 9<br>int z=&quot;x&quot;+&quot;y&quot;;//error<br>String z=&quot;x&quot;+&quot;y&quot;//answer is xy as collecting two strings</pre><p>ex2:</p><pre> int num1 =50+10;//answer is 50+10=60<br> int num2=num1+66;//answer is 60 +66 =126<br> int num3 =num2+num2;//answer is 126+126 =252</pre><h4>Subtraction</h4><p>The — operator subtracts one value from another.</p><pre>int num1=1000 - 10; //answer is 990<br>int num2=num1 - 5; //answer is 985<br>int num3=num1 - num2;//answer is 5  </pre><h4>Multiplication</h4><p>The * operator multiplies two values.</p><pre>int sum1 = 1000*2  //answer is 2000<br>int sum2 = sum1*10 //answer is 20,000 <br>int sum3 = sum1*sum2 // answer is 40,000,000</pre><h4>Division</h4><p>The / operator divides one value by another.</p><pre>double x=3;<br>double y=2;<br>double z=x/y;  //answer is 1.5<br>  </pre><h4>Modulo</h4><p>The <strong>modulo </strong>(or remainder) math operation performs an integer division of one value by another, and returns the remainder of that division.<br>The operator for the modulo operation is the percentage (%) character.</p><p>ex1:</p><pre>int value = 23;<br>int res = value % 6; // res is 5</pre><p>ex2:</p><pre>double x=3;<br>double y=2000;<br>double z=x%y;  // answer is 3.0</pre><p>In this article I explained about what are operators,operands,types of operators and mainly about Arithmetic operators with examples.In next article I would like to write about other types of operators which that we should clearly understand.Your opinions are highly appreciated.Thank you.Keep in touch.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a668dc0b49c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[if else conditions of Java]]></title>
            <link>https://nkdamitha.medium.com/if-else-conditions-of-java-620a7879b338?source=rss-1cc1570d1a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/620a7879b338</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[if-else]]></category>
            <category><![CDATA[switch]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Damitha karunarathne]]></dc:creator>
            <pubDate>Wed, 01 Apr 2020 09:21:06 GMT</pubDate>
            <atom:updated>2020-04-01T09:21:06.838Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*me8zL3QQ2LupTRWjGipc7w.jpeg" /></figure><p>Hi readers! I do hope you all read my previous articles about Introduction to Java and Java data types.This is my third article and it is about if else condition in Java.</p><p>Following logic conditions are mostly used in if else condition.</p><ul><li>Less than: a &lt; b</li><li>Less than or equal to: a &lt;= b</li><li>Greater than: a &gt; b</li><li>Greater than or equal to: a &gt;= b</li><li>Equal to a == b</li><li>Not Equal to: a != b</li><li>&amp;&amp;</li><li>||</li></ul><p>if(codition)</p><p>else if(condition)</p><p>else</p><p>Here i am writing very simple example .</p><pre>import java.util.Scanner;<br>public class FirstProgramme{<br>public static void main(String args[]){<br>Scanner sc=new Scanner(System.in);</pre><pre>System.out.println(&quot;Enter a number&quot;);<br>int num=sc.nextInt();</pre><pre>if(num%2==0)<br>System.out.println(&quot;even&quot;);</pre><pre>else<br>System.out.println(&quot;odd&quot;);</pre><pre>}<br>}</pre><p>Here if the given number is divided by 2 and no any remains it is an even number.Other wise it is an odd number.If we print 4,the answer is given as even.If we print 7 ,the answer is given as odd.Let us see some more examples further.</p><p>Let us see how to find the biggest number for given three numbers.</p><pre>import java.util.Scanner;<br>public class FirstProgramme{<br>public static void main(String args[]){<br>Scanner sc=new Scanner(System.in);</pre><pre>System.out.println(&quot;Enter number 1&quot;);<br>int num1=sc.nextInt();</pre><pre>System.out.println(&quot;Enter number 2&quot;);<br>int num2=sc.nextInt();</pre><pre>System.out.println(&quot;Enter number 3&quot;);<br>int num3=sc.nextInt();</pre><pre>if(num1&gt;num2 &amp;&amp; num1&gt;num3)<br>System.out.println(&quot;largest number is&quot;+num1);</pre><pre>else if(num2&gt;num3)<br>System.out.println(&quot;largest number is&quot;+num2);</pre><pre>else<br>System.out.println(&quot;largest number is&quot;+num3);</pre><pre>}<br>}</pre><p>The answer for above code as bellow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/769/1*OUIQhzwL3qSkrkOuHqBo3g.png" /></figure><p>Let us see how can we do some basic calculations with if else condition.</p><pre>import java.util.Scanner;<br>public class FirstProgramme{<br>public static void main(String args[]){<br>Scanner sc=new Scanner(System.in);</pre><pre>System.out.println(&quot;Enter number1&quot;);<br>int num1=sc.nextInt();</pre><pre>System.out.println(&quot;Enter number2&quot;);<br>int num2=sc.nextInt();</pre><pre>System.out.println(&quot;Enter operator&quot;);<br>char op=sc.next().charAt(0);</pre><pre>if(op==&#39;+&#39;)<br>System.out.println(num1+num2);</pre><pre>else if(op==&#39;-&#39;)<br>System.out.println(num1-num2);</pre><pre>else if(op==&#39;*&#39;)<br>System.out.println(num1*num2);</pre><pre>else if(op==&#39;/&#39;)<br>System.out.println(num1/num2);</pre><pre>else<br>System.out.println(&quot;invalid&quot;);</pre><pre>}<br>}</pre><p>When we run code,it shows answer as follow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_VDMpg4snBnqZ35zEtDf6g.png" /></figure><p>Usually 3,4,5 months belongs for Spring season.6,7,8 months belongs to summer season.9,10,11 months belongs to autumn.12,1,2 months belong to Winter season.Let us see how can we use these details in to if ,else condition.</p><pre>import java.util.Scanner;<br>public class FirstProgramme{<br>public static void main(String args[]){<br>Scanner sc=new Scanner(System.in)</pre><pre>System.out.println(&quot;Enter month&quot;);<br>int month=sc.nextInt();</pre><pre>if(month==3 || month==4 || month==5)<br>System.out.println(&quot;Spring&quot;);</pre><pre>else if(month==6 || month==7 month==8)<br>System.out.println(&quot;Summer&quot;);</pre><pre>else if(month==9 || month==10 month==11)<br>System.out.println(&quot;Autumn&quot;);</pre><pre>else if(month==12 || month==1 month==2)<br>System.out.println(&quot;Winter&quot;);</pre><pre>else<br>System.out.println(&quot;Invalid&quot;);</pre><pre>}<br>}</pre><p>Now let us see a number guessing game by using if else condition.It is little bit funny,You can also try out.</p><pre>import java.util.Scanner;<br>import java.util.Random;<br>public class FirstProgramme{<br>public static void main(String args[]){<br>Scanner sc=new Scanner(System.in);<br>Random rnd=new Random();</pre><pre>int number=rnd.nextInt(10);</pre><pre>System.out.println(&quot;guess a number&quot;);<br>int guess=sc.nextInt();</pre><pre>if(number==guess)<br>System.out.println(&quot;10 marks .You are lucky winner&quot;);</pre><pre>else<br>System.out.println(&quot;0 marks. Loser&quot;);</pre><pre>System.out.println(&quot;number is&quot;+number);<br>}<br>}</pre><p>When we get random numbers we use</p><p>import java.util.Random;(To call library function)</p><h3>Switch Cases</h3><p>The switch expression is evaluated once.We use here case to compare the value.break and default are key words.</p><p>As examples when we enter the name of the student ,The village of relevant student will come out as result.The code as follow.</p><pre>import java.util.Scanner;<br>public class FirstProgramme{<br>public static void main(String args[]){<br>Scanner sc=new Scanner(System.in);</pre><pre>System.out.println(&quot;Enter your name&quot;);<br>String name=sc.nextLine();<br>switch(name){</pre><pre>case &quot;Damitha&quot;:<br>System.out.println(&quot;Bibile&quot;);<br>break;</pre><pre>case &quot;Sepali&quot;:<br>System.out.println(&quot;Kandy&quot;);<br>break;</pre><pre>case &quot;Kusala&quot;:<br>System.out.println(&quot;Colombo&quot;);<br>break;</pre><pre>default:<br>System.out.println(&quot;Other&quot;);</pre><pre>}<br>}<br>}</pre><p>Let us see how can we add, subtract….. 2 numbers with this switch statement.</p><pre>import java.util.Scanner;<br>public class FirstProgramme{<br>public static void main(String args[]){<br>Scanner sc=new Scanner(System.in);</pre><pre>System.out.println(&quot;Enter first number&quot;);<br>int num1=sc.nextInt();<br>System.out.println(&quot;Enter second number&quot;);<br>int num2=sc.nextInt();<br>System.out.println(&quot;Enter operator&quot;);<br>char op=sc.next().charAt(0);</pre><pre>swich(op){</pre><pre>case&#39;+&#39;:<br>System.out.println(num1+num2);<br>break;</pre><pre>case&#39;-&#39;:<br>System.out.println(num1-num2);<br>break;</pre><pre>case&#39;*&#39;:<br>System.out.println(num1*num2);<br>break;</pre><pre>case&#39;/&#39;:<br>System.out.println(num1/num2);<br>break;</pre><pre>default:<br>System.out.println(&quot;Other&quot;);</pre><pre>}<br>}<br>}</pre><p>Today I just talked little about if,else conditions and switch cases in java programming.In next article I hope to write about operators and about loops,some other basics of Java.If there are any doubts let me know about them.Thank you for your reading.Keep in touch.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=620a7879b338" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java Data Types]]></title>
            <link>https://nkdamitha.medium.com/java-data-types-df42c6a57b8b?source=rss-1cc1570d1a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/df42c6a57b8b</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[information-technology]]></category>
            <category><![CDATA[data-type]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Damitha karunarathne]]></dc:creator>
            <pubDate>Wed, 01 Apr 2020 06:44:39 GMT</pubDate>
            <atom:updated>2020-04-01T06:44:39.005Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*me8zL3QQ2LupTRWjGipc7w.jpeg" /></figure><p>Hi readers! I do hope You read my first article.It is about Introduction to Java.Here I bring you my second article.It is about Java Data Types.</p><h3><strong>Data types</strong></h3><p>There are mainly two kind of Data Types in Java.</p><ol><li>Primitive Data Type-</li></ol><blockquote>Integer,Character,Boolean,Floating</blockquote><p>2. Non primitive Data Type-</p><blockquote>Classes,Interfaces,Arrays</blockquote><h4>This is how data types conclude capacity.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*pnw0-zsOFV3KCTKf01FZ2A.png" /></figure><h4>Variable Deceleration</h4><p>ex:</p><p>int a</p><p>char ‘ch’</p><p>Let us see some Examples</p><blockquote>1.Integer</blockquote><pre>public class FirstProgramme{<br>public static void main(String args[]){</pre><pre>int a=777;<br>int result=a*2;</pre><pre>System.out.println(result);<br></pre><p>here we get the answer as 1554.</p><blockquote>2.Long</blockquote><pre>public class FirstProgramme{<br>public static void main(String args[]){</pre><pre>long a=7773334445556661;<br>long result=a*2;</pre><pre>System.out.println(result);<br>}<br>}</pre><p>here we get the result as 1554666889111332.If we declare here a as int there it says that integer number is too large.So it doesn’t run.long consists with 8 bytes.So here we declare a as long.Also at the end of the number here we apply l.</p><h4>Concatenate</h4><pre>public class FirstProgramme{<br>public static void main(String args[]){</pre><pre>long a=222223334445551;<br>long result=a*2;</pre><pre>System.out.println(a+&quot;&quot;+result);<br>}</pre><pre>}</pre><p>Here we get the answer as 2222233344455544444666889110. Here result combined with a.</p><p>Now we see how can we get our result in hexadecimal form.In hexadecimal it consists with 1,2,3,4,5,6,7,8,9,A,B,C,D,E.</p><p>let us get 1B2E . this is in hexadecimal form.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*nsXSjy0A6I1qwY4MKPtEsQ.png" /></figure><pre>public class FirstProgramme{<br>public static void main(String args[]){</pre><pre>int value=0x1B2E;</pre><pre>System.out.println(value);<br>}<br>}</pre><p>Here there 0x should be there to convert this hexadecimal into decimal.Here we get answer as 6958.</p><blockquote>3.Float</blockquote><pre>public class FirstProgramme{<br>public static void main(String args[]){</pre><pre>float value=22.678f;</pre><pre>System.out.println(value);<br>}<br>}</pre><p>Here the answer is 22.678</p><pre>public class FirstProgramme{<br>public static void main(String args[]){</pre><pre>float r=22.678905;<br>float areaOfCircle=3.14f*r*r;</pre><pre>System.out.println(areaOfCircle);<br>}<br>}</pre><p>Here we get the answer as 1615.005.If we put double here answer may change as 1615.0049018014715. When we use float the value estimate for two or three decimal point values.But double doesn’t. Here we can see the differences between float and double.In int,float,double they doesn’t represent letters.So we use characters and Strings in this case.</p><blockquote>4.Char</blockquote><pre>public class FirstProgramme{<br>public static void main(String args[]){</pre><pre>char ch=&#39;a&#39;;</pre><pre>System.out.println(ch);<br>}<br>}</pre><p>In char here we show only one character. It is written in with single quotation.In characters.But in string we use double quotations.</p><blockquote>5.String</blockquote><pre>public class FirstProgramme{<br>public static void main(String args[]){</pre><pre>String a=&quot;Sri Lanka&quot;;</pre><pre>System.out.println(a);<br>}<br>}</pre><p>Here we get the answer as Sri Lanka.</p><pre>public class FirstProgramme{<br>public static void main(String args[]){</pre><pre>char ch=&#39;A&#39;;<br>System.out.println(ch+);<br>}<br>}</pre><p>Here we get the answer as 66.Because we add here 1 for the ascii value of A.The ascii value of A is 65.</p><h4>Escape Sequences</h4><p>\t-tab</p><p>\b-backspace</p><p>\n-New line</p><p>\’-Single quote</p><p>\”-Double quote</p><p>\\-Back slash</p><pre>public class FirstProgramme{<br>public static void main(String args[]){</pre><pre>System.out.println(&quot;Sri \t\t\t\t Lanka&quot;);<br>System.out.println(&quot;Sri \b Lanka&quot;);<br>System.out.println(&quot;Sri \n Lanka&quot;);<br>System.out.println(&quot;Sri \&#39; Lanka&quot;);<br>System.out.println(&quot;Sri \&quot; Lanka&quot;);<br>System.out.println(&quot;Sri \\ Lanka&quot;);<br>}<br>}</pre><p>When we use above sequences,The result as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*qrg2GUBF6rHm26gWN_8Cmg.png" /></figure><h3>Scanner</h3><p>In java programming here we use scanner to read data.</p><p>Scanner sc=new Scanner(System.in)</p><pre>import java.util.Scanner;<br>public class FirstProgramme{<br>public static void main(String args[]){<br>Scanner sc=new Scanner(System.in);</pre><pre>System.out.println(&quot;enter number&quot;);<br>int num=sc.nextInt();</pre><pre>System.out.println(&quot;enter mobile number&quot;);<br>long mobileNo=sc.nextLong();</pre><pre>System.out.println(&quot;Enter Bonus&quot;);<br>float number=sc.nextFloat();</pre><pre>}<br>}</pre><p>At top of the program we write as, import java.util.Scanner</p><p>when we read the result.</p><p>In here we get numerical data input.byte,short and float can be read.</p><pre>import java.util.Scanner;<br>public class FirstProgramme{<br>public static void main(String args[]){<br>Scanner sc=new Scanner(System.in);</pre><pre>System.out.println(&quot;Enter your name&quot;);<br>String name=sc.nextLine();</pre><pre>System.out.println(&quot;Enter a character&quot;);<br>char ch=sc.next().charAt(0);</pre><pre>}<br>}</pre><p>As above we can get character input and string input.</p><p>Today with this article I explained mainly about Java Data Types.With in next article I do hope to discuss about if,else condition.I will go little bit much deeply further step by step.So thank you very much for reading.Keep in touch!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df42c6a57b8b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Java]]></title>
            <link>https://nkdamitha.medium.com/introduction-to-java-cc9b16782e8f?source=rss-1cc1570d1a1------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc9b16782e8f</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[information-technology]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[basics]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Damitha karunarathne]]></dc:creator>
            <pubDate>Tue, 31 Mar 2020 16:57:42 GMT</pubDate>
            <atom:updated>2020-04-01T09:37:06.159Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*me8zL3QQ2LupTRWjGipc7w.jpeg" /></figure><p>HI READERS ! This is my First Article , it is about java programming languages.I hope to continue this with in more articles further.Your comments and opinions are highly appreciated.These blog will help you to learn Java Programming and concepts in a simple and effective way.</p><p>java is object oriented programming language.Java was developed by James Gosling at Sun Micro Systems in 1991.Java is based on mainly C and C++ Languages.</p><h3><strong>Java Attributes</strong></h3><ol><li>Familiar,Simple,Small</li></ol><p>2.Compiled and Interpreted</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*2j5wymmLjdhgewGijoOpXQ.png" /></figure><p>3.Platform-Independent and Portable</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*kufk7TnzZA8gvU21CwOkrA.png" /></figure><p>4.Object-Oriented</p><p>5.High performance</p><p>6.Dynamic and Extensible</p><p>7.Multi Functional</p><h3><strong>Java Development Kit</strong></h3><blockquote>javac- The java compiler</blockquote><blockquote>java-The java Interpreter</blockquote><blockquote>jdb-The java Debugger</blockquote><blockquote>appletviewer-Tool to run the applets</blockquote><blockquote>javap-To print the java Bytecodes</blockquote><blockquote>javaprof-Java profiler</blockquote><blockquote>javadoc-documentation generator</blockquote><blockquote>javah-creates C header files</blockquote><p>We can create java Source file in notepad,Dos edit etc…Source file should be saved with a.java extension.In compiling and Running the source file first we should set the Path.Assume you saved your source file in file D,as day1 c,saved name is FirstProgram then the path shows as bellow.</p><p>D:/day1&gt;Javac FirstProgram.java</p><p>here Javac is Java Compiler. Firstprogram.java is Source File name.</p><p>This is how it happens.You write your logic code in a Java File,Its converted into class file so that machine can read your logic and run it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1003/1*BhHuaHvViE47NtpErOrVrg.png" /></figure><p>Here I am going to write my First java programming.</p><pre>public class FirstProgramme{</pre><pre>public static void main(Stringargs[]){<br>System.out.println(&quot;Hello world&quot;);<br>}<br>}</pre><h4>Comments In Java</h4><pre>public class FirstProgramme{<br>public static void main(String args[]){</pre><pre>System.out.println(&quot;Comments in Java&quot;);</pre><pre>/*This is a multiple line comment*/</pre><pre>//This is use for single line comment<br>}<br>}</pre><p>So this is very short Introduction to java and Java compiling.So in my next article I hope to continue it with Java Data Types.All above codes are run by my self and they did work greatly.Thank you for reading.I hope you enjoyed it and got some idea about Java.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc9b16782e8f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>