<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Java Archives - Cody Paste</title>
	<atom:link href="https://www.codypaste.com/category/android-development/java/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.codypaste.com/category/android-development/java/</link>
	<description>THE WEB PLAYGROUND</description>
	<lastBuildDate>Sun, 16 Oct 2016 21:29:02 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://www.codypaste.com/wp-content/uploads/2022/12/cropped-codypaste-32x32.png</url>
	<title>Java Archives - Cody Paste</title>
	<link>https://www.codypaste.com/category/android-development/java/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Basic points and Data Type in Java</title>
		<link>https://www.codypaste.com/basic-points-and-data-type-in-java/</link>
					<comments>https://www.codypaste.com/basic-points-and-data-type-in-java/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Sun, 16 Oct 2016 20:15:17 +0000</pubDate>
				<category><![CDATA[Android Development]]></category>
		<category><![CDATA[Java]]></category>
		<guid isPermaLink="false">http://www.codypaste.com/?p=535</guid>

					<description><![CDATA[<p>Data Type Type Explanation int A 32-bit (4-byte) integer value short A 16-bit (2-byte) integer value long A 64-bit (8-byte) integer value byte An 8-bit (1-byte) integer value float A 32-bit (4-byte) floating-point value double A 64-bit (8-byte) floating-point value char A 16-bit character using the Unicode encoding scheme boolean A true or false value &#8230; </p>
<p class="link-more"><a href="https://www.codypaste.com/basic-points-and-data-type-in-java/" class="more-link">read more<span class="screen-reader-text"> "Basic points and Data Type in Java"</span></a></p>
<p>The post <a href="https://www.codypaste.com/basic-points-and-data-type-in-java/">Basic points and Data Type in Java</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Data Type</h2>
<table class="table">
<tbody>
<tr>
<th>Type</th>
<th>Explanation</th>
</tr>
<tr>
<td><span class="code">int</span></td>
<td>A 32-bit (4-byte) integer value</td>
</tr>
<tr>
<td><span class="code">short</span></td>
<td>A 16-bit (2-byte) integer value</td>
</tr>
<tr>
<td><span class="code">long</span></td>
<td>A 64-bit (8-byte) integer value</td>
</tr>
<tr>
<td><span class="code">byte</span></td>
<td>An 8-bit (1-byte) integer value</td>
</tr>
<tr>
<td><span class="code">float</span></td>
<td>A 32-bit (4-byte) floating-point value</td>
</tr>
<tr>
<td><span class="code">double</span></td>
<td>A 64-bit (8-byte) floating-point value</td>
</tr>
<tr>
<td><span class="code">char</span></td>
<td>A 16-bit character using the Unicode encoding scheme</td>
</tr>
<tr>
<td><span class="code">boolean</span></td>
<td>A <span class="code">true</span> or <span class="code">false</span> value</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<h2>Implicit and explicit casting : Primitive Type Casting </h2>
<p>An <strong>implicit cast</strong> means you don&#8217;t have to write code for the cast</p>
<p>An <strong>implicit cast</strong> happens when you&#8217;re doing a widening conversion.</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">public class MainClass{
    public static void main(String[] argv){
        int a = 100;
        long b = a; // Implicit cast, an int value always fits in a long
    }
}</pre><p></p>
<p>An <strong>explicit casts</strong> looks like this:</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">public class MainClass{
    public static void main(String[] argv){
        float a = 100.001f;
        int b = (int)a; // Explicit cast, the float could lose info
    }
}</pre><p></p>
<h2>Impossible Conversions</h2>
<ul>
<li>Any primitive type to any reference type</li>
<li>The null value to any primitive type</li>
<li>Any primitive to boolean</li>
<li>A boolean to any primitive</li>
</ul>
<p>&nbsp;</p>
<h1 style="text-align: left;" align="center">The Remainder or Modulus Operator in Java</h1>
<p>Java has one important arithmetical operator you may not be familiar with, <code>%</code>, also known as the modulus or remainder operator. The <code>%</code> operator returns the remainder of two numbers. For instance <code>10 % 3</code> is 1 because 10 divided by 3 leaves a remainder of 1. You can use <code>%</code> just as you might use any other more common operator like <code>+</code> or <code>-</code>.</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">class Remainder {

  public static void main (String args[]) {

    int i = 10;
    int j = 3;

    System.out.println(&quot;i is &quot; + i);
    System.out.println(&quot;j is &quot; + j);
  
    int k = i % j;
    System.out.println(&quot;i%j is &quot; + k);
  }

}</pre><p></p>
<p>Here&#8217;s the output:</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">&lt;samp&gt;% javac Remainder.java
% java Remainder
i is 10
j is 3
i%j is 1
&lt;/samp&gt;</pre><p></p>
<p>Perhaps surprisingly the remainder operator can be used with floating point values as well. It&#8217;s surprising because you don&#8217;t normally think of real number division as producing remainders. However there are rare times when it&#8217;s useful to ask exactly how many times does 1.5 go into 5.5 and what&#8217;s left over? The answer is that 1.5 goes into 5.5 three times with one left over, and it&#8217;s that one which is the result of 5.5 % 1.5 in Java.</p>
<p>The post <a href="https://www.codypaste.com/basic-points-and-data-type-in-java/">Basic points and Data Type in Java</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codypaste.com/basic-points-and-data-type-in-java/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Compile and Run Java</title>
		<link>https://www.codypaste.com/compile-and-run-java/</link>
					<comments>https://www.codypaste.com/compile-and-run-java/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Sun, 16 Oct 2016 19:56:00 +0000</pubDate>
				<category><![CDATA[Android Development]]></category>
		<category><![CDATA[Java]]></category>
		<guid isPermaLink="false">http://www.codypaste.com/?p=531</guid>

					<description><![CDATA[<p>Compile: Type &#8216;javac&#8217; space file name &#8216;demo.java&#8217; : D:\java-test&#62;javac demo.java Run: Type java space demo. will output Hello java!</p>
<p>The post <a href="https://www.codypaste.com/compile-and-run-java/">Compile and Run Java</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><strong>Compile:</strong></h2>
<p>Type <strong>&#8216;javac&#8217;</strong> space file name <strong>&#8216;demo.java&#8217; : </strong><em>D:\java-test&gt;javac demo.java</em></p>
<p><a href="http://www.codypaste.com/wp-content/uploads/2016/10/cmd-window-3.png"><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-532" src="http://www.codypaste.com/wp-content/uploads/2016/10/cmd-window-3.png" alt="cmd-window-3" width="479" height="388" /></a></p>
<h2>Run:</h2>
<p>Type <strong>java</strong> space <strong>demo. </strong>will output<strong> Hello java!</strong></p>
<p><a href="http://www.codypaste.com/wp-content/uploads/2016/10/cmd-window-4.png"><img decoding="async" class="alignnone size-full wp-image-533" src="http://www.codypaste.com/wp-content/uploads/2016/10/cmd-window-4.png" alt="cmd-window-4" width="489" height="278" /></a></p>
<p>The post <a href="https://www.codypaste.com/compile-and-run-java/">Compile and Run Java</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codypaste.com/compile-and-run-java/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Write First Program and Installation testing in Java</title>
		<link>https://www.codypaste.com/write-first-program-and-installation-testing-in-java/</link>
					<comments>https://www.codypaste.com/write-first-program-and-installation-testing-in-java/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Sun, 16 Oct 2016 19:31:09 +0000</pubDate>
				<category><![CDATA[Android Development]]></category>
		<category><![CDATA[Java]]></category>
		<guid isPermaLink="false">http://www.codypaste.com/?p=525</guid>

					<description><![CDATA[<p>Now we are going to write our first program , So just open any text editor or you can use Dreamweaver also to write Java program. Step 1 : So just write this: [crayon-69ab95e2800ab407303575/] Now save this file with .java extension e.g. demo.java at any location/Folder. For example you save file in &#8216;D&#8217; drive &#8216;java-test&#8217; Folder &#8230; </p>
<p class="link-more"><a href="https://www.codypaste.com/write-first-program-and-installation-testing-in-java/" class="more-link">read more<span class="screen-reader-text"> "Write First Program and Installation testing in Java"</span></a></p>
<p>The post <a href="https://www.codypaste.com/write-first-program-and-installation-testing-in-java/">Write First Program and Installation testing in Java</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Now we are going to write our first program , So just open any text editor or you can use Dreamweaver also to write Java program.</p>
<p><strong>Step 1 :</strong> So just write this:</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">public class demo {

public static void main (String[]args) {
System.out.println("Hello Java!");
}
}</pre><p></p>
<p>Now save this file with <strong>.java </strong>extension e.g. <strong>demo.java </strong>at any location/Folder. For example you save file in <strong>&#8216;D&#8217;</strong> drive <strong>&#8216;java-test&#8217;</strong> Folder <strong>&#8216;demo.java&#8217;. </strong>D:\java-test\demo.java</p>
<p><strong>Step 2 :</strong> Now run &#8216;cmd&#8217; : press <strong>window+R</strong> and type <strong>cmd</strong> and enter. Command prompt will open.</p>
<p><a href="http://www.codypaste.com/wp-content/uploads/2016/10/cmd.png" target="_blank"><img decoding="async" class="alignnone size-full wp-image-526" src="http://www.codypaste.com/wp-content/uploads/2016/10/cmd.png" alt="cmd" width="627" height="298" /><br /></a><a href="http://www.codypaste.com/wp-content/uploads/2016/10/cmd-window.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-527" src="http://www.codypaste.com/wp-content/uploads/2016/10/cmd-window.png" alt="cmd-window" width="1029" height="557" /></a></p>
<p><strong>Step 3 :</strong> Now change folder location in cmd so java file can run so just type drive name e.g.<br />C:\Users\vipulrai&gt;<strong>d:</strong></p>
<p><strong>Step 4 :</strong> Go to Folder <strong>&#8216;java-test&#8217;</strong> in cmd</p>
<p><a href="http://www.codypaste.com/wp-content/uploads/2016/10/cmd-window-2.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-529" src="http://www.codypaste.com/wp-content/uploads/2016/10/cmd-window-2.png" alt="cmd-window-2" width="556" height="309" /></a></p>
<p>&nbsp;</p>
<p><a href="http://www.codypaste.com/java-installation/">Previous</a>    |     <a href="http://www.codypaste.com/compile-and-run-java/" target="_blank">Next</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The post <a href="https://www.codypaste.com/write-first-program-and-installation-testing-in-java/">Write First Program and Installation testing in Java</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codypaste.com/write-first-program-and-installation-testing-in-java/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Java Installation</title>
		<link>https://www.codypaste.com/java-installation/</link>
					<comments>https://www.codypaste.com/java-installation/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Sun, 16 Oct 2016 18:52:22 +0000</pubDate>
				<category><![CDATA[Android Development]]></category>
		<category><![CDATA[Java]]></category>
		<guid isPermaLink="false">http://www.codypaste.com/?p=521</guid>

					<description><![CDATA[<p>Install java jdk 1. Java SE Development Kit 8 Downloads The JDK is a development environment for building applications, applets, and components using the Java programming language. The JDK includes tools useful for developing and testing programs written in the Java programming language and running on the Java platform. &#160; 2. Now Install jdk &#160; &#8230; </p>
<p class="link-more"><a href="https://www.codypaste.com/java-installation/" class="more-link">read more<span class="screen-reader-text"> "Java Installation"</span></a></p>
<p>The post <a href="https://www.codypaste.com/java-installation/">Java Installation</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1>Install java jdk</h1>
<h1>1. Java SE Development Kit 8 <a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html" target="_blank" rel="nofollow">Downloads</a></h1>
<p>The JDK is a development environment for building applications, applets, and components using the Java programming language.</p>
<p>The JDK includes tools useful for developing and testing programs written in the Java programming language and running on the Java platform.</p>
<p>&nbsp;</p>
<h1>2. Now Install jdk</h1>
<p>&nbsp;</p>
<h1>3. Paste URL Path to window so &#8216;cmd&#8217; can read/execute java</h1>
<p>Step 1 : Go to &#8216;C:\Program Files\Java\jdk1.8.0_102\bin&#8217; Copy this path.</p>
<p>Step 2 : Now, right click on <strong>&#8216;My Computer/This PC&#8217;</strong></p>
<p>Step 3 : click on <strong>&#8216;Properties&#8217; </strong>then</p>
<p>Step 4 : find on top right hand side &#8216;<strong>Advanced System Settings</strong>&#8216;</p>
<p>Step 5 : Click on <strong>&#8216;Environment Variables&#8217;  </strong></p>
<p>Step 6 : Find Variable <strong>&#8216;path&#8217;</strong> and double click on path a window will open with one path</p>
<p>Step 7 : Just add the path with semi colon which we copy on step 1.  <br />e.g. <strong>;C:\Program Files\Java\jdk1.8.0_102\bin </strong>so final path in this box will be like this: <em>C:\ProgramData\Oracle\Java\javapath;%C_EM64T_REDIST11%bin\Intel64;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\Java\jdk1.8.0_102\bin</em></p>
<p><a href="http://www.codypaste.com/wp-content/uploads/2016/10/install-java.jpg"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-522" src="http://www.codypaste.com/wp-content/uploads/2016/10/install-java.jpg" alt="install-java" width="1366" height="768" /></a></p>
<h2><a href="http://www.codypaste.com/write-first-program-and-installation-testing-in-java/">Next</a></h2>
<p>The post <a href="https://www.codypaste.com/java-installation/">Java Installation</a> appeared first on <a href="https://www.codypaste.com">Cody Paste</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.codypaste.com/java-installation/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
