<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Hanna</title>
    <description>The latest articles on Forem by Hanna (@hannalog).</description>
    <link>https://forem.com/hannalog</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3800821%2F8b52104b-b7bd-405f-b900-5986a1ba595c.jpg</url>
      <title>Forem: Hanna</title>
      <link>https://forem.com/hannalog</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/hannalog"/>
    <language>en</language>
    <item>
      <title>📝 07-1. Java Practice: Nested If-Statements &amp; Data Conversion (Login Logic!)</title>
      <dc:creator>Hanna</dc:creator>
      <pubDate>Wed, 18 Mar 2026 04:10:33 +0000</pubDate>
      <link>https://forem.com/hannalog/07-1-java-practice-nested-if-statements-data-conversion-login-logic-37d5</link>
      <guid>https://forem.com/hannalog/07-1-java-practice-nested-if-statements-data-conversion-login-logic-37d5</guid>
      <description>&lt;p&gt;● Study period: 260313&lt;br&gt;
● Study scope: Honja 3-01,02 part operator part&lt;/p&gt;

&lt;p&gt;Today, I worked through some practice exercises. It was a bit overwhelming at first, but seeing the code come together so cleanly was super satisfying! Here are the key takeaways from my session.&lt;/p&gt;


&lt;h3&gt;
  
  
  1. Direct Data Conversion in One Line
&lt;/h3&gt;

&lt;p&gt;Instead of creating a separate &lt;code&gt;String&lt;/code&gt; variable to store and then convert input, I learned that you can pass the input directly into the conversion method!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;num1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Double&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;parseDouble&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;scanner&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;nextLine&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Why it's cool:&lt;/strong&gt; It immediately feeds the &lt;code&gt;scanner.nextLine()&lt;/code&gt; output into &lt;code&gt;Double.parseDouble()&lt;/code&gt;. This makes the code much more concise and efficient.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Handling 0.0 and Infinity (Division Safety)
&lt;/h3&gt;

&lt;p&gt;I learned that &lt;code&gt;0&lt;/code&gt; and &lt;code&gt;0.0&lt;/code&gt; are essentially treated as the same value in this context. It's crucial to use an &lt;code&gt;if&lt;/code&gt; statement to prevent dividing by zero, which is a big "no-no" in programming.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num2&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Result: "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num1&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;num2&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;print&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Result: Infinity"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;By checking if &lt;code&gt;num2&lt;/code&gt; is not 0.0, we can safely perform the division. If it is 0.0, it simply prints "Infinity." Using &lt;code&gt;if&lt;/code&gt; for exception handling is so useful! (Though nested &lt;code&gt;if&lt;/code&gt; statements still give me a headache... lol)&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  3. Combining Strings to Create Numeric Values
&lt;/h3&gt;

&lt;p&gt;I found this specific piece of logic really clever:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;var4&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;var1&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;var2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nc"&gt;Double&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;parseDouble&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;var2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"."&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;var3&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;It combines &lt;code&gt;var2&lt;/code&gt;, a dot &lt;code&gt;.&lt;/code&gt;, and &lt;code&gt;var3&lt;/code&gt; to create a string like &lt;code&gt;"3.14"&lt;/code&gt;, then converts that entire string into a double for the calculation. I wasn't sure if you could mix strings into a numeric calculation like that, but this conversion makes it possible!&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  4. Creating Login Logic with Nested If-Statements
&lt;/h3&gt;

&lt;p&gt;This exercise required both the ID and Password to be correct to "log in." Seeing the solution finally made it click for me.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;equals&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"java"&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// Step 1: Check ID&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;password&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;12345&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// Step 2: Check Password&lt;/span&gt;
        &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Login Successful"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Login Failed: Wrong Password"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Login Failed: ID does not exist"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Lessons Learned:&lt;/strong&gt; * Always use &lt;code&gt;.equals()&lt;/code&gt; instead of &lt;code&gt;==&lt;/code&gt; when comparing strings!

&lt;ul&gt;
&lt;li&gt;I struggled at first because I tried to use &lt;code&gt;=&lt;/code&gt; inside the &lt;code&gt;if&lt;/code&gt; parentheses, but I realized the structure itself handles the logic without extra assignment symbols.&lt;/li&gt;
&lt;li&gt;Nested structures (an &lt;code&gt;if&lt;/code&gt; inside an &lt;code&gt;if&lt;/code&gt;) are still a bit dizzying, but I'm getting used to the flow.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  🏁 Final Thoughts
&lt;/h3&gt;

&lt;p&gt;Through these exercises, I realized there's a huge difference between understanding the concept and actually writing the code. Making mistakes now is the best way to ensure I don't make them later in the field! Another productive day in the books.&lt;/p&gt;

</description>
      <category>java</category>
      <category>beginners</category>
      <category>learningtocode</category>
      <category>webdev</category>
    </item>
    <item>
      <title>📝 07. Java Operators: More Than Just Math (and Why Java Feels "Human")</title>
      <dc:creator>Hanna</dc:creator>
      <pubDate>Wed, 18 Mar 2026 04:03:06 +0000</pubDate>
      <link>https://forem.com/hannalog/07-java-operators-more-than-just-math-and-why-java-feels-human-51kp</link>
      <guid>https://forem.com/hannalog/07-java-operators-more-than-just-math-and-why-java-feels-human-51kp</guid>
      <description>&lt;p&gt;● Study period: 260313&lt;br&gt;
