<?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>DEV Community: Hashim HB</title>
    <description>The latest articles on DEV Community by Hashim HB (@hashim_hb).</description>
    <link>https://dev.to/hashim_hb</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1869568%2Fbc181ebd-7905-41f8-b286-13170ef3ec66.jpg</url>
      <title>DEV Community: Hashim HB</title>
      <link>https://dev.to/hashim_hb</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hashim_hb"/>
    <language>en</language>
    <item>
      <title>Java Fundamentals , My Day 1–4 Learning Journey</title>
      <dc:creator>Hashim HB</dc:creator>
      <pubDate>Sun, 26 Jul 2026 19:13:30 +0000</pubDate>
      <link>https://dev.to/hashim_hb/java-fundamentals-my-day-1-4-learning-journey-59on</link>
      <guid>https://dev.to/hashim_hb/java-fundamentals-my-day-1-4-learning-journey-59on</guid>
      <description>&lt;p&gt;🚀After deciding to strengthen my programming fundamentals as part of my DevOps learning journey, I started learning &lt;strong&gt;Java&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I know these are basic concepts, but every experienced developer once started here. Building strong fundamentals makes learning advanced topics much easier later.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Starting from scratch is never a weakness. Whether the concepts are basic or advanced, every lesson learned today becomes the building block for tomorrow's expertise."&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this blog, I'll summarize everything I learned during my first four days of Java.&lt;/p&gt;




&lt;h1&gt;
  
  
  Day 1 – Introduction to Java
&lt;/h1&gt;

&lt;p&gt;Java is a &lt;strong&gt;high-level, object-oriented programming language&lt;/strong&gt; designed to be platform-independent.&lt;/p&gt;

&lt;p&gt;The famous Java principle is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Write Once, Run Anywhere (WORA)&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is possible because Java programs are first compiled into &lt;strong&gt;bytecode&lt;/strong&gt;, which can run on any operating system that has a Java Virtual Machine (JVM).&lt;/p&gt;




&lt;h1&gt;
  
  
  How Java Works
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Java Source Code (.java)
          │
          ▼
      Java Compiler
        (javac)
          │
          ▼
      Bytecode (.class)
          │
          ▼
Java Virtual Machine (JVM)
          │
          ▼
 Machine Code
          │
          ▼
 Operating System
(Windows/Linux/macOS)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The JVM converts bytecode into machine code that the operating system understands.&lt;/p&gt;




&lt;h1&gt;
  
  
  JDK vs JRE vs JVM
&lt;/h1&gt;

&lt;h2&gt;
  
  
  JVM (Java Virtual Machine)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Executes Java bytecode&lt;/li&gt;
&lt;li&gt;Converts bytecode into machine code&lt;/li&gt;
&lt;li&gt;Makes Java platform independent&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  JRE (Java Runtime Environment)
&lt;/h2&gt;

&lt;p&gt;The JRE contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JVM&lt;/li&gt;
&lt;li&gt;Core Java Libraries&lt;/li&gt;
&lt;li&gt;Runtime files&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Its purpose is simply &lt;strong&gt;to run Java applications.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  JDK (Java Development Kit)
&lt;/h2&gt;

&lt;p&gt;The JDK contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JRE&lt;/li&gt;
&lt;li&gt;Java Compiler (javac)&lt;/li&gt;
&lt;li&gt;Debugger&lt;/li&gt;
&lt;li&gt;Documentation&lt;/li&gt;
&lt;li&gt;Development tools&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The JDK is used to &lt;strong&gt;develop Java applications.&lt;/strong&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  IDE
&lt;/h1&gt;

&lt;p&gt;IDE stands for &lt;strong&gt;Integrated Development Environment&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Popular Java IDEs include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;IntelliJ IDEA&lt;/li&gt;
&lt;li&gt;Eclipse&lt;/li&gt;
&lt;li&gt;VS Code&lt;/li&gt;
&lt;li&gt;NetBeans&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;An IDE provides:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Code completion&lt;/li&gt;
&lt;li&gt;Debugging&lt;/li&gt;
&lt;li&gt;Syntax highlighting&lt;/li&gt;
&lt;li&gt;Project management&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  First Java Program
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Hello&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&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;"Hello World!"&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Understanding the code
&lt;/h3&gt;

&lt;h3&gt;
  
  
  public
&lt;/h3&gt;

&lt;p&gt;Accessible from anywhere.&lt;/p&gt;

&lt;h3&gt;
  
  
  class
&lt;/h3&gt;

&lt;p&gt;Defines a class.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hello
&lt;/h3&gt;

&lt;p&gt;Class name.&lt;/p&gt;

&lt;h3&gt;
  
  
  main()
&lt;/h3&gt;

&lt;p&gt;Entry point of every Java application.&lt;/p&gt;

&lt;h3&gt;
  
  
  System.out.println()
&lt;/h3&gt;

&lt;p&gt;Prints output to the console.&lt;/p&gt;




&lt;h1&gt;
  
  
  Java Keywords
&lt;/h1&gt;

&lt;p&gt;Keywords are reserved words already defined by Java.&lt;/p&gt;

&lt;p&gt;Examples:&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="kd"&gt;class&lt;/span&gt;
&lt;span class="nc"&gt;public&lt;/span&gt;
&lt;span class="kd"&gt;private&lt;/span&gt;
&lt;span class="kd"&gt;static&lt;/span&gt;
&lt;span class="kt"&gt;void&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;
&lt;span class="k"&gt;switch&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keywords cannot be used as variable names.&lt;/p&gt;




&lt;h1&gt;
  
  
  Variables
&lt;/h1&gt;

&lt;p&gt;A variable stores data in memory.&lt;/p&gt;

