<p><code>count</code> no longer has the value of <code>15</code> in it. There's no record of it! It has been overwritten with the value <code>55</code></p>
<h3>Primitive Types</h3>
<p>There are 8 primitive types in Java</p>
<ul>
<li>boolean</li>
<li>char</li>
<li>byte</li>
<li>short</li>
<li>int</li>
<li>long</li>
<li>float</li>
<li>double</li>
</ul>
<p>byte through double are all <em>numeric</em> types</p>
<h4>Boolean</h4>
<p><code>boolean</code> can only be equal to <code>true</code> or <code>false</code></p>
<p>The different numeric types determine the precision of your number. Since numbers are not represented the same in the computer as they are in real life, there are some approximations.</p>
<p>The default type you can use your code is <code>int</code> for integers and <code>double</code> for numbers with a decimal point</p>
<p>There are certain types of operations you can perform on numeric type</p>
<table>
<thead>
<tr>
<th>Symbol</th>
<th>Meaning</th>
<th>Example</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>+</td>
<td>addition</td>
<td>43 + 8</td>
<td>51</td>
</tr>
<tr>
<td>-</td>
<td>subtraction</td>
<td>43.0-8.0</td>
<td>35.0</td>
</tr>
<tr>
<td>*</td>
<td>multiplication</td>
<td>43 * 8</td>
<td>344</td>
</tr>
<tr>
<td>/</td>
<td>division</td>
<td>43.0 / 8.0</td>
<td>5.375</td>
</tr>
<tr>
<td>%</td>
<td>remainder / mod</td>
<td>43 % 8</td>
<td>3</td>
</tr>
<tr>
<td>-</td>
<td>unary minus</td>
<td>-43</td>
<td>-43</td>
</tr>
</tbody>
</table>
<h4>Increment/ Decrement</h4>
<p>There are two types of in/decrementers postfix and prefix</p>
<p>Postfix:</p>
<pre><codeclass="language-java">int x = 0;
int y = 7;
x++; // Shortcut for x = x + 1
y--; // Shortcut for y = y - 1</code></pre>
<p>Prefix</p>
<pre><codeclass="language-java">int x = 0, y = 7, z;
z = y * x++; // Equivalent to (y * x) + 1 = 7 * 0
z = y * ++x; // Equivalent to y * (x + 1) = 7 * 1</code></pre>
<h3>Data Conversion</h3>
<p>There are two types of data conversion, implicit and explicit</p>
<p>The compiler can perform implicit data conversion automatically.</p>
<p>Performing an explicit data conversion requires additional work on the programmer's part</p>
<p>A conversion is implicit if you do <strong>not</strong> lose any information in it</p>
<p>All you can do with <code>Scanner</code> is outlined in the Java API at this link <ahref="https://docs.oracle.com/javase/8/docs/api/index.html?java/util/Scanner.html">https://docs.oracle.com/javase/8/docs/api/index.html?java/util/Scanner.html</a></p>
<p>Create a Scanner object</p>
<pre><codeclass="language-java">Scanner input = new Scanner(System.in);
System.out.print("Please enter an integer: ");
price = input.nextInt(); // The integer that the user inputs is now stored in price