● Study scope: Honja 3-01,02 part operator part&lt;/p&gt;

&lt;p&gt;Today, I dived into Java operators. I encountered some unfamiliar types and learned about their real-world applications. Here’s a summary of what I covered!&lt;/p&gt;




&lt;h3&gt;
  
  
  1. Essential Operators You Need to Know
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;% (Remainder Operator):&lt;/strong&gt; It gives you the "leftover" value after division.

&lt;ul&gt;
&lt;li&gt;I used to think this was useless, but it’s actually super handy for &lt;strong&gt;distinguishing between even/odd numbers&lt;/strong&gt; or &lt;strong&gt;checking for multiples&lt;/strong&gt; in practice.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Logical Operators (&amp;amp;&amp;amp;, ||, ^, !)&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt;, &lt;code&gt;&amp;amp;&lt;/code&gt; (AND): Returns true only if &lt;strong&gt;both&lt;/strong&gt; conditions are met.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;||&lt;/code&gt;, &lt;code&gt;|&lt;/code&gt; (OR): Returns true if &lt;strong&gt;at least one&lt;/strong&gt; condition is met.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;^&lt;/code&gt; (XOR): Returns true only if the two values are &lt;strong&gt;different&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;!&lt;/code&gt;, &lt;code&gt;!=&lt;/code&gt; (NOT): Reverses the result (Negation).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The "!" (Exclamation Mark) is crucial:&lt;/strong&gt; It's used constantly—for example, "If NOT logged in (!isLoggedIn), block the page." It's a bit of a brain teaser, but I need to master this now so I don't get confused later in the field!&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Increment &amp;amp; Decrement Operators (++, --)
&lt;/h3&gt;

&lt;p&gt;These are tricky because their value changes depending on whether you put them before or after the variable.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;++x (Prefix):&lt;/strong&gt; The value is incremented &lt;strong&gt;first&lt;/strong&gt;, then used in the expression.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;x++ (Postfix):&lt;/strong&gt; The current value is used &lt;strong&gt;first&lt;/strong&gt;, then incremented later.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;💡 Real-world Example:&lt;/strong&gt;&lt;br&gt;
I understood this better when I thought about an AI picking up game items and filling slots sequentially, or managing queue numbers. While &lt;code&gt;x++;&lt;/code&gt; and &lt;code&gt;++x;&lt;/code&gt; act the same when used alone, they behave completely differently when used with an assignment operator, like &lt;code&gt;z = x++;&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  3. The Betrayal of Floating Points: Why &lt;code&gt;0.1 == 0.1f&lt;/code&gt; is False
&lt;/h3&gt;

&lt;p&gt;This was the most surprising part of today's study.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Computers speak Binary:&lt;/strong&gt; Decimal numbers that don't terminate in binary are inherently imprecise.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;double vs float:&lt;/strong&gt; A &lt;code&gt;double&lt;/code&gt; has more precision than a &lt;code&gt;float&lt;/code&gt;. Therefore, a &lt;code&gt;0.1&lt;/code&gt; stored as a double is slightly different from a &lt;code&gt;0.1&lt;/code&gt; stored as a float. Even if you move a float value into a double "container," the precision doesn't magically increase!&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  🤖 Computers Are Kind of Human?
&lt;/h4&gt;

&lt;p&gt;Interestingly, computers love floating-point numbers that terminate perfectly in binary.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Examples: 1.0, 0.5, 0.25, 0.125 (powers of 2).&lt;/li&gt;
&lt;li&gt;These have zero error, so comparing an &lt;code&gt;int&lt;/code&gt; to a &lt;code&gt;double&lt;/code&gt; for these values returns &lt;code&gt;true&lt;/code&gt;. It reminded me of my part-time job at the convenience store—I love it when customers give me the exact change so I don't have to deal with coins. Computers are the same! lol.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  4. Review Points (My "Oops" Note)
&lt;/h3&gt;

&lt;h4&gt;
  
  
  ❌ char Operation Errors
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;char c3 = (char)c2 + 1;&lt;/code&gt; -&amp;gt; &lt;strong&gt;Error!&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Why?&lt;/strong&gt; Even if you cast &lt;code&gt;c2&lt;/code&gt; to a &lt;code&gt;char&lt;/code&gt;, adding the &lt;code&gt;int&lt;/code&gt; 1 turns the whole result back into an &lt;code&gt;int&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;
&lt;code&gt;char c3 = (char)(c2 + 1);&lt;/code&gt; -&amp;gt; &lt;strong&gt;Correct!&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;You have to wrap the whole expression in parentheses to cast the final result back to a &lt;code&gt;char&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  ❌ The float Division Surprise
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;float var2 = var1 / 100;&lt;/code&gt; (where var1 is a float)