&lt;p&gt;Example:&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;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;22&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rules for naming variables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Case-sensitive&lt;/li&gt;
&lt;li&gt;Must begin with a letter, &lt;code&gt;_&lt;/code&gt;, or &lt;code&gt;$&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Cannot begin with a number&lt;/li&gt;
&lt;li&gt;Cannot be a Java keyword&lt;/li&gt;
&lt;li&gt;Prefer camelCase naming&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&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;employeeAge&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;firstName&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;accountBalance&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Primitive Data Types
&lt;/h1&gt;

&lt;p&gt;Java has eight primitive data types.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Data Type&lt;/th&gt;
&lt;th&gt;Size&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;byte&lt;/td&gt;
&lt;td&gt;1 byte&lt;/td&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;short&lt;/td&gt;
&lt;td&gt;2 bytes&lt;/td&gt;
&lt;td&gt;2000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;int&lt;/td&gt;
&lt;td&gt;4 bytes&lt;/td&gt;
&lt;td&gt;100000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;long&lt;/td&gt;
&lt;td&gt;8 bytes&lt;/td&gt;
&lt;td&gt;100000000L&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;float&lt;/td&gt;
&lt;td&gt;4 bytes&lt;/td&gt;
&lt;td&gt;12.5f&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;double&lt;/td&gt;
&lt;td&gt;8 bytes&lt;/td&gt;
&lt;td&gt;12.56&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;char&lt;/td&gt;
&lt;td&gt;2 bytes&lt;/td&gt;
&lt;td&gt;'A'&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;boolean&lt;/td&gt;
&lt;td&gt;1 bit (logical)&lt;/td&gt;
&lt;td&gt;true&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Example:&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;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;22&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="n"&gt;cgpa&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;8.75f&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;salary&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;25000.55&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;grade&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="kt"&gt;boolean&lt;/span&gt; &lt;span class="n"&gt;isPassed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice the &lt;strong&gt;f&lt;/strong&gt; after float values.&lt;/p&gt;

&lt;p&gt;Without it, Java treats decimal numbers as &lt;strong&gt;double&lt;/strong&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  Type Conversion
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Implicit Conversion (Widening)
&lt;/h2&gt;

&lt;p&gt;Smaller data types are automatically converted into larger data types.&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;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No data loss occurs.&lt;/p&gt;




&lt;h2&gt;
  
  
  Explicit Conversion (Casting)
&lt;/h2&gt;

&lt;p&gt;Large data types can be converted into smaller ones.&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;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;150&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kt"&gt;byte&lt;/span&gt; &lt;span class="n"&gt;newAge&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;byte&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-106
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since &lt;strong&gt;byte&lt;/strong&gt; ranges only from &lt;strong&gt;-128 to 127&lt;/strong&gt;, overflow occurs.&lt;/p&gt;




&lt;h1&gt;
  
  
  Comments
&lt;/h1&gt;

&lt;p&gt;Single-line comment&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="c1"&gt;// This is a comment&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Multi-line comment&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="cm"&gt;/********************
This is
a multi-line comment
********************/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Day 2 – Binary Number System
&lt;/h1&gt;

&lt;p&gt;Computers understand only:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0
1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every value stored in memory is represented in binary.&lt;/p&gt;

&lt;p&gt;Example:&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;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Internally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;00000000 00000000 00000000 00001100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Bytes and Bits
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1 Byte = 8 Bits

short = 16 bits

int = 32 bits

long = 64 bits
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  MSB and LSB
&lt;/h1&gt;

&lt;p&gt;MSB&lt;/p&gt;

&lt;p&gt;Most Significant Bit&lt;/p&gt;