&lt;ul&gt;
&lt;li&gt;I thought this might cause an error since Java’s default for decimals is &lt;code&gt;double&lt;/code&gt;. However, since &lt;code&gt;float / int&lt;/code&gt; results in a &lt;code&gt;float&lt;/code&gt;, it fits perfectly into the float variable &lt;code&gt;var2&lt;/code&gt;. Good to know!&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  ❌ Other Weak Spots
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;I keep making mistakes with the &lt;code&gt;!&lt;/code&gt; (NOT) operator—need more practice.&lt;/li&gt;
&lt;li&gt;Nested &lt;code&gt;if&lt;/code&gt; statements with multiple parentheses still make my head spin.&lt;/li&gt;
&lt;li&gt;I need to review &lt;code&gt;Double.parseDouble()&lt;/code&gt; for converting strings to data.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🏁 Wrapping Up
&lt;/h3&gt;

&lt;p&gt;The problems are getting spicier as I move through the operators. My head hurts a bit. 😭 Can I really finish this whole book on time? Can I even make it through the first read-through? Let's stay focused. Fighting! 🔥&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>java</category>
      <category>learning</category>
      <category>programming</category>
    </item>
    <item>
      <title>📝 06. Java Self-Study: Variables &amp; System I/O</title>
      <dc:creator>Hanna</dc:creator>
      <pubDate>Wed, 18 Mar 2026 04:01:13 +0000</pubDate>
      <link>https://forem.com/hannalog/06-java-self-study-variables-system-io-22p7</link>
      <guid>https://forem.com/hannalog/06-java-self-study-variables-system-io-22p7</guid>
      <description>&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Date:&lt;/strong&gt; 2026-03-12&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Topic:&lt;/strong&gt; Chapter02_sec04 (Variables and System I/O)&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  1. System I/O (System.in / System.out)
&lt;/h3&gt;

&lt;p&gt;I finally understand the meaning behind &lt;code&gt;System.out.println()&lt;/code&gt;, which I had been using without much thought.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;System.out (Standard Output):&lt;/strong&gt; Monitor&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;System.in (Standard Input):&lt;/strong&gt; Keyboard&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Output Methods: print, println, and printf
&lt;/h3&gt;

&lt;p&gt;There are more ways to output data than just &lt;code&gt;println&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;print():&lt;/strong&gt; Outputs content without a newline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;println():&lt;/strong&gt; Outputs content and moves to the next line.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;printf():&lt;/strong&gt; Outputs formatted content. This is essential for controlling decimal places or aligning data in professional projects.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  💡 Understanding the Format Specifier: &lt;code&gt;%-10.2f&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;It looked complicated at first, but it's actually quite logical:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;%&lt;/code&gt;: Start of the format specifier.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-&lt;/code&gt;: Left-aligned (remaining space on the right is filled with blanks).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;10&lt;/code&gt;: Total width (occupies 10 spaces, including the decimal point).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.2&lt;/code&gt;: Limits the output to 2 decimal places.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;f&lt;/code&gt;: Formats the value as a floating-point number.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; You can specify the order using &lt;code&gt;%1$d, %2$s&lt;/code&gt;, but Java is smart enough to match them in order automatically. Manual ordering is only necessary when reusing the same variable or changing the sequence.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  3. Keyboards and KeyCodes
&lt;/h3&gt;

&lt;p&gt;Computers process numbers faster than characters, so every key on a keyboard is assigned a unique number called a &lt;strong&gt;KeyCode&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;System.in.read()&lt;/code&gt;: Reads a single KeyCode.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Important:&lt;/strong&gt; When using this, you must include &lt;code&gt;throws Exception&lt;/code&gt;. It’s like a safety valve where Java "passes the buck" if something goes wrong with the input.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pro Tip:&lt;/strong&gt; Experienced developers often use &lt;code&gt;try-catch&lt;/code&gt; blocks instead of &lt;code&gt;throws&lt;/code&gt; to handle errors gracefully and provide helpful feedback to the user.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  4. Scanner: A Smarter Way to Handle Input
&lt;/h3&gt;

&lt;p&gt;Since KeyCodes only read one byte at a time, they struggle with multi-byte characters like Korean. That's where the &lt;code&gt;Scanner&lt;/code&gt; class comes in.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Setup:&lt;/strong&gt; &lt;code&gt;import java.util.Scanner;&lt;/code&gt; (Like taking a tool out of the Java storage room).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shortcut:&lt;/strong&gt; In Eclipse, pressing &lt;code&gt;Ctrl + Shift + O&lt;/code&gt; automatically manages your imports.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  🏗️ Reference Types and the &lt;code&gt;new&lt;/code&gt; Operator
&lt;/h4&gt;

&lt;p&gt;Unlike basic types like &lt;code&gt;int&lt;/code&gt;, &lt;code&gt;Scanner&lt;/code&gt; is a &lt;strong&gt;Reference Type (Class)&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Class:&lt;/strong&gt; A "blueprint" for creating an object.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;new:&lt;/strong&gt; A command to actually build the object in memory based on that blueprint.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scanner(System.in):&lt;/strong&gt; "Build a scanner that is connected to the keyboard."&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Breaking down the code:&lt;/strong&gt; &lt;code&gt;Scanner scanner = new Scanner(System.in);&lt;/code&gt;&lt;br&gt;
-&amp;gt; "Create a physical scanner object that reads from the keyboard and store it in the box named 'scanner'!"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;scanner.nextLine()&lt;/code&gt;: Very convenient because it reads an entire line until you hit Enter.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🏁 Wrapping Up
&lt;/h3&gt;

&lt;p&gt;Learning how data is formatted and how keyboard input is stored in variables was fascinating. It feels like I'm finally learning features that are used in the real world. That's the end of Section 2 (Variables)! Starting Section 3 (Operators) tomorrow. 🔥&lt;/p&gt;

</description>
      <category>java</category>
      <category>beginners</category>
      <category>learningtocode</category>
      <category>webdev</category>
    </item>
    <item>
      <title>🧐 05. Surprised by Java’s Precision: Type Conversion and Calculation Traps</title>
      <dc:creator>Hanna</dc:creator>
      <pubDate>Wed, 18 Mar 2026 03:28:03 +0000</pubDate>
      <link>https://forem.com/hannalog/05-surprised-by-javas-precision-type-conversion-and-calculation-traps-kcj</link>
      <guid>https://forem.com/hannalog/05-surprised-by-javas-precision-type-conversion-and-calculation-traps-kcj</guid>
      <description>&lt;p&gt;● The study period: 3/6 to 3/12&lt;br&gt;
● Research Range: Chapter02_sec03&lt;/p&gt;

&lt;p&gt;After mastering primitive types, I moved on to &lt;strong&gt;"Type Conversion."&lt;/strong&gt; It sounded complex at first, but the principle is surprisingly intuitive: It’s all about the size of the "containers."&lt;/p&gt;
&lt;h3&gt;
  
  
  1. "A Large Container Holds a Small One" (Promotion)
&lt;/h3&gt;

&lt;p&gt;Automatic Type Conversion (Promotion) occurs when a smaller data type is stored in a larger one. Java handles this seamlessly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Size Order:&lt;/strong&gt; &lt;code&gt;byte&lt;/code&gt; &amp;lt; &lt;code&gt;short&lt;/code&gt; &amp;lt; &lt;code&gt;int&lt;/code&gt; &amp;lt; &lt;code&gt;long&lt;/code&gt; &amp;lt; &lt;code&gt;float&lt;/code&gt; &amp;lt; &lt;code&gt;double&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;For example, if you put the integer &lt;code&gt;2&lt;/code&gt; into a &lt;code&gt;double&lt;/code&gt; variable, Java automatically saves it as &lt;code&gt;2.0&lt;/code&gt;.&lt;br&gt;
&lt;strong&gt;The Catch:&lt;/strong&gt; &lt;code&gt;byte&lt;/code&gt; or &lt;code&gt;short&lt;/code&gt; cannot be automatically converted to &lt;code&gt;char&lt;/code&gt;. Since &lt;code&gt;char&lt;/code&gt; is an "unsigned" (positive-only) type, Java—the strict perfectionist—refuses to allow it unless it’s 100% certain.&lt;/p&gt;
&lt;h3&gt;
  
  
  2. "Force It to Fit" (Casting)
&lt;/h3&gt;

&lt;p&gt;Sometimes we need to squeeze data from a large container into a smaller one. This is &lt;strong&gt;Explicit Conversion (Casting)&lt;/strong&gt;. It’s like telling Java, "I'll take responsibility, so trim this down and fit it in!"&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;intValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;65&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;charValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="n"&gt;intValue&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Explicit Casting&lt;/span&gt;
&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;charValue&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;    &lt;span class="c1"&gt;// Output: A&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Even though I started with a number, looking through the &lt;code&gt;char&lt;/code&gt; "glasses" revealed the character 'A'. One thing to remember: when converting a decimal to an integer, everything below the decimal point is &lt;strong&gt;chopped off&lt;/strong&gt; (truncated).&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Why Java Turns 0.5 into 0.0
&lt;/h3&gt;

&lt;p&gt;This was the most "shocking" part of today’s study.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Result: 0.0 (Not 0.5!)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I expected &lt;code&gt;0.5&lt;/code&gt;, but got &lt;code&gt;0.0&lt;/code&gt;. Why? Because of &lt;strong&gt;Integer Division&lt;/strong&gt;.&lt;br&gt;
Since both &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt; are &lt;code&gt;int&lt;/code&gt;, Java performs the calculation first, discards the remainder, and keeps only the integer &lt;code&gt;0&lt;/code&gt;. Only &lt;em&gt;after&lt;/em&gt; that is the result stored in the &lt;code&gt;double&lt;/code&gt; container, turning it into &lt;code&gt;0.0&lt;/code&gt;.&lt;br&gt;
&lt;strong&gt;Solution:&lt;/strong&gt; To get &lt;code&gt;0.5&lt;/code&gt;, at least one operand must be cast to &lt;code&gt;(double)&lt;/code&gt; &lt;em&gt;before&lt;/em&gt; the calculation. Java decides the result's type before it even finishes the math.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. The &lt;code&gt;byte&lt;/code&gt; Puzzle: &lt;code&gt;10 + 20&lt;/code&gt; vs. &lt;code&gt;x + y&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;I noticed another quirk in Java’s strictness:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;byte result = 10 + 20;&lt;/code&gt; (&lt;strong&gt;Success&lt;/strong&gt;: The values are fixed constants!)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;byte x = 10; byte y = 20; byte result = x + y;&lt;/code&gt; (&lt;strong&gt;Error!&lt;/strong&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Why? Because &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt; are variables. Java thinks, "Since these values could change anytime, I’ll safely process their sum as an &lt;code&gt;int&lt;/code&gt;." Trying to shove that &lt;code&gt;int&lt;/code&gt; result back into a tiny &lt;code&gt;byte&lt;/code&gt; causes a conflict.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Takeaway: Developers Must Foresee the Result
&lt;/h3&gt;