&lt;p&gt;In signed integers, the MSB represents the &lt;strong&gt;sign bit&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;0 → Positive&lt;/li&gt;
&lt;li&gt;1 → Negative (using two's complement representation)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;LSB&lt;/p&gt;

&lt;p&gt;Least Significant Bit&lt;/p&gt;

&lt;p&gt;Represents the smallest place value.&lt;/p&gt;




&lt;h1&gt;
  
  
  Two's Complement
&lt;/h1&gt;

&lt;p&gt;Negative numbers are represented using Two's Complement.&lt;/p&gt;

&lt;p&gt;Steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Invert all bits&lt;/li&gt;
&lt;li&gt;Add 1&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;5

Binary

00000101

Invert

11111010

Add 1

11111011

= -5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Java Operators
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Arithmetic Operators
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&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="o"&gt;/&lt;/span&gt;

&lt;span class="o"&gt;%&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&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;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&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;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&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;a&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;b&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;a&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;b&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;a&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;b&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;a&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;b&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;a&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Assignment Operators
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&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="o"&gt;*=&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;h2&gt;
  
  
  Relational Operators
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="o"&gt;==&lt;/span&gt;

&lt;span class="o"&gt;!=&lt;/span&gt;

&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;

&lt;span class="o"&gt;&amp;gt;=&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;=&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&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="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="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="mi"&gt;3&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="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="mi"&gt;5&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="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;!=&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Logical Operators
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;amp;&amp;amp;&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;p&gt;Example&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;boolean&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&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;a&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;b&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;a&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;b&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;a&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Bitwise Operators
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;amp;&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="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;

&lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt;

&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Increment and Decrement
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++;&lt;/span&gt;

&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;--;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Ternary Operator
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;condition&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;value1&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;value2&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example&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;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="nc"&gt;String&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;age&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;18&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="s"&gt;"Adult"&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s"&gt;"Minor"&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Taking Input from User
&lt;/h1&gt;

&lt;p&gt;Java provides the &lt;strong&gt;Scanner&lt;/strong&gt; class.&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="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.Scanner&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Main&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

        &lt;span class="nc"&gt;Scanner&lt;/span&gt; &lt;span class="n"&gt;sc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Scanner&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;in&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;"Enter your age: "&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;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;nextInt&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;age&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="n"&gt;sc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;close&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Useful methods:&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="n"&gt;nextInt&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;nextFloat&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;nextDouble&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;next&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;nextLine&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;nextBoolean&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Calling &lt;code&gt;close()&lt;/code&gt; releases the underlying input resource when you're done using the scanner.&lt;/p&gt;




&lt;h1&gt;
  
  
  Day 3 – Conditional Statements
&lt;/h1&gt;

&lt;p&gt;Java executes code depending on conditions.&lt;/p&gt;




&lt;h2&gt;
  
  
  if Statement
&lt;/h2&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;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="o"&gt;;&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;age&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;18&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;"Eligible"&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;h2&gt;
  
  
  if-else
&lt;/h2&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;age&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt;&lt;span class="mi"&gt;18&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;"Adult"&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;"Minor"&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;h2&gt;
  
  
  if-else-if
&lt;/h2&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;marks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;85&lt;/span&gt;&lt;span class="o"&gt;;&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;marks&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt;&lt;span class="mi"&gt;90&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;"A"&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="nf"&gt;if&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;marks&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;=&lt;/span&gt;&lt;span class="mi"&gt;75&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;"B"&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;"C"&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;h2&gt;
  
  
  Nested if
&lt;/h2&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;age&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;=&lt;/span&gt;&lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="o"&gt;){&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;age&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;60&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;"Working"&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Switch Statement
&lt;/h2&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;day&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;switch&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;day&lt;/span&gt;&lt;span class="o"&gt;){&lt;/span&gt;

&lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="mi"&gt;1&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;"Monday"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="mi"&gt;2&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;"Tuesday"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="mi"&gt;3&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;"Wednesday"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;default&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;"Invalid"&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;p&gt;Switch statements improve readability when checking many fixed values.&lt;/p&gt;




&lt;h1&gt;
  
  
  Day 4 – Loops
&lt;/h1&gt;

&lt;p&gt;Loops execute a block of code repeatedly.&lt;/p&gt;




&lt;h2&gt;
  
  
  for Loop
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="k"&gt;for&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;i&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="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&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;i&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;p&gt;Structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Initialization

Condition

Update

Loop Body
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;Sum of first n numbers&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;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&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;sum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&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="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="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;sum&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  while Loop
&lt;/h2&gt;

&lt;p&gt;Used when the number of iterations is unknown.&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;i&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="k"&gt;while&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;5&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;i&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;i&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;h2&gt;
  
  
  do-while Loop
&lt;/h2&gt;

&lt;p&gt;Executes at least once.&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;i&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="k"&gt;do&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;i&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++;&lt;/span&gt;

&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="k"&gt;while&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  break
&lt;/h2&gt;

&lt;p&gt;Stops the loop immediately.&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;for&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;i&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="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;=&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++){&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;i&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;

        &lt;span class="k"&gt;break&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;i&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;h2&gt;
  
  
  continue
&lt;/h2&gt;

&lt;p&gt;Skips the current iteration.&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;for&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;i&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="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;=&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++){&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;i&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;

        &lt;span class="k"&gt;continue&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;i&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;h2&gt;
  
  
  Nested Loops
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="k"&gt;for&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;i&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="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;=&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++){&lt;/span&gt;

    &lt;span class="k"&gt;for&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;j&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="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;=&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;span class="n"&gt;j&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;"* "&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="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;* * *
* * *
* * *
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Labeled Break
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nl"&gt;outer:&lt;/span&gt;

&lt;span class="k"&gt;for&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;i&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="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;=&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++){&lt;/span&gt;

    &lt;span class="k"&gt;for&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;j&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="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;=&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++){&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;i&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="k"&gt;break&lt;/span&gt; &lt;span class="n"&gt;outer&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A labeled break exits multiple nested loops at once.&lt;/p&gt;




&lt;h1&gt;
  
  
  What's Next?
&lt;/h1&gt;

&lt;p&gt;The next topic in my learning journey is &lt;strong&gt;Arrays in Java&lt;/strong&gt;, where I'll explore:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creating arrays&lt;/li&gt;
&lt;li&gt;Accessing elements&lt;/li&gt;
&lt;li&gt;Iterating using loops&lt;/li&gt;
&lt;li&gt;Array operations&lt;/li&gt;
&lt;li&gt;Multidimensional arrays&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Stay tuned!&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;These first four days reminded me that programming isn't about memorizing syntax—it's about understanding how the language works behind the scenes.&lt;/p&gt;

&lt;p&gt;From learning how Java compiles code into bytecode, to understanding primitive data types, operators, conditions, and loops, every concept lays the groundwork for more advanced topics like Object-Oriented Programming, Collections, and Multithreading.&lt;/p&gt;

&lt;p&gt;I'm documenting this journey publicly to reinforce my own understanding and hopefully help others who are just getting started.&lt;/p&gt;

&lt;p&gt;If you're also learning Java, feel free to connect and share your learning journey. Happy coding! 🚀&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>java</category>
      <category>learning</category>
    </item>
    <item>
      <title>Introduction to Computer Networks for Beginners</title>
      <dc:creator>Hashim HB</dc:creator>
      <pubDate>Sun, 19 Jul 2026 16:52:38 +0000</pubDate>
      <link>https://dev.to/hashim_hb/introduction-to-computer-networks-for-beginners-4mbo</link>
      <guid>https://dev.to/hashim_hb/introduction-to-computer-networks-for-beginners-4mbo</guid>
      <description>&lt;p&gt;&lt;strong&gt;WHAT IS A NETWORK?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Computers connected with each other are called a Network.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WHAT IS INTERNET?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The collection of interconnected Computers is called as Internet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HOW IT ALL STARTED?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In an alternate history, the U.S. and the Soviet Union were engaged in a major war, with both sides competing intensely in technology and space. The Soviet Union gained a significant advantage by launching a powerful rocket, Sputnik Omega, which showcased their advanced technology and disrupted American plans.&lt;/p&gt;

&lt;p&gt;In response, the U.S. formed ARPA- Advanced Research Projects Agency, a new agency dedicated to rapidly developing cutting-edge technologies. One of ARPA's key achievements was creating ARPANET, a network that would eventually become the Internet. Despite the initial advantage of the Soviets, this technological breakthrough helped the U.S. regain its footing.&lt;/p&gt;

&lt;p&gt;The war eventually ended in a stalemate, leading both nations to focus on peace and collaboration. The intense competition and innovation from this period laid the foundation for many modern technological advancements.&lt;/p&gt;

&lt;p&gt;There were 4 Places where the computers were located in USA&lt;/p&gt;

&lt;p&gt;-MIT&lt;/p&gt;

&lt;p&gt;-UCLA&lt;/p&gt;

&lt;p&gt;-UNIVERSITY OF UTAH&lt;/p&gt;

&lt;p&gt;-STANFORD&lt;/p&gt;

&lt;p&gt;They used TCP - Transmission control protocol for transferring messages or whatever required for them&lt;/p&gt;

&lt;p&gt;Everything was functioning smoothly with ARPANET, but a problem soon arose. As a research project, ARPANET was primarily designed for sharing information within the scientific community. However, researchers began using it to exchange their papers and data across different institutions and locations.&lt;/p&gt;

&lt;p&gt;For instance, if Stanford sent information about computers to MIT, including a link to detailed research, the link itself often couldn't be accessed or properly interpreted by the receiving end. This limitation became apparent as the network grew and the need for a more user-friendly system to manage and retrieve information became clear.&lt;/p&gt;

&lt;p&gt;To address this issue, the World Wide Web (WWW) was developed. The WWW provided a more intuitive way to link and access documents across the network, making it easier for researchers to share and find information. With its creation, the WWW significantly improved the functionality of ARPANET, transforming it into a more effective tool for global information exchange.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TIM BERNERS-LEE developed WWW&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Click to Know The first www is a collection of pages or documents identified by URL- Uniform Resource Locator and interlinked by hyperlinks and accessed over the internet.&lt;/p&gt;

&lt;p&gt;But how do we search we require search engines so this starts the development of search engines. YAHOO was the first to develop search engines&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are Protocols?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Protocols are like a set of rules that one needs to follow&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Who sets these rules?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;THE INTERNET SOCIETY is the one that sets these rules you can check it out -&amp;gt; &lt;a href="https://www.internetsociety.org/" rel="noopener noreferrer"&gt;https://www.internetsociety.org/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check out how we are connected with the whole world using cables under the sea -&amp;gt; &lt;a href="https://www.submarinecablemap.com/" rel="noopener noreferrer"&gt;https://www.submarinecablemap.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WHAT IS A SERVER?&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9pkjku17xmw7fwquq7vv.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9pkjku17xmw7fwquq7vv.png" alt="WHAT IS A SERVER" width="800" height="350"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A server is a computer system that provides resources, programs or data to other computers known as clients over the network.&lt;/p&gt;

&lt;p&gt;image &lt;/p&gt;

&lt;p&gt;Some of List of Protocols&lt;/p&gt;

&lt;p&gt;-TCP -&amp;gt; Transmission Control Protocol&lt;/p&gt;

&lt;p&gt;-UDP -&amp;gt; User Datagram Protocol&lt;/p&gt;

&lt;p&gt;-HTTP -&amp;gt; Hyper text transfer protocol&lt;/p&gt;

&lt;p&gt;-HTTPS -&amp;gt; Hyper text transfer protocol secure&lt;/p&gt;

&lt;p&gt;IP-ADDRESS -&amp;gt; Internet Protocol Address&lt;/p&gt;

&lt;p&gt;$curl ifconfig.me -s -&amp;gt; to check IP-Address of your computer&lt;/p&gt;

&lt;p&gt;IP-Address -&amp;gt; Its basically an address of your computer connected to the internet.&lt;/p&gt;

&lt;p&gt;A port is a 16-bit numbers. So the total number of port numbers we can have is 2^16&lt;/p&gt;

&lt;p&gt;A port or port number is a number assigned to uniquely identify a connection endpoint and to direct data to a specific service.&lt;/p&gt;

&lt;p&gt;There are certain port numbers that are fixed they are :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTTP - port 80&lt;/li&gt;
&lt;li&gt;SQL - port 1433&lt;/li&gt;
&lt;li&gt;MongoDB - port 27017&lt;/li&gt;
&lt;li&gt;Reserved Ports -[0-1023]&lt;/li&gt;
&lt;li&gt;Registered for Applications -[1024-49152]&lt;/li&gt;
&lt;li&gt;Remaining - Public use&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;1Mbps -&amp;gt; mega bits per second&lt;br&gt;
1Gbps -&amp;gt; Giga bits per second&lt;/p&gt;

&lt;p&gt;when we are sending data to someone its called UPLOAD&lt;/p&gt;

&lt;p&gt;when we are accessing data from someone its called DOWNLOAD&lt;/p&gt;

&lt;p&gt;WHAT ARE THE TYPES OF NETWORK&lt;/p&gt;

&lt;p&gt;LAN- (LOCAL AREA NETWORK)&lt;/p&gt;

&lt;p&gt;It's a network that covers a small area/office&lt;/p&gt;

&lt;p&gt;It is used to connect to computers in the same building or campus&lt;/p&gt;

&lt;p&gt;MAN -(METROPOLITAN AREA NETWORK)&lt;/p&gt;

&lt;p&gt;It's a network used to connect across Cities&lt;/p&gt;

&lt;p&gt;WAN -(WIDE AREA NETWORK)&lt;/p&gt;

&lt;p&gt;It's a network used to connect across countries&lt;/p&gt;

&lt;p&gt;SONET - (SYNCHRONOUS OPTICAL NETWORK)&lt;/p&gt;

&lt;p&gt;FRAME RELAY -(Connecting LAN to the internet)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HOW ARE COMPUTERS CONNECTED?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;TOPOLOGIES&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SOME OF THE TOPOLOGIES ARE:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;BUS&lt;/li&gt;
&lt;li&gt;RING&lt;/li&gt;
&lt;li&gt;STAR&lt;/li&gt;
&lt;li&gt;MESH&lt;/li&gt;
&lt;li&gt;TREE&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;BUS TOPOLOGY :&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv1rij2lmypja6n6jnyio.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv1rij2lmypja6n6jnyio.png" alt="BUS TOPOLOGY" width="236" height="214"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;All computers are connected in a single line.&lt;/li&gt;
&lt;li&gt;If one computer fails, the entire network connection is lost.&lt;/li&gt;
&lt;li&gt;Only one computer can send data at a time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;RING TOPOLOGY:&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8eeckttfndm6peepgpap.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8eeckttfndm6peepgpap.png" alt="RING TOPOLOGY" width="255" height="198"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Computers are connected in a circular loop.&lt;/li&gt;
&lt;li&gt;If one computer fails, the whole network can be disrupted.&lt;/li&gt;
&lt;li&gt;Data can take longer routes because it must pass through several computers to reach its destination.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;STAR TOPOLOGY:&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy75uqhgpsl5rf979plw7.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy75uqhgpsl5rf979plw7.png" alt="STAR TOPOLOGY" width="269" height="187"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;All computers are connected to a central hub or switch.&lt;/li&gt;
&lt;li&gt;If the central hub fails, the entire network is lost.&lt;/li&gt;
&lt;li&gt;It is easy to add new computers and manage the network.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;MESH TOPOLOGY:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every computer is connected to every other computer.&lt;/li&gt;
&lt;li&gt;It is expensive to set up because of the many connections required.&lt;/li&gt;
&lt;li&gt;Adding a new computer involves connecting it to every other computer.&lt;/li&gt;
&lt;li&gt;There can be stability issues if not all connections are reliable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;TREE TOPOLOGY&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0tbmk41zawoe1hw8zm2l.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0tbmk41zawoe1hw8zm2l.png" alt="TREE TOPOLOGY" width="799" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Combines elements of Bus and Star topologies.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It has fault tolerance, meaning the network can continue to operate even if some parts fail.&lt;/li&gt;
&lt;li&gt;It’s organized hierarchically, which helps in managing and expanding the network efficiently.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;STRUCTURE OF NETWORK&lt;/p&gt;

&lt;p&gt;THE MOST IMPORTANT CONCEPT ASKED IN INTERVIEWS OSI MODEL&lt;/p&gt;

&lt;p&gt;OSI MODEL - Open System Interconnection&lt;/p&gt;

&lt;p&gt;There are 7 layers&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Application layer&lt;/li&gt;
&lt;li&gt;Presentation layer&lt;/li&gt;
&lt;li&gt;Session layer&lt;/li&gt;
&lt;li&gt;Transport layer&lt;/li&gt;
&lt;li&gt;Network layer&lt;/li&gt;
&lt;li&gt;Data Link layer &lt;/li&gt;
&lt;li&gt;Physical layer&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The easier way to remember is:&lt;/p&gt;

&lt;p&gt;ALL - APPLICATION LAYER&lt;/p&gt;

&lt;p&gt;PEOPLE - PRESENTATION LAYER&lt;/p&gt;

&lt;p&gt;SHOULD - SESSION LAYER&lt;/p&gt;

&lt;p&gt;TRY - TRANSPORT LAYER&lt;/p&gt;

&lt;p&gt;NEW - NETWORK LAYER&lt;/p&gt;

&lt;p&gt;DOMINOS - DATALINK&lt;/p&gt;

&lt;p&gt;PIZZA - PHYSICAL LAYER&lt;/p&gt;

&lt;p&gt;Application Layer - It provides services to the user&lt;/p&gt;

&lt;p&gt;Presentation Layer - Takes care of the syntax and semantics of the information exchange between two communication systems.&lt;/p&gt;

&lt;p&gt;Session Layer - It establishes, maintain , synchronize and terminate interaction between the sender and reciever.&lt;/p&gt;

&lt;p&gt;Transport Layer - It responsible for process to process delivery&lt;/p&gt;

&lt;p&gt;Network Layer - Responsible for delivery of individual packet from source to destination.&lt;/p&gt;

&lt;p&gt;Data-Link Layer - Responsible for moving from one hop to next hop.&lt;/p&gt;

&lt;p&gt;Physical Layer - Responsible for moving individual bits from one device to another.&lt;/p&gt;

&lt;p&gt;The transport layer will break down the data into small segments and each segment will have its own ip-address and a sequencce number - sequence number is necessary in order to keep a track of the order of data.&lt;/p&gt;

&lt;p&gt;The network layer will asign ip-address of sender and the reciever to every segments and it forms an ip packet . so that every data packet will reach the correct destination&lt;/p&gt;

&lt;p&gt;IP-ADDRESS VS MAC ADDRESS&lt;/p&gt;

&lt;p&gt;IP-ADDRESS -&amp;gt; it helps us to identify the device globally&lt;/p&gt;

&lt;p&gt;MAC ADDRESS -&amp;gt; it helps us to identify the device locally&lt;/p&gt;

&lt;p&gt;ANOTHER MODEL IS TCP/IP MODEL&lt;/p&gt;

&lt;p&gt;It is known as Transmission Control Protocol / Internet Protocol also known as Internet Protocol Suite.&lt;/p&gt;

&lt;p&gt;It consist of 5 layers&lt;/p&gt;

&lt;p&gt;The presentation layer and session layer is combined into one&lt;/p&gt;

&lt;p&gt;Layers are :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;APPLICATION LAYER&lt;/li&gt;
&lt;li&gt;TRANSPORT LAYER&lt;/li&gt;
&lt;li&gt;NETWORK LAYER&lt;/li&gt;
&lt;li&gt;DATA-LINK LAYER&lt;/li&gt;
&lt;li&gt;PHYSICAL LAYER&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It provides services to the user example: Applications such as watsup, facebook etc:&lt;/p&gt;

&lt;p&gt;There are two types of Architecture:&lt;/p&gt;

&lt;p&gt;Client-Server Architecture&lt;br&gt;
Peer-to-Peer Architecture&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F731nwuoi9lofbklyphm6.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F731nwuoi9lofbklyphm6.png" alt="Peer-to-Peer Architecture" width="800" height="572"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Client-Server Architecture:&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx8n5mnw1bq9fhm5rukcf.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx8n5mnw1bq9fhm5rukcf.png" alt="Client-Server Architecture" width="800" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SOME OF THE IMP CONCEPTS:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Repeaters&lt;/li&gt;
&lt;li&gt;Bridges&lt;/li&gt;
&lt;li&gt;Hub&lt;/li&gt;
&lt;li&gt;Gateway&lt;/li&gt;
&lt;li&gt;Routers&lt;/li&gt;
&lt;li&gt;Brouters&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some of Protocols:&lt;/p&gt;

&lt;p&gt;HTTP -&amp;gt; hyper text transfer protocol&lt;/p&gt;

&lt;p&gt;DHCP -&amp;gt; dynamic host control protocol&lt;/p&gt;

&lt;p&gt;FTP -&amp;gt; File transfer Protocol&lt;/p&gt;

&lt;p&gt;SMTP -&amp;gt; Simple mail Transfer Protocol&lt;/p&gt;

&lt;p&gt;POP3 -&amp;gt; post-office-protocol&lt;/p&gt;

&lt;p&gt;SSH -&amp;gt; Secure shell&lt;/p&gt;

&lt;p&gt;VNC -&amp;gt; Virtual network control&lt;/p&gt;

&lt;p&gt;telnet -&amp;gt; it uses port 23&lt;/p&gt;

&lt;p&gt;UDP -&amp;gt; user Data gram protocol&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Process vs thread&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Process-&amp;gt; It's an instance of a program that is being execited.&lt;/p&gt;

&lt;p&gt;Thread-&amp;gt; It's a segment of proccess.&lt;/p&gt;

&lt;p&gt;Example: Opening a new browser (say Chrome) is an example of creating a process. At this point, a new process will start to execute. opening multiple tabs in the browser is an example of creating the thread.&lt;/p&gt;

&lt;p&gt;HTTP METHODS :&lt;/p&gt;

&lt;p&gt;GET -&amp;gt; Used for fetching data, appending parameters in the URL, ideal for searches.&lt;/p&gt;

&lt;p&gt;POST-&amp;gt; Used for updates, sends data securely in the request body, perfect for forms&lt;/p&gt;

&lt;p&gt;PUT -&amp;gt; to put the data at specific location&lt;/p&gt;

&lt;p&gt;DELETE -&amp;gt; to delete the data from the server&lt;/p&gt;

&lt;p&gt;STATUS CODE: It helps us to know whether our request is accepted or not&lt;/p&gt;

&lt;p&gt;1xx -&amp;gt; Information related&lt;/p&gt;

&lt;p&gt;2xx-&amp;gt; Successful&lt;/p&gt;

&lt;p&gt;3xx-&amp;gt;Redirection purpose&lt;/p&gt;

&lt;p&gt;4xx-&amp;gt; client error&lt;/p&gt;

&lt;p&gt;5xx-&amp;gt; Server error&lt;/p&gt;

&lt;p&gt;Cookies - &amp;gt; Cookies are small pieces of text sent to your browser by a website you visit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HOW EMAIL WORKS?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It works with the help of SMTP protocol&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcjh1x8p1zic3xxlt34dm.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcjh1x8p1zic3xxlt34dm.png" alt="Working of Email" width="800" height="553"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WHAT IS DNS?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;DNS -&amp;gt; Domain Name System&lt;/p&gt;

&lt;p&gt;DNS is like the phone book of the internet, making it easier to search for websites by using words instead of numbers.&lt;/p&gt;

&lt;p&gt;You can check it out from the following sites:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;rootservers.org&lt;br&gt;
icann.org&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;TRANSPORT LAYER :&lt;/p&gt;

&lt;p&gt;The transport layer is responsible for reliable data transfer between devices on the network. It ensures that the data packets are delivered error-free, in the correct sequence, and without loss or duplication. There are two main protocols at the transport layer&lt;/p&gt;

&lt;p&gt;Transmission Control Protocol (TCP): Provides reliable, connection-oriented communication. It ensures error recovery, flow control, and retransmission of lost packets.&lt;/p&gt;

&lt;p&gt;User Datagram Protocol (UDP): Provides unreliable, connectionless communication. It does not guarantee the delivery of packets or their order but is faster due to the lack of overhead for reliability.&lt;/p&gt;

&lt;p&gt;Key Functions of the Transport Layer:&lt;/p&gt;

&lt;p&gt;Segmentation and Reassembly: The transport layer divides large messages into smaller packets and puts them back together at the destination.&lt;/p&gt;

&lt;p&gt;Error Control: It detects and handles errors that occur during transmission.&lt;/p&gt;

&lt;p&gt;Flow Control: It regulates the rate of data transmission to prevent congestion.&lt;/p&gt;

&lt;p&gt;Connection Establishment and Termination: In protocols like TCP, the transport layer sets up, maintains, and ends connections.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Linux Commands for Transport Layer:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;netstat: Displays the network connections, routing tables, and network interface statistics. Use it to see active TCP connections.&lt;/p&gt;

&lt;p&gt;ss: A more modern tool than netstat, which provides detailed information about TCP, UDP sockets.&lt;/p&gt;

&lt;p&gt;telnet / nc (Netcat): Used to test connectivity on specific ports. For instance, testing if a TCP connection to a server is available.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;1. netstat -tuln
2. ss -tuln
&lt;/span&gt;&lt;span class="gp"&gt;3. telnet &amp;lt;hostname&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;port&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;NETWORK LAYER:&lt;/p&gt;

&lt;p&gt;Responsible for packet forwarding, routing, and addressing, including the use of IP addresses.&lt;/p&gt;

&lt;p&gt;Linux Command: ping, traceroute, route, and ip commands are helpful for network diagnostics.&lt;/p&gt;

&lt;p&gt;Linux Command: ping, traceroute, route, and ip commands are helpful for network diagnostics.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;
1. ping 192.168.1.1
2. traceroute www.google.com
3. ip route show

&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;DATA LINK LAYER:&lt;/p&gt;

&lt;p&gt;Ensures data transfer between adjacent network nodes and handles error detection and correction.&lt;/p&gt;

&lt;p&gt;Linux Command: arp, ethtool, and iwconfig help in managing network interfaces.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;1. arp -a
2. ethtool eth0

&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;PHYSICAL LAYER:&lt;/p&gt;

&lt;p&gt;Deals with the physical medium of data transmission like cables and network devices.&lt;/p&gt;

&lt;p&gt;Linux Command: ifconfig or ip link can show the status of the network interfaces.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;1. ifconfig
2. ip link show
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Mastering Jenkins: A Step-by-Step Guide to Setting Up and Supercharging Your CI/CD Workflow</title>
      <dc:creator>Hashim HB</dc:creator>
      <pubDate>Tue, 07 Jan 2025 20:13:05 +0000</pubDate>
      <link>https://dev.to/hashim_hb/mastering-jenkins-a-step-by-step-guide-to-setting-up-and-supercharging-your-cicd-workflow-2ln9</link>
      <guid>https://dev.to/hashim_hb/mastering-jenkins-a-step-by-step-guide-to-setting-up-and-supercharging-your-cicd-workflow-2ln9</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;&lt;em&gt;What is Jenkins?&lt;/em&gt;&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;→ Jenkins is an open-source tool used to automate tasks in software development, mainly focusing on Continuous Integration (CI) and Continuous Delivery (CD).&lt;/p&gt;

&lt;p&gt;→ It also helps developers automatically build, test, and deploy their code changes whenever they make updates.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;em&gt;Features of Jenkins:&lt;/em&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;CI/CD INTEGRATIONS&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;PIPELINES&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;EASY INSTALLATION&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;EASY CONFIGURATION&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;DISTRIBUTED&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;EXTENSIBLE&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;OPEN-SOURCE&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;em&gt;How to Set Up Jenkins in your Local Machine?&lt;/em&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;☆ There are many ways in which can set up you can choose which suits you the best&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%2F9qqqwco746xxgpzcsm6y.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%2F9qqqwco746xxgpzcsm6y.png" alt=" " width="760" height="627"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;✦ You can set up in Windows also but I am going to teach you how we can setup Jenkins locally with Oracle VirtualBox VM.&lt;/p&gt;

&lt;p&gt;✦ First create a VM (Virtual Machine) using a Virtual Box and install the Linux (Ubuntu/CentOS) as your wish&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%2F5zn3tkxrhey9707zm3p5.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%2F5zn3tkxrhey9707zm3p5.png" alt=" " width="266" height="145"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;✦ Open Terminal in any one of the following Linux Distros it might be different for UBUNTU you can check Jenkins documentation for that I will guide you for CentOS.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;wget &lt;span class="nt"&gt;-O&lt;/span&gt; /etc/yum.repos.d/jenkins.repo &lt;span class="se"&gt;\ &lt;/span&gt;https://pkg.jenkins.io/redhat-stable/jenkins.repo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;rpm &lt;span class="nt"&gt;--import&lt;/span&gt; https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key
&lt;span class="nb"&gt;sudo &lt;/span&gt;yum upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Add required dependencies for the jenkins package&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;yum &lt;span class="nb"&gt;install &lt;/span&gt;fontconfig java-17-openjdk
&lt;span class="nb"&gt;sudo &lt;/span&gt;yum &lt;span class="nb"&gt;install &lt;/span&gt;jenkins
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl daemon-reload
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✦ Start Jenkins by using systemctl&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;jenkins
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start jenkins &lt;span class="c"&gt;# to start jenkins&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status jenkins &lt;span class="c"&gt;# to check the status if its running or not &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✦ If everything went well, the beginning of the status output shows that the service is active and configured to start at boot(enabled)&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%2Fxrcv8a708fdvn6r5objf.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%2Fxrcv8a708fdvn6r5objf.png" alt=" " width="720" height="157"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;✦ Now that Jenkins is up and running, let’s adjust our firewall rules so that we can reach it from a web browser to complete the initial setup.&lt;/p&gt;

&lt;p&gt;IMPORTANT STEP :&lt;/p&gt;

&lt;p&gt;✦ check if firewall is installed in the system&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;yum &lt;span class="nb"&gt;install &lt;/span&gt;firewalld
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;firewalld
&lt;span class="nb"&gt;sudo &lt;/span&gt;reboot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✦ Now everything is done now we can start using Jenkins&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ifconfig
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✦ By running this command we get the IP-Address of Linux system use this IP-Address to access the Jenkins dashboard in the web-browser by typing &lt;strong&gt;ipaddress:8080&lt;/strong&gt; and enter&lt;/p&gt;

&lt;p&gt;✦ This will successfully Land you to this page:&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%2Fn910my82yz56x278ayp6.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%2Fn910my82yz56x278ayp6.png" alt=" " width="800" height="494"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;✦ Use the terminal in your VM and run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo cat&lt;/span&gt; /var/lib/jenkins/secrets/initialAdminPassword
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✦ Copy the 32-character alphanumeric password from the terminal and paste it into the Administrator password field on the Jenkins page. Then, click Continue.&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%2Fy5ckvwq0ysi9xfrnzlo2.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%2Fy5ckvwq0ysi9xfrnzlo2.png" alt=" " width="800" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;✦ Click on Install suggested plugins&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%2Flhdhcj02cvs4w2rt8vpw.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%2Flhdhcj02cvs4w2rt8vpw.png" alt=" " width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;✦ It will Install the required plugins&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%2F1wa9awadvl4t1pbhyxqm.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%2F1wa9awadvl4t1pbhyxqm.png" alt=" " width="800" height="494"&gt;&lt;/a&gt;&lt;br&gt;
✦ Once all the plugins are installed then:&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%2Fjp6uvq6zkwuk901xqdhy.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%2Fjp6uvq6zkwuk901xqdhy.png" alt=" " width="799" height="486"&gt;&lt;/a&gt;&lt;br&gt;
✦ Fill in the required fields and proceed&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%2Fkytv5lt0dhx4xmn7y8xh.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%2Fkytv5lt0dhx4xmn7y8xh.png" alt=" " width="800" height="491"&gt;&lt;/a&gt;&lt;br&gt;
✦ URL will be provided i have removed for security purposes just click on save and finish&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%2F1s8s9klbveba21xpd4rn.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%2F1s8s9klbveba21xpd4rn.png" alt=" " width="800" height="498"&gt;&lt;/a&gt;&lt;br&gt;
✦ Now you have successfully done the setup for Jenkins&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%2Fca1em76pnz3lvdnwzs0h.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%2Fca1em76pnz3lvdnwzs0h.png" alt=" " width="799" height="409"&gt;&lt;/a&gt;&lt;br&gt;
✦ This is what the Jenkins Dashboard Looks like&lt;/p&gt;

&lt;p&gt;Now this is for the Linux system it will only run in Linux environment if we want to access in our local machine (Windows) you need to follow certain steps:&lt;/p&gt;

&lt;p&gt;In Linux environment run the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;firewall-cmd &lt;span class="nt"&gt;--permanent&lt;/span&gt; &lt;span class="nt"&gt;--zone&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;public &lt;span class="nt"&gt;--add-port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;8080/tcp
&lt;span class="nb"&gt;sudo &lt;/span&gt;firewall-cmd &lt;span class="nt"&gt;--reload&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✦ Both the commands should give &lt;em&gt;SUCCESS&lt;/em&gt; or else you have done something wrong&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up Port Forwarding
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;Open VirtualBox VM settings.&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;Navigate to the NAT network adapter settings.&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;Click Advanced and then Port Forwarding.&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;Add a new rule named "Jenkins".&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;Set Protocol to TCP.&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;Enter Host IP as 127.0.0.1 and Host Port as 8080.&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;Guest Port should also be set to 8080.&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;Click OK to save the settings.&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&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%2Fcjpwozs56g0y7primjej.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%2Fcjpwozs56g0y7primjej.png" alt=" " width="800" height="446"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After this step→ Open your browser and go to 127.0.0.1:8080 to access Jenkins, you will land on the getting started Jenkins page:&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%2Fgdqxuj7hfd137jngmnna.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%2Fgdqxuj7hfd137jngmnna.png" alt=" " width="800" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;✦ Enter the Username and Password which you created Before and there you go&lt;/p&gt;

&lt;p&gt;✦ You have Successfully setup Jenkins in your Local Machine&lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;strong&gt;&lt;em&gt;How to create Jenkins first Job?&lt;/em&gt;&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;✦ Click on → Create a Job&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%2F1uc7e6no50916qbg6d1n.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%2F1uc7e6no50916qbg6d1n.png" alt=" " width="799" height="409"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;✦ Then give a name for the job and select &lt;strong&gt;&lt;em&gt;freestyle Project&lt;/em&gt;&lt;/strong&gt; as we are just starting off.&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%2Fnfdaopnsztm1d0fnfu2z.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%2Fnfdaopnsztm1d0fnfu2z.png" alt=" " width="799" height="363"&gt;&lt;/a&gt;&lt;br&gt;
✦ You will get a page something like this:&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%2Fhny3738peb3hle78s4ya.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%2Fhny3738peb3hle78s4ya.png" alt=" " width="799" height="333"&gt;&lt;/a&gt;&lt;br&gt;
✦Scroll down to Build Steps:&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%2Fhv1hkccjm3hz8dx4oole.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%2Fhv1hkccjm3hz8dx4oole.png" alt=" " width="426" height="477"&gt;&lt;/a&gt;&lt;br&gt;
✦Choose the option what you like&lt;/p&gt;

&lt;p&gt;✦We will choose Execute Shell and write the command that you want to execute and save&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%2Fj7armx4zynyzr77sk0td.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%2Fj7armx4zynyzr77sk0td.png" alt=" " width="799" height="316"&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%2Fct2hylu1574qzb92esmm.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%2Fct2hylu1574qzb92esmm.png" alt=" " width="800" height="507"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;✦ Now just click on Build Now and that it you have successfully created your first job in Jenkins&lt;/p&gt;

&lt;p&gt;✦ After the job is created click on the job and get to see the following:&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%2Fmz0p8s7xn3vict2bwffd.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%2Fmz0p8s7xn3vict2bwffd.png" alt=" " width="800" height="330"&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%2Fw00bor1womdq9skzq6yf.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%2Fw00bor1womdq9skzq6yf.png" alt=" " width="800" height="605"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;✦ This was the output and we successfully created and saw the output of the command in Jenkins&lt;/p&gt;

&lt;p&gt;✦ We can even see the number of jobs that we have created&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%2F6rdbip1404pr58tsg2p6.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%2F6rdbip1404pr58tsg2p6.png" alt=" " width="799" height="254"&gt;&lt;/a&gt;&lt;br&gt;
✦ &lt;strong&gt;This was all about Jenkins Hope You guys like it.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>jenkins</category>
      <category>setup</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