&lt;p&gt;Learning type conversion taught me that a developer must anticipate the resulting type of every expression &lt;em&gt;before&lt;/em&gt; writing the code.&lt;/p&gt;

&lt;p&gt;Simply assuming "it'll work out" can lead to data errors or precision loss. Java’s logic is incredibly tight, and while it requires meticulous attention, I'm finding myself more and more drawn to its consistent and predictable nature.&lt;/p&gt;

</description>
      <category>java</category>
      <category>beginners</category>
      <category>learningtocode</category>
      <category>webdev</category>
    </item>
    <item>
      <title>🧐 04. Surprised by Java’s Honesty: Primitive Types and Memory Logic</title>
      <dc:creator>Hanna</dc:creator>
      <pubDate>Wed, 18 Mar 2026 03:26:05 +0000</pubDate>
      <link>https://forem.com/hannalog/04-surprised-by-javas-honesty-primitive-types-and-memory-logic-4de6</link>
      <guid>https://forem.com/hannalog/04-surprised-by-javas-honesty-primitive-types-and-memory-logic-4de6</guid>
      <description>&lt;p&gt;● Study period: 3/6 to 3/12&lt;br&gt;
● Study scope: Chapter02_sec02&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdaouc7ozjgdb20gk04n5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdaouc7ozjgdb20gk04n5.png" alt=" " width="800" height="202"&gt;&lt;/a&gt;&lt;br&gt;
While starting my Java journey, the first thing I noticed was the absolute &lt;strong&gt;"Honesty"&lt;/strong&gt; of the computer. Unlike human conversation, where context and nuance fill the gaps, a computer refuses to work (throws an error) if even the smallest rule is broken.&lt;/p&gt;

&lt;p&gt;Understanding &lt;strong&gt;"Types"&lt;/strong&gt; is the key to giving this honest machine clear instructions. Here’s what I’ve learned about how Java handles data.&lt;/p&gt;
&lt;h3&gt;
  
  
  1. Why is English the Language of IT? (ASCII &amp;amp; Unicode)
&lt;/h3&gt;

&lt;p&gt;I grew curious: "Why are most programming languages based on English?"&lt;br&gt;
Beyond historical reasons, I found the &lt;strong&gt;'Economic Efficiency of the Alphabet'&lt;/strong&gt; fascinating. Unlike complex characters in Korean or Chinese, the English alphabet fits perfectly within 128 characters (ASCII), making it optimal for early computing environments with limited memory.&lt;/p&gt;

&lt;p&gt;This curiosity motivated me to understand Java’s &lt;code&gt;char&lt;/code&gt; type (2 bytes, Unicode), which was designed to bridge that gap and embrace global languages.&lt;/p&gt;
&lt;h3&gt;
  
  
  2. [Key Point] Types are "Glasses" for Data
&lt;/h3&gt;

&lt;p&gt;The most interesting part was the relationship between &lt;code&gt;char&lt;/code&gt; and &lt;code&gt;int&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;var1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sc"&gt;'A'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Stores Unicode 65&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;var2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sc"&gt;'A'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// Stores Unicode 65&lt;/span&gt;

&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;var1&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: A&lt;/span&gt;
&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;var2&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: 65&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Internally, both variables store the number &lt;strong&gt;65&lt;/strong&gt;. However, Java interprets this data through the "glasses" of its Type:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;char&lt;/code&gt; glasses:&lt;/strong&gt; "Find Unicode 65 and show me the character shape 'A'!"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;int&lt;/code&gt; glasses:&lt;/strong&gt; "This is an integer, so just show me the number 65."&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I realized that single quotes (&lt;code&gt;' '&lt;/code&gt;) act as a &lt;strong&gt;Translation Switch&lt;/strong&gt;, telling Java to handle the character mapping for us so we don't have to memorize every Unicode number.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Why &lt;code&gt;double&lt;/code&gt; is the Default for Decimals: Reliability &amp;gt; Efficiency
&lt;/h3&gt;

&lt;p&gt;While &lt;code&gt;int&lt;/code&gt; (4 bytes) is the default for integers, why is the 8-byte &lt;code&gt;double&lt;/code&gt; the default for decimals instead of the 4-byte &lt;code&gt;float&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;The answer is &lt;strong&gt;Precision&lt;/strong&gt;. In decimal calculations, accuracy is everything. Java chooses data reliability over saving a few bytes of memory. Using suffixes like &lt;code&gt;L&lt;/code&gt; or &lt;code&gt;f&lt;/code&gt; is a way of giving Java explicit guidance—a habit I’m building to write clearer code for my future teammates.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. &lt;code&gt;char&lt;/code&gt; vs. &lt;code&gt;String&lt;/code&gt;: Fundamentally Different
&lt;/h3&gt;

&lt;p&gt;I learned that handling a single character (&lt;code&gt;char&lt;/code&gt;) and a string of text (&lt;code&gt;String&lt;/code&gt;) are entirely different concepts in Java:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;char&lt;/code&gt;:&lt;/strong&gt; A Primitive Type. Stored as a Unicode number, allowing for calculations. Uses &lt;code&gt;' '&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;String&lt;/code&gt;:&lt;/strong&gt; A Reference Type. Treated as an Object and fundamentally different from numbers. Uses &lt;code&gt;" "&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Understanding that comparing their "size" (e.g., &lt;code&gt;char &amp;lt; String&lt;/code&gt;) is logically impossible was a crucial takeaway.&lt;/p&gt;

&lt;h3&gt;
  
  
  Final Thoughts
&lt;/h3&gt;

&lt;p&gt;Computers are honest and literal. By mastering data types, I’m learning how to communicate with them without any "lost in translation" moments. My goal is to move beyond just writing code that works, toward writing code that is &lt;strong&gt;explicit and reliable&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>java</category>
      <category>beginners</category>
      <category>learningtocode</category>
      <category>webdev</category>
    </item>
    <item>
      <title>📦 03. Variables in Java: It's Not Just Math, It's About Storage and Decision Making</title>
      <dc:creator>Hanna</dc:creator>
      <pubDate>Wed, 18 Mar 2026 03:09:05 +0000</pubDate>
      <link>https://forem.com/hannalog/03-variables-in-java-its-not-just-math-its-about-storage-and-decision-making-2dco</link>
      <guid>https://forem.com/hannalog/03-variables-in-java-its-not-just-math-its-about-storage-and-decision-making-2dco</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkrgnslk0so5fq47i9ae9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkrgnslk0so5fq47i9ae9.png" alt=" " width="800" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvfssxufxa4dsg9ufcfex.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvfssxufxa4dsg9ufcfex.png" alt=" " width="800" height="488"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftmol7sgpop2ffzzg04y1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftmol7sgpop2ffzzg04y1.png" alt=" " width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5h5r1hklk1lahs3mft35.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5h5r1hklk1lahs3mft35.png" alt=" " width="800" height="330"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;● Study period: 3/6 to 3/12&lt;br&gt;
● Study scope: Part part of Chapter02_sec01 of the book 'Java to Study Alone'&lt;/p&gt;

&lt;p&gt;As a beginner transitioning from a non-CS background, the word &lt;strong&gt;"Variable"&lt;/strong&gt; initially reminded me of $x$ and $y$ from math class. But in programming, I realized that while variables &lt;em&gt;can&lt;/em&gt; change, their true essence lies in being a &lt;strong&gt;"Labeled Container."&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Don't Get Tricked by the Name
&lt;/h3&gt;

&lt;p&gt;A variable is like a box or a bowl where you store a piece of data and put a name tag on it. It doesn't have its own complex functions; its sole purpose is to &lt;strong&gt;hold a single value&lt;/strong&gt; for later use.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Name Tag (Variable Name):&lt;/strong&gt; e.g., &lt;code&gt;userAge&lt;/code&gt;, &lt;code&gt;userName&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Content (Value):&lt;/strong&gt; e.g., &lt;code&gt;25&lt;/code&gt;, &lt;code&gt;Hanna&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think of it like moving to a new house. You pack items into boxes and write what’s inside with a marker. In programming, we do this so we can "unpacks" and use those values whenever the program needs them.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Math vs. Programming: Finding $x$ vs. Storing $x$
&lt;/h3&gt;

&lt;p&gt;The mindset shift is key:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;In Math:&lt;/strong&gt; We ask, "What is the value of $x$?" (Finding the answer).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;In Programming:&lt;/strong&gt; We say, "I'm going to save this value as $x$ so I can pull it out and use it later!"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Unlike a fixed math equation, the contents of our "programming box" can be swapped out while the program is running. It's a dynamic storage space in the computer's &lt;strong&gt;memory&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Why Do We Need Different Types of Boxes?
&lt;/h3&gt;

&lt;p&gt;Java uses different boxes for numbers, strings, and true/false (booleans). I wondered why we bother categorizing them, and I found the answer: &lt;strong&gt;Decision Making.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Variables are the foundation that allows a program to make choices. The program "opens the box" to see what's inside and decides what to do next.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Example in Game Design:&lt;/strong&gt;&lt;br&gt;
"Open the &lt;code&gt;is_alive&lt;/code&gt; box. If it contains &lt;code&gt;False&lt;/code&gt;, then trigger the 'Game Over' screen!"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  4. Final Thoughts: The Flexible Foundation
&lt;/h3&gt;

&lt;p&gt;Variables can hold numbers, text, or logical states. They are the flexible building blocks that turn a static script into an interactive program. Understanding that a variable is a &lt;strong&gt;functional space in memory&lt;/strong&gt; rather than just a mathematical unknown has been a huge "aha!" moment for me.&lt;/p&gt;




</description>
      <category>java</category>
      <category>beginners</category>
      <category>learningtocode</category>
      <category>webdev</category>
    </item>
    <item>
      <title>☕ 02. "Hello, Java": Understanding the Magic Behind the Compilation</title>
      <dc:creator>Hanna</dc:creator>
      <pubDate>Wed, 11 Mar 2026 09:21:20 +0000</pubDate>
      <link>https://forem.com/hannalog/02-hello-java-understanding-the-magic-behind-the-compilation-10f7</link>
      <guid>https://forem.com/hannalog/02-hello-java-understanding-the-magic-behind-the-compilation-10f7</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpa1c3pqdvdzrifq7kzdb.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpa1c3pqdvdzrifq7kzdb.PNG" alt=" " width="800" height="794"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;● Study period: 3/3 to 3/5&lt;br&gt;
● Study scope: Part 01-3 part (23p-44) of the book 'Java to Study Alone'&lt;/p&gt;

&lt;p&gt;Today, I finally printed my first "Hello, Java!" and dove deep into how this language actually works. As a non-major, I had a fundamental question: "Why do we need a middleman (Bytecode) instead of just running the code directly?"&lt;/p&gt;

&lt;h2&gt;
  
  
  ​&lt;strong&gt;1. The "Meal Kit" Analogy: Java’s Portability&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;​I learned that Java follows a specific process:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source Code (Raw Ingredients) → &lt;code&gt;javac&lt;/code&gt; (The Prep Chef) → Bytecode (The Meal Kit) → &lt;code&gt;java&lt;/code&gt; Command (The World-Class Chef/JVM).&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxf88zy6yvy0x22p3swxn.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxf88zy6yvy0x22p3swxn.PNG" alt=" " width="800" height="657"&gt;&lt;/a&gt;&lt;br&gt;
​At first, I wondered if creating a bytecode file was just an extra, time-consuming step. But I realized this is Java's greatest strength: &lt;strong&gt;"Write Once, Run Anywhere."&lt;/strong&gt; Since the bytecode acts like a pre-prepped meal kit, each Operating System (Windows, macOS, Linux) just needs its own "chef" (JVM) to finish the cooking. This versatility is why Java remains a global standard.&lt;/p&gt;

&lt;h2&gt;
  
  
  ​&lt;strong&gt;2. Java vs. **C&lt;/strong&gt;: Drivers and Engineers**
&lt;/h2&gt;

&lt;p&gt;​I also looked into &lt;strong&gt;C&lt;/strong&gt;, the "Latin of programming." While C-language masters are like &lt;strong&gt;F1 Engineers&lt;/strong&gt; who understand every piston movement in the engine, Java developers are more like &lt;strong&gt;Skilled Drivers&lt;/strong&gt;. Java takes the best parts of C but makes it more accessible and safer for the developer.&lt;/p&gt;

&lt;p&gt;​One day, I hope to add a "spoonful of C" to my knowledge to understand exactly how computers store data at a hardware level. A developer who understands both the high-level logic (Java) and low-level efficiency (C) is truly formidable.&lt;/p&gt;

&lt;h2&gt;
  
  
  ​&lt;strong&gt;3. Safety First: Modules and Syntax&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;​Java is strict. A single case-sensitivity error (like &lt;code&gt;hello&lt;/code&gt; vs &lt;code&gt;Hello&lt;/code&gt;) can break the project. I actually struggled with a filename mismatch today and had to manually refactor it.&lt;br&gt;
​I also explored &lt;strong&gt;Modules&lt;/strong&gt;—think of them as security guards or passkeys for your code packages. This rigid structure is exactly why Java is trusted by large enterprises worldwide for its high security and stability.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpsieqnn6df6zj0oni4mt.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpsieqnn6df6zj0oni4mt.PNG" alt=" " width="800" height="594"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;​4. Thinking in Code: The &lt;code&gt;=&lt;/code&gt; Sign&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;​The most interesting "aha!" moment was the assignment operator =.&lt;br&gt;
In math, &lt;code&gt;x = x + 1&lt;/code&gt; is impossible. In Java, it's a standard command: &lt;strong&gt;"Calculate the right side first, then store it in the left container." Shifting my brain from "Result"&lt;/strong&gt; to "Storage" was a small but vital step in thinking like a programmer.&lt;/p&gt;

&lt;h2&gt;
  
  
  ​5. My Roadmap to Becoming a "Commander" of AI
&lt;/h2&gt;

&lt;p&gt;​As AI evolves, I believe the role of a developer is shifting toward being a Commander. To lead AI effectively, I need to understand the "First Principles." Even if I don't memorize every syntax, I must master the core pillars:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;​&lt;strong&gt;Variables &amp;amp; Data Types&lt;/strong&gt; (Choosing the right containers)&lt;/li&gt;
&lt;li&gt;​&lt;strong&gt;Object-Oriented Programming&lt;/strong&gt; (The heart of Java: Inheritance, Polymorphism, Encapsulation)&lt;/li&gt;
&lt;li&gt;​&lt;strong&gt;Exception Handling&lt;/strong&gt; (Defensive driving for code)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;​Clean Code&lt;/strong&gt; (Sustainability and Maintenance)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;​My goal is to understand the "Big Picture" so I can direct AI to optimize code effectively. I’m focusing on &lt;strong&gt;Java, Spring Boot, and JPA&lt;/strong&gt; as my core stack, keeping an eye on global enterprise standards.&lt;/p&gt;

</description>
      <category>java</category>
      <category>beginners</category>
      <category>learningtocode</category>
      <category>webdev</category>
    </item>
    <item>
      <title>🚀 01. My First Step into Java: Setting Up the Environment</title>
      <dc:creator>Hanna</dc:creator>
      <pubDate>Wed, 11 Mar 2026 07:21:46 +0000</pubDate>
      <link>https://forem.com/hannalog/my-first-step-into-java-setting-up-the-environment-oracle-java-eclipse-1lkp</link>
      <guid>https://forem.com/hannalog/my-first-step-into-java-setting-up-the-environment-oracle-java-eclipse-1lkp</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbtvkcggzkl1edp34m5zg.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbtvkcggzkl1edp34m5zg.jpg" alt=" " width="800" height="514"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;● Study period: 3/3 to 3/5&lt;br&gt;
● Study scope: Part part of Chapter01_sec01 of the book 'Java to Study Alone'&lt;/p&gt;

&lt;p&gt;Starting something new is always a mix of excitement and "Expected Unexpected" challenges. As I prepare for an intensive 6-month Java &amp;amp; Spring boot camp starting this May, I’ve decided to self-study the fundamentals beforehand. My goal is to complete at least 2 or 3 rounds of the textbook to ensure I hit the ground running.&lt;/p&gt;

&lt;p&gt;Today’s mission: Setting up the Java Development Kit (JDK) and Eclipse IDE.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz8p7tfw7l1hse0ur9y04.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz8p7tfw7l1hse0ur9y04.png" alt=" " width="800" height="463"&gt;&lt;/a&gt;&lt;br&gt;
Coming from a non-technical background, I realized today that I didn't even know where the backslash (&lt;code&gt;\&lt;/code&gt;) key was! (For those wondering, it’s usually right above the Enter key). It made me pause for a second—"Can I really become a developer if I don't even know the keyboard layout?" But I shook it off. Everyone starts at zero, and today was my Day Zero.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3cdk9l7tgrz230cnzd6b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3cdk9l7tgrz230cnzd6b.png" alt=" " width="800" height="618"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5cw4gk14yr0mzfh99pmn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5cw4gk14yr0mzfh99pmn.png" alt=" " width="800" height="805"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;2. The Battle with Environment Variables&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;I followed the instructions to set up the environment variables, but when I ran &lt;code&gt;javac -version&lt;/code&gt; in the terminal, it kept returning an error. I restarted my PC, double-checked the paths, embed  and scratched my head for a while. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvph5yqwytqor50tx1bwi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvph5yqwytqor50tx1bwi.png" alt=" " width="800" height="250"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fejup6qufpl861ts2efds.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fejup6qufpl861ts2efds.png" alt=" " width="800" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I was typing &lt;code&gt;javac-version&lt;/code&gt; (no space) or &lt;code&gt;javac - version&lt;/code&gt; (extra space). The correct command is:&lt;br&gt;
&lt;code&gt;javac -version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It felt a bit frustrating that a single space could break everything. However, this was a great lesson: Computers are honest and literal. They don't infer context like humans do. Precision isn't just a preference in coding; it’s a requirement.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;3. Overcoming IDE Installation Hurdles&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;I also ran into an issue while installing Eclipse. The initial installer wouldn't execute properly. After some troubleshooting and consulting with AI, I opted for the "Full Zip" version instead of the standard installer. Problem solved! Since my textbook was written for an older version of Java, navigating the latest updates required some extra research, but I successfully configured the latest environment.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1gxr7s8ssqij3m32e9x6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1gxr7s8ssqij3m32e9x6.png" alt=" " width="800" height="605"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fibse8nxux4tj80flkz4r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fibse8nxux4tj80flkz4r.png" alt=" " width="800" height="285"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;4. Key Takeaways: Thinking like a Developer&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Through this setup process, I realized that a developer is essentially a translator between human logic and machine execution. This is why "Computational Thinking" and "Algorithms" are so vital.&lt;/p&gt;

&lt;p&gt;I’ve learned that to succeed in this field, I need to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ask "Why?": Don't just follow steps; understand the underlying mechanism.&lt;/li&gt;
&lt;li&gt;Deconstruct Problems: Break down big errors into smaller, manageable pieces.&lt;/li&gt;
&lt;li&gt;Be Patient: Accuracy over speed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s a bit overwhelming to learn all this new terminology, but knowing that every senior developer once struggled with a space or a backslash gives me comfort. I’m moving forward slowly but surely!&lt;/p&gt;

</description>
      <category>java</category>
      <category>beginners</category>
      <category>learningtocode</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
