<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[clevercoderjoy's Blogs]]></title><description><![CDATA[🫴 Call center employee to software engineer.
🫴 I write code and lift weights.
🫴 Trying to transition from an introvert to an extrovert.
🫴 google: "clevercod]]></description><link>https://clevercoderjoy.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Thu, 17 Sep 2026 22:09:01 GMT</lastBuildDate><atom:link href="https://clevercoderjoy.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Variable Declarations JavaScript Edition]]></title><description><![CDATA[What are variables?

Variables are just the names of memory locations with some values stored in them.

Why do we need them?

Imagine a scenario where you are asked to bring some water to drink. You bring water but that water is stored in some contai...]]></description><link>https://clevercoderjoy.hashnode.dev/variable-declarations-javascript-edition</link><guid isPermaLink="true">https://clevercoderjoy.hashnode.dev/variable-declarations-javascript-edition</guid><category><![CDATA[javascript fundamentals]]></category><category><![CDATA[clevercoderjoy]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[newbie]]></category><category><![CDATA[basics]]></category><dc:creator><![CDATA[clevercoderjoy]]></dc:creator><pubDate>Thu, 16 Feb 2023 19:57:48 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-what-are-variables">What are variables?</h2>
<ul>
<li>Variables are just the names of memory locations with some values stored in them.</li>
</ul>
<h2 id="heading-why-do-we-need-them">Why do we need them?</h2>
<ul>
<li><p>Imagine a scenario where you are asked to bring some water to drink. You bring water but that water is stored in some container. Why did you not bring only water?</p>
</li>
<li><p>Okay another one, imagine if we didn't have unique names given by our parents to uniquely identify ourselves. How would we call each other? Abey o human... idhar sun... Arey human sun na... O human sunte ho? Aji human, sunte ho... It would be so confusing to associate everyone with the word human.</p>
</li>
<li><p>So for this reason, we need variable names that uniquely identify each value memory in various different memory locations.</p>
</li>
</ul>
<h2 id="heading-how-do-we-use-variables">How do we use variables?</h2>
<ul>
<li><p>To use a variable, we will have to declare it first and then use the assignment operator " = " and initialize it with a value.</p>
</li>
<li><pre><code class="lang-javascript">    <span class="hljs-comment">// This is how you declare a variable in javascript.</span>
    a = <span class="hljs-number">5</span>;
    <span class="hljs-keyword">let</span> b = <span class="hljs-number">10</span>;
    <span class="hljs-keyword">var</span> c = <span class="hljs-number">20</span>;
    <span class="hljs-keyword">const</span> d = <span class="hljs-number">30</span>;
</code></pre>
</li>
<li><p>If you don't know what " = " is or what it does then head on to my previous blog and read about it <a target="_blank" href="https://clevercoderjoy.hashnode.dev/value-comparison-operators-javascript-edition">here</a>.</p>
</li>
</ul>
<h2 id="heading-variables-in-javascript">Variables in JavaScript</h2>
<p>In JavaScript, we can declare and use a variable in four ways.</p>
<ol>
<li><h3 id="heading-freestyle-declaration">Freestyle Declaration</h3>
</li>
</ol>
<ul>
<li><p>In JavaScript, we can declare and use a variable by just writing the variable's name and giving it a value.</p>
</li>
<li><p>This means that we have declared a global variable.</p>
</li>
<li><p>A global variable is a variable that can be used from anywhere in the program.</p>
</li>
<li><pre><code class="lang-javascript">    <span class="hljs-comment">// eg</span>
    freeStyleVariable = <span class="hljs-number">25</span>;
    <span class="hljs-built_in">console</span>.log(freeStyleVariable); <span class="hljs-comment">// 25</span>
    {
        freeStyleVariable = <span class="hljs-number">35</span>;
        <span class="hljs-built_in">console</span>.log(freeStyleVariable); <span class="hljs-comment">//35</span>
    }
    <span class="hljs-built_in">console</span>.log(freeStyleVariable); <span class="hljs-comment">//35</span>
</code></pre>
</li>
<li><p>If we see the above example, we have declared the variable and when we try to change its value inside the block, it gives the changed value as output outside the block too.</p>
</li>
<li><p>This is how a global variable behaves. It can be accessed from anywhere inside our code.</p>
</li>
<li><p>As convenient as it looks, this type of declaration is firmly <strong>not recommended</strong> as it creates ambiguity and results in unexpected errors.</p>
</li>
</ul>
<ol>
<li><h2 id="heading-var-declaration">var Declaration</h2>
</li>
</ol>
<ul>
<li><p>var keyword allows us to declare variables that are functional scoped that can be initialized with a value either during declaration or later in the program.</p>
</li>
<li><p>Functional scoped means that the values that are declared with the var keyword can be accessed from anywhere inside the function where it has been declared.</p>
</li>
<li><p>Accessing a functional scoped variable outside its scope will throw a reference error.</p>
</li>
<li><pre><code class="lang-javascript">    <span class="hljs-comment">// eg</span>
    <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">varDeclaration</span>(<span class="hljs-params"></span>)</span>{
        <span class="hljs-keyword">var</span> a = <span class="hljs-number">14</span>;
        <span class="hljs-built_in">console</span>.log(a); <span class="hljs-comment">// 14</span>
    }
    <span class="hljs-built_in">console</span>.log(a); <span class="hljs-comment">// Reference Error</span>
</code></pre>
</li>
<li><p>var declarations are hoisted.</p>
</li>
</ul>
<h3 id="heading-what-is-hoisting">What is hoisting?</h3>
<ul>
<li><p>Variables declared with the var keyword are created and given memory before they are initialized or assigned a value or any code is executed. This process is called hoisting.</p>
</li>
<li><p>The initial value of these variables will be undefined until the code execution reaches the line where these values have been initialized.</p>
</li>
</ul>
<pre><code class="lang-javascript"><span class="hljs-comment">// example of var hoisting</span>
<span class="hljs-keyword">var</span> hoistingExample;
<span class="hljs-built_in">console</span>.log(hoistingExample); <span class="hljs-comment">// undefined</span>
hoistingExample = <span class="hljs-number">5</span>;
<span class="hljs-built_in">console</span>.log(hoistingExample); <span class="hljs-comment">// 5</span>
</code></pre>
<ol>
<li><h2 id="heading-let-declaration">let Declaration</h2>
</li>
</ol>
<ul>
<li><p>let keyword allows us to declare blocked scoped variables and can be initialized with a value either during declaration or later in the program.</p>
</li>
<li><p>This means that the variables declared inside a block can be accessed only inside that block. If we try to access these variables outside of the block it will throw a reference error.</p>
</li>
<li><p>Block is the region available inside the curly braces " {} ".</p>
</li>
<li><pre><code class="lang-javascript">    <span class="hljs-comment">// eg</span>
    <span class="hljs-keyword">let</span> a = <span class="hljs-number">10</span>;
    {
        <span class="hljs-built_in">console</span>.log(a); <span class="hljs-comment">// Reference error</span>
    }
    <span class="hljs-built_in">console</span>.log(a); <span class="hljs-comment">// 10</span>
</code></pre>
</li>
<li><p>In the above example, accessing "a" from the block where it has not been declared will throw a reference error.</p>
</li>
<li><p>let can be accessed only after it has been declared and initialized which also means that let is not hoisted.</p>
</li>
<li><p>Many issues with let declarations can be avoided by declaring it on top of the scope in which it has to be used.</p>
</li>
<li><p>If the same let variables have been declared inside the same block, it will throw a syntax error.</p>
</li>
<li><pre><code class="lang-javascript">    <span class="hljs-keyword">let</span> someVariable = <span class="hljs-number">10</span>;
    <span class="hljs-keyword">let</span> someVariable = <span class="hljs-number">20</span>;
    <span class="hljs-comment">// Uncaught SyntaxError: Identifier 'someVariable' has already been declared</span>
</code></pre>
</li>
<li><p>To sum it all up, we can say that let is just a var with boundaries. So declare let not var.</p>
</li>
</ul>
<ol>
<li><h2 id="heading-const-declaration">const Declaration</h2>
</li>
</ol>
<ul>
<li><p>const keyword allows us to declare constant variables that are block scoped just like let.</p>
</li>
<li><p>Constant variables are those variables whose values do not change throughout the program.</p>
</li>
<li><p>The primary key differences between let and const are:</p>
<ul>
<li><p>A const variable has to be initialized with a value right at the time of variable declaration whereas let can also be initialized with a value at a later part of the code.</p>
</li>
<li><p>If the const declaration is not initialized during the variable declaration, it will throw a syntax error.</p>
</li>
<li><pre><code class="lang-javascript">  <span class="hljs-comment">// eg</span>
  <span class="hljs-keyword">let</span> a;
  a = <span class="hljs-number">50</span>;
  <span class="hljs-keyword">const</span> b = <span class="hljs-number">5</span>;
  <span class="hljs-keyword">const</span> b;
  <span class="hljs-comment">// Uncaught SyntaxError: Missing initializer in const declaration</span>
</code></pre>
</li>
<li><p>The value assigned to const cannot be changed by declaration or reassignment once it has been initialized whereas, in the case of let, the values can be changed.</p>
</li>
<li><p>If we try to reassign the const variable or redeclare it then it will throw a type error.</p>
</li>
<li><pre><code class="lang-javascript">  <span class="hljs-comment">// eg</span>
  <span class="hljs-keyword">let</span> a = <span class="hljs-number">10</span>;
  a = <span class="hljs-number">50</span>;
  <span class="hljs-keyword">const</span> b = <span class="hljs-number">20</span>;
  b = <span class="hljs-number">60</span>;
  <span class="hljs-comment">// Uncaught TypeError: Assignment to constant variable.</span>
</code></pre>
</li>
<li><p>In case any object or an array has been declared as const, their values can be modified but the object or array can not be reassigned whereas, in the case of let, arrays and objects can be reassigned with a different value.</p>
</li>
<li><p>If we try to reassign a const array or object or if we try to redeclare it then it will throw a type error.</p>
</li>
<li><pre><code class="lang-javascript">  <span class="hljs-keyword">let</span> obj = {<span class="hljs-attr">name</span> : <span class="hljs-string">"joy"</span>};
  obj = <span class="hljs-number">10</span>;
  <span class="hljs-keyword">const</span> anotherObj = {<span class="hljs-attr">place</span> : <span class="hljs-string">"lko"</span>};
  anotherObj.place = <span class="hljs-string">"ggn"</span>;
  anotherObj = <span class="hljs-number">50</span>;
  <span class="hljs-comment">// Uncaught TypeError: Assignment to constant variable.</span>
</code></pre>
</li>
<li><p>It is a good practice to declare const variables with all uppercase letters.</p>
</li>
</ul>
</li>
<li><p>The variables declared as const are not hoisted.</p>
</li>
<li><p>let and const when declared are said to be in the temporal dead zone (tdz).</p>
</li>
</ul>
<h2 id="heading-what-is-a-temporal-dead-zone">What is a temporal dead zone?</h2>
<ul>
<li><p>Imagine a baby inside a mother's womb. We know that the baby exists, but we can not touch and see it until and unless it has been born.</p>
</li>
<li><p>This is exactly what a tdz can be visualized as.</p>
</li>
<li><p>A variable that is declared as let or const is said to be in the temporal dead zone until the code execution reaches the line where the variable has been declared and initialized with a value.</p>
</li>
<li><p>While inside the tdz, the variables have not been initialized with a value yet, and any attempts to access these variables will throw a reference error.</p>
</li>
</ul>
<p>This is all about the variable declaration in javascript. Drop down your comments and suggestions in case I have missed something. Any feedback will be appreciated.</p>
]]></content:encoded></item><item><title><![CDATA[Value Comparison Operators JavaScript Edition]]></title><description><![CDATA[In JavaScript, we have three different value-comparison operators:

"="

"=="

"==="


What is ( = ) in programming languages?

A single equals symbol (=) is also called an assignment operator.

In simple terms, when I say " a = 5 ", this means that ...]]></description><link>https://clevercoderjoy.hashnode.dev/value-comparison-operators-javascript-edition</link><guid isPermaLink="true">https://clevercoderjoy.hashnode.dev/value-comparison-operators-javascript-edition</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[clevercoderjoy]]></category><category><![CDATA[equality operator in javascript]]></category><category><![CDATA[javascript fundamentals]]></category><category><![CDATA[#codenewbies]]></category><dc:creator><![CDATA[clevercoderjoy]]></dc:creator><pubDate>Tue, 14 Feb 2023 13:05:37 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/UVe-5ZyDdAE/upload/fac309334d2990641b92c885f2897705.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In JavaScript, we have three different value-comparison operators:</p>
<ul>
<li><p>"="</p>
</li>
<li><p>"=="</p>
</li>
<li><p>"==="</p>
</li>
</ul>
<h2 id="heading-what-is-in-programming-languages">What is ( = ) in programming languages?</h2>
<ul>
<li><p>A single equals symbol (=) is also called an assignment operator.</p>
</li>
<li><p>In simple terms, when I say " a = 5 ", this means that I am putting the value '5' inside the variable ' a '.</p>
</li>
<li><p>Now, when I try to print the value of ' a ', I will get the value ' 5 '.</p>
</li>
<li><pre><code class="lang-javascript">    <span class="hljs-keyword">const</span> a = <span class="hljs-number">5</span>;
    <span class="hljs-built_in">console</span>.log(a); <span class="hljs-comment">// 5</span>
</code></pre>
</li>
</ul>
<h2 id="heading-what-is-in-programming-languages-1">What is ( == ) in programming languages?</h2>
<ul>
<li><p>The pair of equal signs ( == ) when put together acts as a comparison operator.</p>
</li>
<li><p>This means that it will check for equality in the two values that are placed on both the left and right sides of this operator.</p>
</li>
<li><pre><code class="lang-javascript">    <span class="hljs-keyword">const</span> a = <span class="hljs-number">5</span>;
    <span class="hljs-keyword">const</span> b = <span class="hljs-string">"5"</span>;
    <span class="hljs-built_in">console</span>.log(a == b); <span class="hljs-comment">// true</span>
</code></pre>
</li>
<li><p>We can see in the above example that the value of ' a ' is of Integer data type and the value of ' b ' is of String data type and when checking the equality for these values, it results in ' true '.</p>
</li>
<li><p>This equality ( == ) operator does not consider the data type while checking for equality of the values. It only compares the values and if the values are the same, it results in ' true ' or else ' false '.</p>
</li>
<li><p>But before comparison actually takes place, coercion comes into the picture for this operator.</p>
</li>
<li><p>Coercion refers to the automatic conversion of one data type to another.</p>
</li>
<li><p>First, one of the values is converted from one data type into the data type that fits the other value. For eg: The string data type is converted to a Number data type.</p>
</li>
<li><p>After coercion, a comparison between the two values takes place.</p>
</li>
<li><p>For this reason, this operator is also called the loose equality operator.</p>
</li>
</ul>
<h2 id="heading-what-is-in-javascript">What is ( === ) in JavaScript?</h2>
<ul>
<li><p>If we want to compare the data types also while checking for equality in values, then we have the triple equals operator ( === ) aka strict equality operator.</p>
</li>
<li><p>When used, this operator checks for equality in data types of the values along with equality in values.</p>
</li>
<li><p>If the values are of different data types then it will result in ' false '.</p>
</li>
<li><pre><code class="lang-javascript">    <span class="hljs-keyword">const</span> a = <span class="hljs-number">5</span>;
    <span class="hljs-keyword">const</span> b = <span class="hljs-string">"5"</span>;
    <span class="hljs-built_in">console</span>.log(a === b) <span class="hljs-comment">// false</span>
</code></pre>
</li>
<li><p>We can see in the above example, even though the values are the same but they have different data types and for this reason, the expression results in ' false '.</p>
</li>
<li><p>Coercion does not take place here.</p>
</li>
<li><p>This operator checks for equality for data type along with the value, this operator is also known as the strict type operator.</p>
</li>
</ul>
<p>This is all about the ( = ) operator in javascript. JavaScript can be really tricky but I will make sure to explain these complex concepts and topics in as simple way as I possibly can.</p>
]]></content:encoded></item><item><title><![CDATA[ELI5 - Git: The Version Control System(VCS)]]></title><description><![CDATA[What is git?
Git is an open-source version control system. Now, you might be thinking what the heck this means... but don't worry, I will explain to you every single word that I have written like I am explaining to a 5-year-old.- Git is just a name t...]]></description><link>https://clevercoderjoy.hashnode.dev/eli5-git-the-version-control-systemvcs</link><guid isPermaLink="true">https://clevercoderjoy.hashnode.dev/eli5-git-the-version-control-systemvcs</guid><category><![CDATA[GitHub]]></category><category><![CDATA[Git]]></category><category><![CDATA[version control]]></category><category><![CDATA[GitLab]]></category><category><![CDATA[clevercoderjoy]]></category><dc:creator><![CDATA[clevercoderjoy]]></dc:creator><pubDate>Sat, 28 Jan 2023 09:30:55 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/KPAQpJYzH0Y/upload/ddf41ce217591045b0083125d4b8be3c.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-what-is-git">What is git?</h1>
<p>Git is an open-source version control system. Now, you might be thinking what the heck this means... but don't worry, I will explain to you every single word that I have written like I am explaining to a 5-year-old.<br />- Git is just a name that has been given to this version control system, which is an open-source software maintained by some amazing developers.</p>
<p>- Version Control System is a system that has been developed to manage, maintain and to be in sync with your collegues and other collaborators who are working on the same project.</p>
<p>- There are projects, software, applications, etc being built, by some developers and their source code is made available to the public so that developers around the world can see, go through the code, fix the existing issues and contribute to the code base in order to maintain and improve the software. This is what exactly open source software means.</p>
<h1 id="heading-why-vcs">Why VCS?</h1>
<p>Imagine a scenario, where you and two of your other friends are working from home because of covid, on a project that needs to be build with multiple features in it. Now, think of all the ideas by which you can collaborate with each other. If you think of sending the finished project files via email, then the attachments can be too large. If you think of doublt-tripple compression, even then the file will be too large and another hassle to decompress the file multiple time comes to the picture. If you think that you will upload the files to gdrive or something like that then there can be big conflicts in the file structure and can result in breaking the appli,cation.<br />So, exactly for this reason, the version control system aka VCS was developed.</p>
<p>The VCS helps teams solve these kinds of problems. It tracks every individual changes by each and every contributor, helps in preventing conflicts. It basically takes a snapshot of all the work you have done so far. Each of the contributors can work on their feature independently and merge everything into one after they are done with their work on the project.</p>
<h1 id="heading-how-to-use-git">How to use git?</h1>
<p>To use git, like every software, we need to download and install git on our systems and where do we download and install git from? We download and install git from <a target="_blank" href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git">here</a>.</p>
<h1 id="heading-what-after-installing-git">What after installing git?</h1>
<ul>
<li>After installing git, open your <a target="_blank" href="https://www.ionos.com/help/email/troubleshooting-mail-basicmail-business/access-the-command-prompt-or-terminal/">terminal</a> and type:</li>
</ul>
<pre><code class="lang-bash">git --version
</code></pre>
<p>This will show you the currently installed version of git.</p>
<ul>
<li>To work with git or in other words, in order for git to track all the changes in the project, you need to ask git to do that for you and how do you ask git to track your project? You simply type:</li>
</ul>
<pre><code class="lang-bash">git init
</code></pre>
<p>This command will initialize an empty git repository for you. Basically this means that git will now start to track all the changes made in your project.</p>
<ul>
<li>Git will also tell you the status of all the tracked and untracked files when you type:</li>
</ul>
<pre><code class="lang-bash">git status
</code></pre>
<ul>
<li>For git to add the files to it's tracking list, you will need to add the files manually by using the command:</li>
</ul>
<pre><code class="lang-bash">git add file_name
<span class="hljs-comment"># if you want to add all the files to the tracking list, then use the command:</span>
git add .
</code></pre>
<ul>
<li>After adding the files to the tracking list, you will need to cofirm that you want to make the changes permanent by commiting that change in the tracking list by using the command:</li>
</ul>
<pre><code class="lang-bash">git commit -m <span class="hljs-string">'commit-msg'</span>
</code></pre>
<ul>
<li>If you want to work on a differnt feature of the project that you are building and work in a way that the changes you make in your code does not change anything in the final code until you are satisfied with your work then you can create different branches by using the command:</li>
</ul>
<pre><code class="lang-bash">git branch branch-name
</code></pre>
<ul>
<li><p>You can create multiple branches and work on multiple feature independently of other features by creating multiple branches.</p>
</li>
<li><p>To get an overview of all the branches you or your team mates have created so far you can use the command:</p>
</li>
</ul>
<pre><code class="lang-bash">git branch
</code></pre>
<ul>
<li>To switch between various created branches you can use the command:</li>
</ul>
<pre><code class="lang-bash">git checkout branch-name
</code></pre>
<ul>
<li>To combine the work you and your friends have done you can use the command:</li>
</ul>
<pre><code class="lang-bash">git merge branch-name
</code></pre>
<ul>
<li>To send your changes to the production, you will need to push your code to your repository by using the command:</li>
</ul>
<pre><code class="lang-bash">git push remote-repository branch-name
</code></pre>
<ul>
<li>If you want to check history of everything that has happened to a git repository then you can use the command:</li>
</ul>
<pre><code class="lang-bash">git <span class="hljs-built_in">log</span>
</code></pre>
<ul>
<li><p>Now what is this production and repository?</p>
<ul>
<li><p>Production is the final environment in a software developement process. When a code is pushed to production then it means that all the changes made in the code is finally available for the public to use.</p>
</li>
<li><p>Repository is the collection of file and folder structure containing all the different versions of a project.</p>
</li>
</ul>
</li>
<li><p>If you have to collaborate on some existing projects that is already being worked upon, then you will need to pull the code from you github or gitlab account by using this command:</p>
</li>
</ul>
<pre><code class="lang-bash">git pull remote-repository-url
</code></pre>
<ul>
<li><p>What is a remote repository?</p>
<ul>
<li>A remote repository is a repository that is not on your local system but at a remote location like github or gitlab.</li>
</ul>
</li>
<li><p>What is github and gitlab?</p>
<ul>
<li>Github, gitlab and there are other services also. These are the companies that offer cloud based git repository hosting service which makes it easier to collaborate on any project.</li>
</ul>
</li>
</ul>
<p>This is all the information that was required to understand the version control system - git. I have covered all the basic and most used commands that we use in our day to day life as a software developer. I tried to explain everything in a way as if I was explaining to a 5 year old.</p>
<p>Drop down your comments, suggestions or something important that I missed on. I will try to cover it up on my next blog.</p>
<p>If you want to get in touch with me or know more about me then just google "clevercoderjoy".</p>
]]></content:encoded></item><item><title><![CDATA[Conditionals & Loops]]></title><description><![CDATA[In the previous blog, I covered type conversion and type casting in a JAVA program. If you have not read my previous blog yet then click here to give it a read and then proceed further from here. If you want to get started with JAVA for the first tim...]]></description><link>https://clevercoderjoy.hashnode.dev/conditionals-and-loops-by-clevercoderjoy</link><guid isPermaLink="true">https://clevercoderjoy.hashnode.dev/conditionals-and-loops-by-clevercoderjoy</guid><category><![CDATA[Java]]></category><category><![CDATA[Programming Blogs]]></category><category><![CDATA[programing]]></category><category><![CDATA[programming languages]]></category><category><![CDATA[Programming Tips]]></category><dc:creator><![CDATA[clevercoderjoy]]></dc:creator><pubDate>Sun, 01 May 2022 15:08:32 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/unsplash/4bhhwmsYl-c/upload/v1650838892852/5sVORjWb1.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the previous blog, I covered type conversion and type casting in a JAVA program. If you have not read my previous blog yet then click <a target="_blank" href="https://clevercoderjoy.hashnode.dev/type-conversion-by-clevercoderjoy">here</a> to give it a read and then proceed further from here. If you want to get started with JAVA for the first time then you should start reading my very <a target="_blank" href="https://clevercoderjoy.hashnode.dev/introduction-to-java-by-clevercoderjoy">first blog</a> in the JAVA series.</p>
<p>In this blog, we will learn about conditions and loops. In my previous blog <a target="_blank" href="https://clevercoderjoy.hashnode.dev/flow-of-control-by-clevercoderjoy">flow of control</a>, I talked about the flow chart where we discussed how the flow of a program works by taking some input, doing some processing which involves taking decisions and doing some repetitive tasks, and then producing the desired output. We have already discussed the inputs and outputs <a target="_blank" href="https://clevercoderjoy.hashnode.dev/inputs-and-outputs-in-java-by-clevercoderjoy">here</a> so now, we will discuss the processing part in detail.</p>
<h1 id="heading-conditions">Conditions</h1>
<ul>
<li>In our code, there are times when we need to make decisions, and based on those decisions we want the flow of control in our code to be diverted to a particular action corresponding to those decisions.</li>
<li>This making decision and diverting the flow of control is done by the "if" statement.</li>
<li>With the "if" statement, we can have check conditions in our code.</li>
<li>If the condition is satisfied then the code inside the if block executes.</li>
<li>If the condition is not satisfied then the flow of control of the program will not get inside the if block and the if block will be skipped.</li>
<li>The syntax for the "if" condition is: <pre><code>  <span class="hljs-keyword">if</span>(<span class="hljs-keyword">boolean</span> expression <span class="hljs-literal">True</span> <span class="hljs-keyword">or</span> <span class="hljs-literal">False</span>){
      <span class="hljs-comment">//body...</span>
  }
</code></pre></li>
<li>We also have the "else" statement that can be used with the "if" statements.</li>
<li>When the "if" condition is not satisfied we can either choose to skip the if block or we can add an "else" block.</li>
<li>The "else" block executes when the condition given for the if statement is not satisfied.</li>
<li>The syntax for the "if-else" statement is:<pre><code>  <span class="hljs-keyword">if</span>(<span class="hljs-keyword">boolean</span> expression <span class="hljs-literal">True</span> <span class="hljs-keyword">or</span> <span class="hljs-literal">False</span>){
      <span class="hljs-comment">//body...</span>
  }
  <span class="hljs-keyword">else</span>{
      <span class="hljs-comment">//body</span>
  }
</code></pre></li>
<li>Amongst the "if-else" statement, only one of the two will execute while the other will be skipped.</li>
<li>We can also write multiple "if-else" statements.</li>
<li>The syntax for multiple "if-else" statements is:<pre><code>  <span class="hljs-keyword">if</span>(<span class="hljs-keyword">boolean</span> expression <span class="hljs-literal">True</span> <span class="hljs-keyword">or</span> <span class="hljs-literal">False</span>){
      <span class="hljs-comment">//body...</span>
  }
  <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span>(<span class="hljs-keyword">boolean</span> expression <span class="hljs-literal">True</span> <span class="hljs-keyword">or</span> <span class="hljs-literal">False</span>){
      <span class="hljs-comment">//body</span>
  }
  <span class="hljs-keyword">else</span>{
      <span class="hljs-comment">//body</span>
  }
</code></pre></li>
<li>Only one amongst "if, else if, else" will execute.</li>
<li>Here's a simple program based on what we studied just now</li>
</ul>
<p>A program to check if a number is positive, negative, or zero.</p>
<pre><code>    <span class="hljs-keyword">import</span> <span class="hljs-title">java</span>.<span class="hljs-title">util</span>.<span class="hljs-operator">*</span>
    <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title">class</span> <span class="hljs-title">Number</span>{
        <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title">static</span> <span class="hljs-title">void</span> <span class="hljs-title">main</span>(<span class="hljs-title">String</span>[] <span class="hljs-title">args</span>){
            <span class="hljs-title"><span class="hljs-keyword">int</span></span> <span class="hljs-title">n</span> <span class="hljs-operator">=</span> 5;
            <span class="hljs-keyword">if</span>(n <span class="hljs-operator">&gt;</span> <span class="hljs-number">0</span>){
                System.out.println(<span class="hljs-string">"number is positive."</span>);
            }
            <span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span>(n <span class="hljs-operator">&lt;</span> <span class="hljs-number">0</span>){
                System.out.println(<span class="hljs-string">"number is negative."</span>);
            }
            <span class="hljs-keyword">else</span>{
                System.out.println(<span class="hljs-string">"number is zero."</span>);
            }
        }
    }
</code></pre><h1 id="heading-loops">Loops</h1>
<ul>
<li>Let's suppose that we want to write all the numbers from 1 to 5.</li>
<li>We can simply use:<pre><code>  <span class="hljs-keyword">System</span>.<span class="hljs-keyword">out</span>.println(<span class="hljs-number">1</span>);
  <span class="hljs-keyword">System</span>.<span class="hljs-keyword">out</span>.println(<span class="hljs-number">2</span>);
  <span class="hljs-keyword">System</span>.<span class="hljs-keyword">out</span>.println(<span class="hljs-number">3</span>);
  <span class="hljs-keyword">System</span>.<span class="hljs-keyword">out</span>.println(<span class="hljs-number">4</span>);
  <span class="hljs-keyword">System</span>.<span class="hljs-keyword">out</span>.println(<span class="hljs-number">5</span>);
</code></pre></li>
<li>Although we had to write the printing statement five times, we did it since it was doable.</li>
<li>What if we want to write all the numbers from 1 to 100 or maybe 1000 or 10000 or some other large number then what? Printing these values with just the print statement is not doable at all. We will have to write the print statement many many times.</li>
<li>So, to tackle this issue we have loops.</li>
<li>With loops, we can perform repetitive actions as many times as we want without having to write the code snippet so many times.</li>
<li>We have three types of loops:<ul>
<li>for loop</li>
<li>while loop</li>
<li>do-while loop</li>
</ul>
</li>
</ul>
<h2 id="heading-for-loop">For Loop</h2>
<ul>
<li>Let's take a closer look into for loop.</li>
<li>The syntax of for loop is:<pre><code>  <span class="hljs-selector-tag">for</span>(initialization, condition, updation){
      <span class="hljs-comment">// body</span>
  }
</code></pre></li>
<li>Here, the initialization part is where we initialize our variable with which we want to perform certain actions inside the loop.</li>
<li>The condition part is where we have our exit condition.</li>
<li>Exit condition means the condition which defines when will the flow of control exit out of the loop.</li>
<li>The updation part is where after every iteration, the initial value will be updated to a new value.</li>
<li>Let me show you an example:<pre><code>  <span class="hljs-keyword">import</span> <span class="hljs-title">java</span>.<span class="hljs-title">util</span>.<span class="hljs-operator">*</span>
  <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title">class</span> <span class="hljs-title">Number</span>{
      <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title">static</span> <span class="hljs-title">void</span> <span class="hljs-title">main</span>(<span class="hljs-title">String</span>[] <span class="hljs-title">args</span>){
          <span class="hljs-title"><span class="hljs-keyword">int</span></span> <span class="hljs-title">n</span> <span class="hljs-operator">=</span> 5;
          <span class="hljs-keyword">for</span>(<span class="hljs-keyword">int</span> i <span class="hljs-operator">=</span> <span class="hljs-number">1</span>; i <span class="hljs-operator">&lt;</span><span class="hljs-operator">=</span> n; i<span class="hljs-operator">+</span><span class="hljs-operator">+</span>){
              System.out.println(i);
          }
      }
  }
</code></pre></li>
<li>Here, inside the for loop, i is initialized to 1 which means that initially, the value of 1 will be 1.</li>
<li><code>i &lt;= n</code> means that the flow of control of the program will exit out of the for loop once the defined condition is hit.</li>
<li><code>i++</code> means that after printing the value of i, the flow will go to the updation part where the value of i will be updated. Here, the <code>i++</code> means that the value of i is increased by 1.</li>
<li>The program will end once the value of i becomes 6.</li>
<li>Note that when the value of i becomes 6, the flow of the program will not go inside the loop as per the defined condition.</li>
</ul>
<h2 id="heading-while-loop">While Loop</h2>
<ul>
<li>The syntax for while loop is:<pre><code>  <span class="hljs-selector-tag">while</span>(condition){
      <span class="hljs-comment">// body</span>
  }
</code></pre></li>
<li>Let me convert the above code into the while loop so that you can see the major difference between the two.<pre><code>  <span class="hljs-keyword">import</span> <span class="hljs-title">java</span>.<span class="hljs-title">util</span>.<span class="hljs-operator">*</span>
  <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title">class</span> <span class="hljs-title">Number</span>{
      <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title">static</span> <span class="hljs-title">void</span> <span class="hljs-title">main</span>(<span class="hljs-title">String</span>[] <span class="hljs-title">args</span>){
          <span class="hljs-title"><span class="hljs-keyword">int</span></span> <span class="hljs-title">n</span> <span class="hljs-operator">=</span> 5;
          <span class="hljs-keyword">int</span> i <span class="hljs-operator">=</span> <span class="hljs-number">0</span>;
          <span class="hljs-keyword">while</span>(i <span class="hljs-operator">&lt;</span><span class="hljs-operator">=</span> n){
              System.out.println(i);
              i<span class="hljs-operator">+</span><span class="hljs-operator">+</span>;
          }
      }
  }
</code></pre></li>
<li>Unlike the for loop, in while loops we have to manually define and control the initialization and the updation part.</li>
<li>We can use any loops of the two anywhere we want.</li>
<li>It is however advisable to use the for loop when we know how many times the loop is going to run and while loop when we don't know how many times the loop is going to run.</li>
</ul>
<h2 id="heading-do-while-loop">do-while loop</h2>
<ul>
<li>We have another loop called the do-while loop.</li>
<li>The syntax of do-while loop is:<pre><code>  <span class="hljs-keyword">do</span>{
      // <span class="hljs-keyword">body</span>
  }
  <span class="hljs-keyword">while</span>(condition);
</code></pre></li>
<li>Let me convert the above code into the while loop so that you can see the major difference between while and do-while loop.<pre><code>  <span class="hljs-keyword">import</span> <span class="hljs-title">java</span>.<span class="hljs-title">util</span>.<span class="hljs-operator">*</span>
  <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title">class</span> <span class="hljs-title">Number</span>{
      <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title">static</span> <span class="hljs-title">void</span> <span class="hljs-title">main</span>(<span class="hljs-title">String</span>[] <span class="hljs-title">args</span>){
          <span class="hljs-title"><span class="hljs-keyword">int</span></span> <span class="hljs-title">n</span> <span class="hljs-operator">=</span> 5;
          <span class="hljs-keyword">int</span> i <span class="hljs-operator">=</span> <span class="hljs-number">0</span>;
          do{
              System.out.println(i);
              i<span class="hljs-operator">+</span><span class="hljs-operator">+</span>;
          }
          <span class="hljs-keyword">while</span>(i <span class="hljs-operator">&lt;</span><span class="hljs-operator">=</span> n);
      }
  }
</code></pre></li>
<li>In case of do-while loop, the flow of control of the program will enter the loop at least once regardless of what condition is given in the code.</li>
<li>The body will be executed once and then the condition will be checked.</li>
</ul>
<p>This is all about Conditions and loops in JAVA. I hope that you will be able to understand everything very well.</p>
<p>In the next blog, I will cover switch case in a JAVA program in the next blog.</p>
<p>Let me know comments down below if you like what you read or have some suggestions for me and make sure to follow me on all my social handles from <a target="_blank" href="https://clevercoderjoy.bio.link/">here</a> to stay connected. If you want to get started with JAVA for the first time then you can hop back to my very <a target="_blank" href="https://clevercoderjoy.hashnode.dev/introduction-to-java-by-clevercoderjoy">first blog</a> of this series.</p>
]]></content:encoded></item><item><title><![CDATA[Type Conversion]]></title><description><![CDATA[In the previous blog, I covered the data types and some other important concepts in a JAVA program. If you have not read my previous blog yet then click here to give it a read and then proceed further from here. If you want to get started with JAVA f...]]></description><link>https://clevercoderjoy.hashnode.dev/type-conversion-by-clevercoderjoy</link><guid isPermaLink="true">https://clevercoderjoy.hashnode.dev/type-conversion-by-clevercoderjoy</guid><category><![CDATA[Java]]></category><category><![CDATA[Programming Blogs]]></category><category><![CDATA[Programming Tips]]></category><category><![CDATA[programming languages]]></category><category><![CDATA[programing]]></category><dc:creator><![CDATA[clevercoderjoy]]></dc:creator><pubDate>Sat, 23 Apr 2022 01:30:29 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/unsplash/_aUwE2DnIPg/upload/v1650674149352/gSgqj6JOW.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the previous blog, I covered the data types and some other important concepts in a JAVA program. If you have not read my previous blog yet then click <a target="_blank" href="https://clevercoderjoy.hashnode.dev/data-types-in-java-by-clevercoderjoy">here</a> to give it a read and then proceed further from here. If you want to get started with JAVA for the first time then you should start reading my very <a target="_blank" href="https://clevercoderjoy.hashnode.dev/introduction-to-java-by-clevercoderjoy">first blog</a> in the JAVA series.</p>
<p>In this blog, I will walk you through type conversion and some important key points around the concept.</p>
<h1 id="heading-type-conversion">Type Conversion</h1>
<p>The conversion of one data type into another data type is called type conversion.
When one type of data is assigned to another type of variable, then automatic type conversion will take place if the following conditions are met:</p>
<ul>
<li>The two types should be compatible (String and characters are not compatible with int, float, and long).</li>
<li>The destination type should be greater than the source type (taking an integer and providing a float or a decimal value as an input will result in an error but vice versa will work).</li>
<li>JAVA also performs automatic type conversion when storing integer constants into variables of types like byte, short, long, and even char sometimes by using their ASCII values.</li>
</ul>
<h1 id="heading-type-casting">Type Casting</h1>
<ul>
<li>If the destination type is smaller than the source, then that type of conversion is also called type casting or narrowing conversion.</li>
<li>Simply put, compressing the bigger number into a smaller data type explicitly is called type casting.</li>
<li>Type casting is also known as coercion.</li>
<li>If we have multiple types of data for a particular expression, then the result for the entire expression will be converted into the biggest data type.</li>
</ul>
<blockquote>
<p>JAVA follows Unicode principles so we can put any language inside it to print it via <code>System.out.print("any language");</code></p>
</blockquote>
<p>This is all about type casting and type conversion in JAVA. I hope that you will be able to understand everything very well.</p>
<p>In the next blog, I will cover loops and conditionals in a JAVA program in the next blog.</p>
<p>Let me know comments down below if you like what you read or have some suggestions for me and make sure to follow me on all my social handles from <a target="_blank" href="https://clevercoderjoy.bio.link/">here</a> to stay connected. If you want to get started with JAVA for the first time then you can hop back to my very <a target="_blank" href="https://clevercoderjoy.hashnode.dev/introduction-to-java-by-clevercoderjoy">first blog</a> of this series.</p>
]]></content:encoded></item><item><title><![CDATA[Data Types In JAVA]]></title><description><![CDATA[In the previous blog, I covered the inputs and outputs in a JAVA program. If you have not read my previous blog yet then click here to give it a read and then proceed further from here. If you want to get started with JAVA for the first time then you...]]></description><link>https://clevercoderjoy.hashnode.dev/data-types-in-java-by-clevercoderjoy</link><guid isPermaLink="true">https://clevercoderjoy.hashnode.dev/data-types-in-java-by-clevercoderjoy</guid><category><![CDATA[Java]]></category><category><![CDATA[Programming Tips]]></category><category><![CDATA[programing]]></category><category><![CDATA[Programming Blogs]]></category><category><![CDATA[programming languages]]></category><dc:creator><![CDATA[clevercoderjoy]]></dc:creator><pubDate>Sun, 17 Apr 2022 19:38:13 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/unsplash/GOMhuCj-O9w/upload/v1650223149011/thVqET6kg.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the previous blog, I covered the inputs and outputs in a JAVA program. If you have not read my previous blog yet then click <a target="_blank" href="https://clevercoderjoy.hashnode.dev/inputs-and-outputs-in-java-by-clevercoderjoy">here</a> to give it a read and then proceed further from here. If you want to get started with JAVA for the first time then you should start reading my very <a target="_blank" href="https://clevercoderjoy.hashnode.dev/introduction-to-java-by-clevercoderjoy">first blog</a> in the JAVA series.</p>
<p>In this blog, I will cover the data types and how can we take inputs from the user for a particular data type.</p>
<h1 id="heading-data-types">Data Types</h1>
<p>To take input from the user in JAVA, the programming language must know what type of input to take beforehand. This means that there are multiple types of data that we can take as input from the user.
In JAVA, there are two types of data:</p>
<ul>
<li>Primitive Data Type</li>
<li>Non-Primitive Data Type</li>
</ul>
<p>These data types can be further categorized into various types.</p>
<h2 id="heading-primitive-data-types">Primitive Data Types</h2>
<ul>
<li>These data types are single-value data types that can not be broken down any further.</li>
<li>We can assign only a single value to these data types.</li>
</ul>
<p>Primitive data types can be further categorized into various data types:</p>
<ul>
<li>int: For taking whole numbers (<code>int n = 56</code>)</li>
<li>char: For taking character inputs (<code>char ch = 'a'</code>)</li>
<li><p>float: For taking decimal values (<code>float n = 65.69f</code>)</p>
<ul>
<li><p>Why do we use 'f' at the end of the digits while using float?</p>
<p>Ans: All the decimal values that we have are of type double by default. So, we explicitly need to use f to tell the compiler that we need a float value, and just declaring the data type as float is not enough.</p>
</li>
</ul>
</li>
<li>double: Also for taking decimal values(<code>double d = 454554.4567</code>)</li>
<li><p>long: For taking large integer values (<code>long n = 1456546546545L</code>)</p>
<ul>
<li><p>Why do we have long when we have int?</p>
<p>Ans: This has to do something with the size of input that a particular data type can store. Long can store larger values than int.</p>
</li>
</ul>
</li>
<li>boolean: For taking true or false values (<code>boolean check = false</code>)</li>
<li>There are a few more but those are not as much used as those mentioned above.</li>
<li>Every data type has a size and range up to which they can store the data.</li>
<li>You can check the image attached below for more clarity.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650218195820/ajpQZlE0V.png" alt="image.png" /></li>
</ul>
<h2 id="heading-non-primitive-data-types">Non-Primitive Data Types</h2>
<ul>
<li>These are the multi-value data types that can be broken down even further into primitive data types.</li>
<li>We can assign multiple values to these data types.</li>
</ul>
<p>Non-Primitive data types can be further categorized into various data types:</p>
<ul>
<li>Strings: For taking a series of characters or words ( <code>String s = " s f a g blogs clevercoderjoy"</code>)</li>
<li>Arrays: For taking a series of numbers ( <code>int[] arr = {5, 6, 9, 8, 3}</code> )</li>
<li>There are some more non-primitive data types but we will cover them in later blogs.</li>
</ul>
<p>Here is a pictorial representation of various data types:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1650218883746/CoypHAbwl.png" alt="image.png" /></p>
<h3 id="heading-taking-input-for-each-primitive-data-type">Taking input for each primitive data type</h3>
<ul>
<li>We will cover taking input for non-primitive data types in later blogs.</li>
<li>For each of the primitive data types, we can assign values directly to the type of variables we want to use in our program. ( <code>int a = 5;</code> or <code>char ch = 'a';</code>)</li>
<li>There is a specific syntax for each data type if we want to take input from the user.</li>
<li>Assuming you have already written the main function and have created a Scanner object "sc" to take input from the user.</li>
<li>int: <code>int n = sc.nextInt();</code></li>
<li>char: <code>char ch = sc.next().charAt(0);</code><ul>
<li>This <code>charAt(0)</code> means that take the character at the 0th index as an input.</li>
</ul>
</li>
<li>float: <code>float n = sc.nextFloat();</code></li>
<li>double: <code>double d = sc.nextDouble();</code></li>
<li>long: <code>long n = sc.nextLong();</code></li>
<li>boolean: <code>boolean check = sc.nextBoolean();</code></li>
</ul>
<h3 id="heading-program-to-take-two-numbers-as-input-from-the-user-and-print-their-sum">Program to take two numbers as input from the user and print their sum</h3>
<p><strong>Code</strong></p>
<pre><code>    <span class="hljs-keyword">import</span> <span class="hljs-title">java</span>.<span class="hljs-title">util</span>.<span class="hljs-title">Scanner</span>;
    <span class="hljs-keyword">public</span> class Main
    {  
        <span class="hljs-keyword">public</span> static void main(String args[])   
        {
            Scanner sc <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> Scanner(System.in);
            System.out.println(<span class="hljs-string">"Enter the first number: "</span>);
            <span class="hljs-keyword">int</span> num1 <span class="hljs-operator">=</span> sc.nextInt();
            System.out.println(<span class="hljs-string">"Enter the second number: "</span>);
            <span class="hljs-keyword">int</span> num2  <span class="hljs-operator">=</span> sc.nextInt();
            <span class="hljs-keyword">int</span> sum <span class="hljs-operator">=</span> num1 <span class="hljs-operator">+</span> num2;
            System.out.println(<span class="hljs-string">"The sum of the two numbers is: "</span> <span class="hljs-operator">+</span> sum);  
        }
    }
</code></pre><p><strong>Input</strong></p>
<p>num1 -&gt; 5</p>
<p>num2 -&gt; 6</p>
<p><strong>Output</strong></p>
<p>The sum of the two numbers is: 11</p>
<h1 id="heading-comments-in-java">Comments in JAVA</h1>
<p>There are times when we just want to make notes in our code file or we might want to write down some important pointers on what a particular function is doing. So, for that we have comments. We can write anything in the comments because comments in any programming language are ignored by their compilers.</p>
<p>We have two types of comments:</p>
<ul>
<li>Single-line comments:<ul>
<li>We can use single-line comments by using two forward slashes ( <code>//</code> )<pre><code><span class="hljs-comment">// int x = 56;</span>
<span class="hljs-comment">// hey clevercoderjoy</span>
<span class="hljs-comment">// hey kunal</span>
</code></pre></li>
<li>We can highlight multiple lines on our program and press the key combination of ctrl+/ to comment on all those highlighted lines.</li>
</ul>
</li>
<li>Multi-line comments:<ul>
<li>We can use multi-line comments by using a forward slash and an asterisk to denote the start of multi-line comments and an asterisk and a forward slash to denote the end of the multi-line comment ( <code>/* */</code> ).<pre><code>   <span class="hljs-comment">/* int x = 56;
   hey clevercoderjoy
   hey Kunal */</span>
</code></pre></li>
</ul>
</li>
<li>To add multi-line comments along with pointers we can use a forward slash and two asterisks to denote the start of multi-line comments with pointers and two asterisks and a forward slash to denote the end of the multi-line comment.( <code>/** **/</code> )<pre><code>  <span class="hljs-comment">/**
  * int x = 56;
  * hey clevercoderjoy
  * her kunal
  **/</span>
</code></pre></li>
<li>Every time we press enter, we will have an asterisk at the start of the next line</li>
</ul>
<h1 id="heading-literals">Literals</h1>
<ul>
<li>In primitive data types, the values assigned to their variables are called literals.</li>
<li>In ( <code>int x = 56;</code> ), 56 is a literal that is assigned to the variable x of type integer.</li>
</ul>
<h1 id="heading-identifier">Identifier</h1>
<ul>
<li>Identifiers are used for identification purposes.<pre><code>  <span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Test</span>
  </span>{
       <span class="hljs-keyword">public</span> <span class="hljs-built_in">static</span> <span class="hljs-keyword">void</span> main(<span class="hljs-keyword">String</span>[] args)
      {
          <span class="hljs-keyword">int</span> a = <span class="hljs-number">20</span>;
      }
  }
</code></pre></li>
<li>In the above java code, we have 5 identifiers namely : <pre><code>  <span class="hljs-operator">-</span> Test : class name.
  - main : method name.
  - String : predefined class name.
  - args : variable name.
  - a :  variable name.
</code></pre></li>
</ul>
<h2 id="heading-rules-for-naming-an-identifier">Rules for naming an identifier</h2>
<p>There are certain rules to naming any identifier and violating these rules will result in an invalid identifier.</p>
<ul>
<li>The only allowed characters for identifiers are all alphanumeric characters([A-Z],[a-z],[0-9]), ‘$‘(dollar sign) and ‘_‘ (underscore).</li>
<li>Identifiers should not start with digits([0-9]).</li>
<li>Java identifiers are case-sensitive.</li>
<li>Reserved Words or keywords can’t be used as an identifier.</li>
</ul>
<p>This is all about data types in JAVA. We have also covered some other topics too and I hope that you will be able to understand everything very well.</p>
<p>In the next blog, I will cover type casting and automatic type conversion in a JAVA program in the next blog.</p>
<p>Let me know comments down below if you like what you read or have some suggestions for me and make sure to follow me on all my social handles to stay connected. Links are on the top-right corner of <a target="_blank" href="https://clevercoderjoy.hashnode.dev/">this</a> page and if you want to get started with JAVA for the first time then you can hop back to my very <a target="_blank" href="https://clevercoderjoy.hashnode.dev/introduction-to-java-by-clevercoderjoy">first blog</a> of this series.</p>
]]></content:encoded></item><item><title><![CDATA[Inputs & Outputs in JAVA]]></title><description><![CDATA[In the previous blog, I covered how does the structure of a JAVA program look like. If you have not read my previous blog yet then click here to give it a read and then proceed further from here. If you want to get started with JAVA for the first tim...]]></description><link>https://clevercoderjoy.hashnode.dev/inputs-and-outputs-in-java-by-clevercoderjoy</link><guid isPermaLink="true">https://clevercoderjoy.hashnode.dev/inputs-and-outputs-in-java-by-clevercoderjoy</guid><category><![CDATA[Java]]></category><category><![CDATA[Programming Blogs]]></category><category><![CDATA[programming languages]]></category><category><![CDATA[programmer]]></category><category><![CDATA[Programming Tips]]></category><dc:creator><![CDATA[clevercoderjoy]]></dc:creator><pubDate>Sat, 16 Apr 2022 11:12:58 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/unsplash/9CDgn574ieU/upload/v1650099464086/1IIv63ooI.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the previous blog, I covered how does the structure of a JAVA program look like. If you have not read my previous blog yet then click <a target="_blank" href="https://clevercoderjoy.hashnode.dev/structure-of-java-program-by-clevercoderjoy">here</a> to give it a read and then proceed further from here. If you want to get started with JAVA for the first time then you should start reading my very <a target="_blank" href="https://clevercoderjoy.hashnode.dev/introduction-to-java-by-clevercoderjoy">first blog</a> in the JAVA series from here.</p>
<p>In this blog, I will cover how can we take an input from the user and display some output on the screen.</p>
<h1 id="heading-inputs-in-java">Inputs in JAVA</h1>
<p>There are multiple ways to take input in JAVA but we will look into the easiest and the simplest of all of them.</p>
<ul>
<li>In JAVA, we have a class named "Scanner".</li>
<li>We can use this "Scanner" class to take input from the user.</li>
<li>This class resides in a special package named "util".</li>
<li>So, to use this class, we will first have to import this package into our JAVA program using the keyword "import".</li>
<li>The syntax for this would look something like this:<pre><code>  <span class="hljs-keyword">import</span> <span class="hljs-title">java</span>.<span class="hljs-title">util</span>.<span class="hljs-title">Scanner</span>;
  <span class="hljs-keyword">public</span> class Main{
      <span class="hljs-keyword">public</span> static void main(String[] args){
          Scanner sc <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> Scanner(System.in);
          sc.close();
      }
  }
</code></pre>Now, let me explain to you everything word by word on what it means and why we use them.</li>
<li>To be able to use some of the special libraries in our code, we need to import them using keyword import and so we have used the keyword import.</li>
<li>Most of the libraries and classes are defined inside a package named java, so to use them we need to tell the location of the package name java to our program which is why we have used the package name java.</li>
<li>Inside JAVA, there is another package named util, where the Scanner class that we want to use is located. So, to get inside or access that util package, we need to use "." (dot operator) to access the contents inside a package or a class.</li>
<li>To use the Scanner class in our program, we need to import the Scanner class and then end the line with a ";".</li>
<li>We could have also written <code>import java.util.*;</code> and <code>*</code> here means everything so it will import everything that is inside the util package including the Scanner class.</li>
<li>I have already explained to you about the public class and public static void main so I will skip this part but if you want to understand <a target="_blank" href="https://clevercoderjoy.hashnode.dev/structure-of-java-program-by-clevercoderjoy">this</a> part you can jump on to this blog for all the required explanation.</li>
<li>Now, inside the main function, Scanner is the name of the class that we want to use.</li>
<li>"sc" is just a variable name which means you can use any name here. Even your name.</li>
<li>To use the Scanner class, we will have to create its object. The keyword "new" is used to create an object in JAVA.</li>
<li>So, this statement <code>Scanner sc = new Scanner()</code> is creating the object of the Scanner class and we can then use the reference variable "sc" of this class to use this object for taking input later in our program.</li>
<li>Now, inside the brackets, we have <code>System.in</code>. This denotes the mode that we want to use for taking input from the user.</li>
<li>We need to pass the source from where we want to take input from the user inside these brackets.</li>
<li>Here, <code>System.in</code> points to the input devices attached to our computer systems which are keyboard, mouse, etc.</li>
<li>Once we are done taking input, it is a good practice to close the input stream that we opened in order to avoid risks and free some memory.</li>
<li>We use <code>sc.close();</code> to close the input stream.</li>
<li>After the input stream is closed, we can not take any more inputs unless we open the input stream again by creating a new object of the scanner class using the statement <code>Scanner sc = new Scanner(System.in)</code>.</li>
</ul>
<h1 id="heading-outputs-in-java">Outputs in JAVA</h1>
<ul>
<li>To print anything in JAVA we use the syntax <code>System.out.println("Hello, World!");</code></li>
<li>System here is an in-built class that is written by those who have created JAVA.</li>
<li><code>.</code> is used to access the contents inside a class of a package which we have already covered in the inputs in the JAVA section.</li>
<li>"out" is a variable inside the class System which is of type PrintStream.</li>
<li>PrintStream is basically used for printing data.</li>
<li>Simply put, "out" is just like a reference variable of PrintStream (don't stress too much on this part but just have an idea of what it is).</li>
<li>"println" is a method inside "out" and we access this method using the command <code>System.out.println("")</code>.</li>
<li>Inside the brackets of <code>System.out.println("")</code>, we have "" and anything we type inside these "" will be printed as it is.</li>
<li>This is how we print anything we want in JAVA.</li>
<li>Now, there is another method named print and there is a slight difference between print and println.</li>
<li>The difference between print and println is that when we use <code>System.out.print("")</code>, anything we type inside the "" will be printed in a single line and the cursor pointer stays there where the printing has stopped but when we use <code>System.out.println("")</code>,  anything that we print inside the "" will be printed and after printing what we want it to print the cursor pointer will move to the next line so the next time when we try to print something it will print from the next line.</li>
</ul>
<p>This is all you need to know about input and output as of now.</p>
<p>Now that you know about how we can take input from the user and print the output to be displayed on the screen, we can jump on to the data types in a JAVA program in the next blog.</p>
<p>Let me know comments down below if you like what you read or have some suggestions for me and make sure to follow me on all my social handles to stay connected. Links are on the top-right corner of <a target="_blank" href="https://clevercoderjoy.hashnode.dev/">this</a> page and if you want to get started with JAVA for the first time then you can hop back to my very <a target="_blank" href="https://clevercoderjoy.hashnode.dev/introduction-to-java-by-clevercoderjoy">first blog</a> of this series.</p>
]]></content:encoded></item><item><title><![CDATA[Structure Of A JAVA Program]]></title><description><![CDATA[If you have reached this blog, I believe you must have read my previous blogs too. If not, head over to this link and get started with the JAVA DSA series. In the previous blog, I covered the architecture of JAVA and what happens when a JAVA program ...]]></description><link>https://clevercoderjoy.hashnode.dev/structure-of-java-program-by-clevercoderjoy</link><guid isPermaLink="true">https://clevercoderjoy.hashnode.dev/structure-of-java-program-by-clevercoderjoy</guid><category><![CDATA[Java]]></category><category><![CDATA[Programming Blogs]]></category><category><![CDATA[programming languages]]></category><category><![CDATA[programmer]]></category><category><![CDATA[programing]]></category><dc:creator><![CDATA[clevercoderjoy]]></dc:creator><pubDate>Sun, 10 Apr 2022 18:49:04 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1649603969193/rsRgMJ09Q.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you have reached this blog, I believe you must have read my previous blogs too. If not, head over to <a target="_blank" href="https://clevercoderjoy.hashnode.dev/introduction-to-java-by-clevercoderjoy">this</a> link and get started with the JAVA DSA series. In the previous blog, I covered the architecture of JAVA and what happens when a JAVA program is compiled. If you have not read the blog, head over to <a target="_blank" href="https://clevercoderjoy.hashnode.dev/java-architecture-by-clevercoderjoy">this</a> link and give it a read.</p>
<p><em>To get started, we will need to install JAVA and an IDE or a code editor. If you have not done the prerequisites before starting out then follow the instructions given in <a target="_blank" href="https://clevercoderjoy.hashnode.dev/introduction-to-java-by-clevercoderjoy">this</a> blog.</em></p>
<h1 id="heading-hello-world">Hello, World!</h1>
<p>We will finally learn how to write our first JAVA program. But first, let's learn about the structure of a JAVA program.</p>
<blockquote>
<p>A package is simply the folder where your JAVA program is located.</p>
</blockquote>
<h2 id="heading-structure-of-a-java-program">Structure of a JAVA program:</h2>
<ul>
<li>Every file that is with an extension of ".java" is a class itself.</li>
<li>Class is basically a named group of properties and functions (we will cover this topic in detail in later blogs).</li>
<li>The class name will always be the same as the file name.</li>
<li>So, if we create a file named "Main.java", then it will have a class named "Main" (Class names always start in capital letters for good practice).</li>
<li>We will write our code inside this "Main" class.</li>
<li>The "Main" class will be a public class.</li>
<li>The "public" here, is an access specifier that deals with the privacy or access of the code.</li>
<li>This "public" means the class can be accessed from anywhere (covered in a later blog so do not stress this too much).</li>
<li>Any code that we write inside a class or a function has to be enclosed within the curly braces ({})</li>
<li>This is how a class is written:<pre><code>  <span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Main</span></span>{
  }
</code></pre></li>
<li>Inside this class, we will have to create a "main" function.</li>
<li>The name "main" is important. It is a reserved word.</li>
<li>The reserved words of any programming language can only be used where it is required and cannot be randomly used anywhere.</li>
<li>The functions created inside classes are also called methods.</li>
<li>This "main" function denotes the starting point of the program.</li>
<li>Without the "main" function the program will not run.</li>
<li>A function is just a collection of code that we can reuse later.</li>
<li>This is how the main function is written inside the class:<pre><code>  <span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Main</span></span>{
      <span class="hljs-keyword">public</span> <span class="hljs-built_in">static</span> <span class="hljs-keyword">void</span> main(<span class="hljs-keyword">String</span>[] args){
      }
  }
</code></pre><h3 id="heading-main-function-breakdown">Main Function Breakdown:</h3>
</li>
<li>Although the entire main function syntax will be explained in detail in a later blog, I will still cover what these words represent.</li>
<li>"public" here is the access specifier.</li>
<li>When a JAVA code is compiled, an object is created for every variable and function that we have in the class.</li>
<li>When we know that the main function is the entry point of our program and nothing runs before that, we need to run it without creating an object.</li>
<li>We will not create an object of the main function.</li>
<li>We have also read in the previous blog that the static variables and functions do not depend on the objects.</li>
<li>Simply put, objects will not be created for any function that has static in their declaration.</li>
<li>So, we have used static here because we do not want the object to be created for the main function.</li>
<li>The keyword "void" here is the return type of the function.</li>
<li>The return type is the type of data we want to return from the function (type of data or the data types will be covered in the next blog).</li>
<li>Simply put, whenever a function will stop executing, it will give some value and we do not want this main function to give any value.</li>
<li>"main" is a keyword here and we have discussed this in the above-mentioned points.</li>
<li>"String[] args" is an array of String data type.</li>
<li>An array is a collection of the same type of data (covered later).</li>
<li>"args" is the name of the variable given to the String type array. We can use anything in place of "args".</li>
<li>This "String[] args" array is used to store the command-line arguments or the input that we provide to the program while running it through the terminal window.</li>
<li>This, as a whole is the complete structure of a JAVA program.</li>
<li>Now, following this structure, we can write our first JAVA program.</li>
<li>This is our first JAVA program.<pre><code>  <span class="hljs-keyword">public</span> <span class="hljs-keyword">class</span> <span class="hljs-title">Main</span>{
      <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span>(<span class="hljs-params">String[] args</span>)</span>{
          System.<span class="hljs-keyword">out</span>.println(<span class="hljs-string">"Hello, World!"</span>);
      }
  }
</code></pre></li>
<li>"System.out.println("");" prints anything that we provide within the quotes.</li>
</ul>
<p>Now that you know about the structure of a JAVA program and have written your first program, we can jump on to inputs and outputs in a JAVA program in the next blog.</p>
<p>Let me know comments down below if you like what you read or have some suggestions for me and make sure to follow me on all my social handles to stay connected. Links are on the top-right corner of <a target="_blank" href="https://clevercoderjoy.hashnode.dev/">this</a> page and if you want to get started with JAVA for the first time then you can hop back to my very <a target="_blank" href="https://clevercoderjoy.hashnode.dev/introduction-to-java-by-clevercoderjoy">first blog</a> of this series.</p>
]]></content:encoded></item><item><title><![CDATA[JAVA Architecture]]></title><description><![CDATA[In the previous blog, I covered what happens when a JAVA code is executed and how a human-readable code that is not understood by the computer is translated into a machine-readable code which is only the language that the computer understands. If you...]]></description><link>https://clevercoderjoy.hashnode.dev/java-architecture-by-clevercoderjoy</link><guid isPermaLink="true">https://clevercoderjoy.hashnode.dev/java-architecture-by-clevercoderjoy</guid><category><![CDATA[Java]]></category><category><![CDATA[Programming Blogs]]></category><category><![CDATA[programming languages]]></category><category><![CDATA[programmer]]></category><category><![CDATA[programing]]></category><dc:creator><![CDATA[clevercoderjoy]]></dc:creator><pubDate>Sat, 09 Apr 2022 16:46:03 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/unsplash/l5Tzv1alcps/upload/v1649509933434/ykUPwsV3e.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the previous blog, I covered what happens when a JAVA code is executed and how a human-readable code that is not understood by the computer is translated into a machine-readable code which is only the language that the computer understands. If you have not read my previous blog yet then click <a target="_blank" href="https://clevercoderjoy.hashnode.dev/java-execution-by-clevercoderjoy">here</a> to give it a read and then proceed further from here. If you want to get started with JAVA for the first time then you should start reading my very first blog in the JAVA series from <a target="_blank" href="https://clevercoderjoy.hashnode.dev/introduction-to-java-by-clevercoderjoy">here</a>.</p>
<p>Before deep-diving into the JAVA architecture, let me first make you familiar with some of the new JAVA-specific technical jargon. </p>
<ul>
<li>JDK stands for JAVA Development Kit. It contains the JRE and some development tools.</li>
<li>JRE stands for JAVA Runtime Environment. It contains the JVM and some library classes.</li>
<li>JVM stands for JAVA virtual machine. Yes, this is the same JVM about which you read in <a target="_blank" href="https://clevercoderjoy.hashnode.dev/java-execution-by-clevercoderjoy">this</a> blog. It contains the JIT.</li>
<li>JIT stands for Just In Time compiler.</li>
<li>A hierarchal representation of the above-mentioned components can be pictured like this: </li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649510755783/ViWQDfe4T.png" alt="image.png" /></p>
<h1 id="heading-what-is-a-jdk">What is a JDK?</h1>
<ul>
<li>JDK stands for JAVA Development Kit.</li>
<li>JDK is a package (a set of files) that we can download from the internet.</li>
<li>It provides an environment to develop and run JAVA programs.</li>
<li>It contains the JRE which is used to run a JAVA program.</li>
<li>It contains a compiler called javac. Yes, this is the same compiler you read about in <a target="_blank" href="https://clevercoderjoy.hashnode.dev/java-execution-by-clevercoderjoy">this</a> blog.</li>
<li>It contains an archiver called jar which is used to archive our files.</li>
<li>It contains a Javadoc to generate docs.</li>
<li>It contains an interpreter and loader which is used to interpret and load files.</li>
<li>This means that if we want to build an application, we will need the JDK because it contains all the required files and libraries required to build and run an application.</li>
</ul>
<h1 id="heading-what-is-jre">What is JRE?</h1>
<ul>
<li>JRE stands for JAVA Runtime Environment.</li>
<li>Architecturally, it exists inside the JDK.</li>
<li>It is an installation package (a set of files) that provides an environment to only run the program.</li>
<li>It consists of: <ol>
<li>Deployment technologies</li>
<li>User interface toolkits</li>
<li>Integration libraries</li>
<li>Base libraries</li>
<li>JVM</li>
</ol>
</li>
<li>After we get the ".class" file from the compiler, the next steps take place during the runtime inside the JRE.<ol>
<li>The class loader loads all the classes needed to execute the program.</li>
<li>JVM sends the entire code (.class file) to the byte code verifier to check the format of the code.</li>
</ol>
</li>
</ul>
<h1 id="heading-what-happens-during-compile-time">What happens during compile time?</h1>
<ul>
<li>The ".java" file (source code) is passed on to the compiler (javac) where it gets compiled and generates a ".class" file (byte code).</li>
<li>The next step takes place during the runtime.</li>
</ul>
<h1 id="heading-what-happens-during-the-runtime">What happens during the runtime?</h1>
<ul>
<li>The JVM has a component called the class loader which works in 3 steps.<ul>
<li>Loading:<ol>
<li>It will read the ".class" file and generate binary data of that file.</li>
<li>An object of that file is created in the heap memory (we have read that objects of classes are created in the heap memory).</li>
<li>In simple terms, all the required files will be loaded into the heap memory.</li>
</ol>
</li>
<li>Linking:<ol>
<li>JVM verifies the ".class" file for any errors.</li>
<li>It will allocate memory to the class variables and default values declared in the code.</li>
<li>It will replace the symbolic references from the type with direct references.</li>
<li>This means in our code, whatever variables that we have declared and the values we have assigned to those variables will be linked to each other respectively.</li>
</ol>
</li>
<li>Initialization:<ol>
<li>All the static variables are assigned with their values defined in the code and static block (if there is any static block).</li>
<li>Static variables are the variables that do not depend on the objects of the classes. In other words, these variables are object-independent (do not worry if this confuses you. We will cover this in later blogs in detail but for now just try to get a basic idea). </li>
</ol>
</li>
</ul>
</li>
</ul>
<blockquote>
<p>JVM contains the stack and the heap memory allocations.</p>
</blockquote>
<h1 id="heading-what-happens-during-the-jvm-execution">What happens during the JVM execution?</h1>
<ul>
<li>The JVM has a built-in interpreter that reads the ".byte" code line by line and executes it.</li>
<li>When one method is called multiple times, the interpreter should interpret the same method again and again but this is not a very efficient way. So, to solve this issue the JVM has a runtime compiler called the just-in-time compiler.</li>
<li>The JIT compiler directly provides machine code for any method that is called multiple times and so those methods are not interpreted again and again.</li>
<li>JIT makes the execution of code faster.</li>
<li>Garbage collection also hits during this step of JVM execution.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649518399712/YNfDPeZ9HO.png" alt="image.png" /> Pictorial representation of everything you've read so far.</li>
<li>So, to sum it up in just five steps, 
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649522606430/5FEwUdoUi.png" alt="image.png" /><ol>
<li>The JAVA source code or the code you write, goes into the JDK.</li>
<li>The JDK then compiles the code ".java file" using the javac compiler into the byte code ".class file".</li>
<li>This byte code goes into the JVM where it gets converted into an executable code.</li>
<li>The executable code then goes into the JRE where it runs.</li>
<li>The result is then displayed on your computer screen.</li>
</ol>
</li>
</ul>
<h1 id="heading-jvm-vs-jre">JVM vs JRE:</h1>
<ul>
<li>JRE can just be thought a box-like structure.</li>
<li>JVM is the actual content inside the box.</li>
<li>The work done by JVM is done with the help of JRE.</li>
<li>Whatever files, libraries, and everything that JVM needs are provided by the JRE.</li>
<li>So, in short, JRE is JVM plus some extra files.</li>
</ul>
<p>Now that you know about the architecture of JAVA, we can finally jump on to writing our first JAVA program in the next blog.</p>
<p>Let me know comments down below if you like what you read or have some suggestions for me and make sure to follow me on all my social handles to stay connected. Links are on the top-right corner of <a target="_blank" href="https://clevercoderjoy.hashnode.dev/">this</a> page and if you want to get started with JAVA for the first time then you can hop back to my very <a target="_blank" href="https://clevercoderjoy.hashnode.dev/introduction-to-java-by-clevercoderjoy">first blog</a> of this series.</p>
]]></content:encoded></item><item><title><![CDATA[JAVA Execution]]></title><description><![CDATA[In the previous blog, I covered how the flow of control works in a programing language and how can we visualize our thought process in terms of symbols and in statements. If you see question marks all around your head reading the above statement then...]]></description><link>https://clevercoderjoy.hashnode.dev/java-execution-by-clevercoderjoy</link><guid isPermaLink="true">https://clevercoderjoy.hashnode.dev/java-execution-by-clevercoderjoy</guid><category><![CDATA[Java]]></category><category><![CDATA[Programming Blogs]]></category><category><![CDATA[programming languages]]></category><category><![CDATA[programmer]]></category><category><![CDATA[programing]]></category><dc:creator><![CDATA[clevercoderjoy]]></dc:creator><pubDate>Wed, 06 Apr 2022 07:50:20 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/unsplash/Skf7HxARcoc/upload/v1649230866155/zRw7t0SPU.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the previous blog, I covered how the flow of control works in a programing language and how can we visualize our thought process in terms of symbols and in statements. If you see question marks all around your head reading the above statement then jump on to <a target="_blank" href="https://clevercoderjoy.hashnode.dev/flow-of-control-by-clevercoderjoy">this</a> blog, give it a read and everything will make perfect sense to you. If you want to get started with JAVA for the first time then you can hop back to my very <a target="_blank" href="https://clevercoderjoy.hashnode.dev/introduction-to-java-by-clevercoderjoy">first blog</a> of this series.</p>
<p>Now, let's talk about how a JAVA program executes.</p>
<p>When we write code, it is in a human-readable format that is not understood by the computer. The computer only understands 0s and 1s and nothing else except for these two values. It is practically impossible for us to write code purely in 0s and 1s so, for that purpose we use a programming language. The code that we write goes through some kind of <strong><em>processing</em></strong> in the back-end which then gets converted into machine-readable code before it gets executed. </p>
<blockquote>
<p>JAVA is a platform-independent language.</p>
</blockquote>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649229131657/OXqGhQMqU.png" alt="image.png" /></p>
<h1 id="heading-what-happens-when-a-java-code-is-executed">What happens when a JAVA code is executed?</h1>
<ul>
<li>All the JAVA code that we will write will get saved with an extension of ".java". This file is in a human-readable format. This file is also called the source code.</li>
<li>This ".java" file is sent to the compiler for further processing.</li>
<li>A compiler is the software that converts the source code into the machine code(0s and 1s) in one go.</li>
<li>The JAVA compiler converts this ".java" file to a ".class" file. This file is also called a byte code which is specific to JAVA.</li>
<li>Byte code is an intermediate language of JAVA.</li>
<li>This file will not directly run on a system but we need a software called JAVA Virtual Machine also known as JVM (will be covered in detail in the next blog).</li>
<li>JVM with the help of an interpreter will interpret this byte code line by line and convert it into the machine code (0s and 1s).</li>
<li>An interpreter is software that that converts the source code into the machine code line by line.</li>
<li>The machine code is then finally executed.</li>
<li>Because of the existence of byte code, JAVA is a platform-independent language.<h2 id="heading-what-is-platform-independence">What is platform independence?</h2>
</li>
<li>Platform independence means that the program/software can be executed on any platform or operating system in existence.</li>
<li>We need to convert the source code into the machine code so that the computer can understand it.</li>
<li>Compiler does this by converting the source code into an executable code.</li>
<li>This executable code is a set of instructions for the computer.</li>
<li>In other programming languages, after compiling we get is an executable code that is platform dependent but in the case of JAVA, we get a byte code that is platform independent.</li>
<li>This byte code (.class) file can run on all operating systems.</li>
<li>JVM converts this byte code into the machine code (executable code).</li>
<li>JAVA is platform-independent but JVM is platform dependent which means that we need to download JVM for the respective operating system that we want it to run on.</li>
</ul>
<p>Now that you know how a JAVA program executes, we can jump on to the architecture of JAVA in the next blog.</p>
<p>Let me know comments down below if you like what you read or have some suggestions for me and make sure to follow me on all my social handles to stay connected. Links are on the top-right corner of <a target="_blank" href="https://clevercoderjoy.hashnode.dev/">this</a> page and if you want to get started with JAVA for the first time then you can hop back to my very <a target="_blank" href="https://clevercoderjoy.hashnode.dev/introduction-to-java-by-clevercoderjoy">first blog</a> of this series.</p>
]]></content:encoded></item><item><title><![CDATA[Flow of Control]]></title><description><![CDATA[In the previous blog, I covered how memory is being managed when we throw some piece of code into our computer systems. If you have not read about that important concept, you can jump on to this blog and give it a read and if you want to get started ...]]></description><link>https://clevercoderjoy.hashnode.dev/flow-of-control-by-clevercoderjoy</link><guid isPermaLink="true">https://clevercoderjoy.hashnode.dev/flow-of-control-by-clevercoderjoy</guid><category><![CDATA[Java]]></category><category><![CDATA[Programming Blogs]]></category><category><![CDATA[programming languages]]></category><category><![CDATA[programmer]]></category><category><![CDATA[programing]]></category><dc:creator><![CDATA[clevercoderjoy]]></dc:creator><pubDate>Tue, 05 Apr 2022 08:19:17 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/unsplash/cCthPLHmrzI/upload/v1649142787430/hucYDdElp.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the previous blog, I covered how memory is being managed when we throw some piece of code into our computer systems. If you have not read about that important concept, you can jump on to <a target="_blank" href="https://clevercoderjoy.hashnode.dev/memory-management-in-programming-languages-by-clevercoderjoy">this</a> blog and give it a read and if you want to get started with JAVA for the first time then you can hop back to my very <a target="_blank" href="https://clevercoderjoy.hashnode.dev/introduction-to-java-by-clevercoderjoy">first blog</a> of this series.</p>
<h1 id="heading-flowchart">Flowchart</h1>
<p>Every piece of code that we write, follows five key steps that make that program complete. These key steps are also known as flowcharts.
A flowchart is a tool to visualize our thought process. It can be used to code even the most complex programs too. It is used by representing with symbols what steps to take to achieve a particular goal.
A flowchart has five important steps:</p>
<ul>
<li>Start/Stop: The program will start and end. This step is represented by an oval shape.</li>
<li>Input/Output: The program would take some input and display an output. This step is represented by a parallelogram.</li>
<li>Processing: The program will process some information while executing. This step is represented by a rectangle.</li>
<li>Condition: The program will have to make some decisions to achieve a particular goal. This step is represented by the rhombus.</li>
<li>Flow of direction of the program: This denotes the direction in which the program will execute. This step is symbolized by an arrow.</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649133045713/yVwbJ-1T2.png" alt="image.png" /> 
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649143141404/JMeWmcIO-.png" alt="image.png" />This is how it looks graphically.</p>
<p>To understand this even better, let me explain this to you with the help of an example.
Let's say that we want to take an input "salary" and if the salary is greater than 10,000, we add a bonus of 2000 otherwise we want to add a bound of 1000.
How will we do this in terms of a flowchart?
Well. here's the answer:
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649134697609/_04E_ddxu.png" alt="image.png" /></p>
<ul>
<li>Our program will start (oval).</li>
<li>We will take input of salary (parallelogram).</li>
<li>We will check if the salary is greater than 10,000 which means we will add a condition in our program (rhombus).</li>
<li>Depending on the fact that if the condition is being satisfied or not, we will add 2000 or 1000 to our salary input which means that we are processing our input here (rectangle).</li>
<li>After the processing step is complete, we will print the final answer which means that we are displaying an output (parallelogram).</li>
<li>Once all the required steps are completed, our program will stop (oval).<h1 id="heading-pseudocode">Pseudocode</h1>
A basic but very important concept of computer science is pseudocode. This is another way of representing the steps we need to take to complete a particular task. When we want to share the algorithm  (steps involved to complete a task) of our code and don't care much about the syntax during this process of sharing, we only care about explaining what the algorithm for the code is and how it functions, we use pseudocode. Pseudocode can be thought of as a rough code common for all programming languages.
This is what the pseudocode for the above example will look like:</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649145307426/EgiD92AYa.png" alt="image.png" /></p>
<ul>
<li>We start the program.</li>
<li>We take input.</li>
<li>We check the condition if the salary is greater than 10,000 using the if (I will cover this later in a separate blog) keyword.</li>
<li>Next step will be adding the bonus of 2000 to our salary input which will occur inside the if condition only if the condition is satisfied so, we have left a tab space to represent it clearly.</li>
<li>If the above condition is not satisfied, we use the else keyword to display the alternate steps to take which will occur inside the else condition so we have left a tab space for that too.</li>
<li>Basically, whatever steps take place inside any condition or loop has to be displayed by leaving a tab space so that it is evident what steps are taking place inside those conditions or loops.</li>
<li>After the processing part is done we simply output the salary.</li>
<li>We stop our program.</li>
</ul>
<p>This was a gist of how the flow of control of a program works and how we can represent the steps we will take to complete the given task via flowchart and via pseudocode. Although I have tried to keep things as simple and detailed as possible but for even more detailed information you can watch <a target="_blank" href="https://www.youtube.com/watch?v=lhELGQAV4gg&amp;list=PL9gnSGHSqcnr_DxHsP7AW9ftq0AtAyYqJ&amp;index=6">this</a> video and you will get a very clear idea of these topics.
In the next blog, I will try to cover how a JAVA program executes so, hang on tight!</p>
<p>Let me know comments down below if you like what you read or have some suggestions for me and make sure to follow me on all my social handles to stay connected. Links are on the top-right corner of <a target="_blank" href="https://clevercoderjoy.hashnode.dev/">this</a> page and if you want to get started with JAVA for the first time then you can hop back to my very <a target="_blank" href="https://clevercoderjoy.hashnode.dev/introduction-to-java-by-clevercoderjoy">first blog</a> of this series.</p>
]]></content:encoded></item><item><title><![CDATA[Memory Management in Programming Languages]]></title><description><![CDATA[I trust that you know about the various types of programming languages by now, so let's talk about how memory is managed under the hood. If none of this looks relevant to you or you don't understand what I am blabbering about here you can read my pre...]]></description><link>https://clevercoderjoy.hashnode.dev/memory-management-in-programming-languages-by-clevercoderjoy</link><guid isPermaLink="true">https://clevercoderjoy.hashnode.dev/memory-management-in-programming-languages-by-clevercoderjoy</guid><category><![CDATA[Java]]></category><category><![CDATA[Programming Blogs]]></category><category><![CDATA[programming languages]]></category><category><![CDATA[programing]]></category><category><![CDATA[programmer]]></category><dc:creator><![CDATA[clevercoderjoy]]></dc:creator><pubDate>Mon, 04 Apr 2022 08:22:01 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/unsplash/BiMQuB1LwTw/upload/v1649053587763/AanJj9lRs.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I trust that you know about the various types of programming languages by now, so let's talk about how memory is managed under the hood. If none of this looks relevant to you or you don't understand what I am blabbering about here you can read my previous related blog to get a clear picture of everything that I am going to talk about <a target="_blank" href="https://clevercoderjoy.hashnode.dev/types-of-programming-languages">here</a> and if you want to get started with JAVA for the first time then you can hop back to my very <a target="_blank" href="https://clevercoderjoy.hashnode.dev/introduction-to-java-by-clevercoderjoy">first blog</a> of this series.</p>
<p>In the world of programming, there are two types of memories that majorly play their part when we throw any piece of code into our computer systems i.e. stack memory and heap memory.</p>
<h2 id="heading-stack-memory">Stack Memory</h2>
<ul>
<li>A stack memory is a contiguous block of memory (I will cover this later in a separate blog so don't worry too much about it but just try to get an idea of what it is).</li>
<li>The size of memory to be used for a particular program is decided by the compiler.</li>
<li>You can picture a stack memory like a pile of books placed on top of each other.<h2 id="heading-heap-memory">Heap Memory</h2>
</li>
<li>A heap memory is used to store the objects that are created during the execution of a program.</li>
<li>You can picture a heap memory as a big bubble that stores the objects to the references that are stored in the stack memory (confused right? Don't worry I've got you!).<h2 id="heading-how-do-the-stack-and-the-heap-memory-work-together">How do the stack and the heap memory work together?</h2>
</li>
<li>In programming languages, we declare and initialize variables to use them later in the program.</li>
<li>This <code>int n = 10;</code> is how we declare and initialize a variable in the JAVA programming language (I will cover more on this later in a separate blog but for now just try to follow along without getting too much into the syntax).</li>
<li>Now here, "int" is the data type of any variable that we declare.</li>
<li>"n" is the name of the variable. It is actually called a reference variable. We can give any name we want but for now, let's just keep it simple.</li>
<li>"=" is the assignment operator used to assign values to the reference variables.</li>
<li>"10" is the value assigned to the variable n but this value "10" is actually an object of the reference variable "n". </li>
<li>The reference variables that we declare are created inside the stack memory.</li>
<li>The objects that we initialize for these reference variables get stored inside the heap memory at a random memory location.</li>
<li>Every location in the heap memory has a unique address.</li>
<li>The reference variables <strong><em>point</em></strong> to their corresponding objects stored at some unique memory address.</li>
<li>Now when we ask the computer by writing some relevant piece of code to display the value of "n", it checks which object is the reference variable pointing to and displays the result as "10";</li>
<li>To give you a pictorial representation of things I just talked about here's what things look like:</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649057230529/XIvkoyJFb.png" alt="image.png" /></p>
<ul>
<li>Now just like the reference variable "n", we can have multiple other reference variables with the same value as that of "n".</li>
<li>In this case, if the compiler goes on and allocates multiple heap memory locations to every other variable with the same value, the system will crash or in other words, we will get some kind of overflow error.</li>
<li>What actually happens is that if we create multiple variables with the same value or same objects then all those different variables will point to a single object in the heap memory because all the variables have the same value.</li>
<li>For example: <code>int n = 10; int m = 10; int x = 10;</code> all these variables will point to a single heap memory location where the object "10" is stored.</li>
<li>To make this even more understandable and simple, let's say my name is Joy but my brother calls me bro, my mother calls me son and my dog calls me woof.</li>
<li>Now if my brother says bro I will hear, if my dog says woof I will hear and if my mother says son then also I will hear.</li>
<li>So, multiple variables (mother, brother, dog) can have the same object (me) and different objects with the same values (me) will not be created.</li>
<li>Any changes made to the object by any of the reference variables, the object will change for all the other variables too since all the variables are still pointing to the same object.</li>
<li>For example, if my mother asks me to shave my head bald, my dog, my brother, and my mother, all of them will be able to see my clean shaved bald head since all of them are pointing towards the same object (me).<h2 id="heading-garbage-collection">Garbage Collection</h2>
</li>
<li>Garbage collection is a way to free the computer's memory (I will cover this in detail later but for now, I'll just give you an idea about what it is).</li>
<li>Let's consider this scenario, my name is Joy and I have a girlfriend (right now the ref variable girlfriend is pointing towards Joy). She met a new guy named pig whom she started dating and dumped me(now the ref variable girlfriend is pointing towards the new variable "pig"). Because my girlfriend dumped me I got very depressed and decided to leave this materialistic world and forsake my name and become a monk. After some time since I have no name (no ref variable pointing towards me), I will be forgotten and removed from the memory of those who knew me as Joy.</li>
<li>Any object that does not have a reference variable pointing towards them, will be removed from the memory when garbage collection hits.</li>
<li>Garbage collection hits automatically.</li>
<li>To give you a pictorial representation of things I just talked about here's what things look like:</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1649059939744/9xChkHRbw.png" alt="image.png" />
Now that you know about how memory is managed under the hood, we can move on to the next topic in the next blog and learn about how a program flows from one step to another and we will also learn about decision making in a programming language. So, hang on tight!</p>
<p>Let me know in the comments down below if you like what you read or have any suggestions for me and make sure to follow me on all my social handles to stay connected. Links are on the top-right corner of <a target="_blank" href="https://clevercoderjoy.hashnode.dev/">this</a> page.</p>
]]></content:encoded></item><item><title><![CDATA[Types of Programming Languages]]></title><description><![CDATA[Before actually deep-diving into JAVA, its syntax, and the underlying concepts in the language, let me first tell you about the types of languages that are known around the world today. If none of this looks relevant to you or you don't understand wh...]]></description><link>https://clevercoderjoy.hashnode.dev/types-of-programming-languages</link><guid isPermaLink="true">https://clevercoderjoy.hashnode.dev/types-of-programming-languages</guid><category><![CDATA[Java]]></category><category><![CDATA[Programming Blogs]]></category><category><![CDATA[programing]]></category><category><![CDATA[programmer]]></category><category><![CDATA[programming languages]]></category><dc:creator><![CDATA[clevercoderjoy]]></dc:creator><pubDate>Sun, 03 Apr 2022 08:43:43 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/unsplash/THmxQP-QgC8/upload/v1648975297250/sUhSMo3nZ.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Before actually deep-diving into JAVA, its syntax, and the underlying concepts in the language, let me first tell you about the types of languages that are known around the world today. If none of this looks relevant to you or you don't understand what I am blabbering about here you can read my previous related <a target="_blank" href="https://clevercoderjoy.hashnode.dev/introduction-to-java-by-clevercoderjoy">blog</a> to get a clear picture about everything that I am going to talk about here.</p>
<h2 id="heading-types-of-programming-languages">Types of Programming Languages:</h2>
<p>Everything that our computers work on is just a bunch of 0s and 1s. So any instruction that we pass to our computer with some clicks and taps from our keyboard and mouse gets converted into a bunch of 0s and 1s internally in order for the computers to understand what we actually want it to do.
Now there are various ways in which these instructions can be passed on to the computer.
Depending on how these instructions are passed on to the computer, programming languages can be classified into three types i.e. Procedural, Functional, and Object-Oriented.</p>
<h3 id="heading-procedural-programming-language">Procedural Programming Language:</h3>
<ul>
<li>This language specifies a series of well-structured steps and procedures to compose a program.</li>
<li>It contains a systematic order of statements, functions, and commands to complete the given task.</li>
</ul>
<h3 id="heading-functional-programming-language">Functional Programming Language:</h3>
<ul>
<li>In this type of language, we aim to write programs only in terms of pure functions (don't worry about it if you don't know about functions. I will cover it later in a separate blog). This means that don't modify any variable but only create new ones as an output.</li>
<li>The basic idea behind a functional programming language is to bundle the piece of code inside a function and reuse the same function instead of writing the same thing over and over.</li>
</ul>
<h3 id="heading-object-oriented-programming-language">Object-Oriented Programming Language:</h3>
<ul>
<li>This type of language revolves around objects.</li>
<li>I will cover objects later in a separate blog too but just to give you an insight or an intuition about what object-oriented programming looks like, it's just some code and data all wrapped up together in one (code + data = object).</li>
<li>This paradigm of language was developed to make it easier to develop, debug, reuse and maintain any software.</li>
</ul>
<p>Apart from the fashion in which the instructions are passed, a programming language can also be classified into another type which determines how a programming language is typed.</p>
<h3 id="heading-statically-typed">Statically Typed:</h3>
<p>The rules followed by statically typed language are:</p>
<ul>
<li>Type checking is performed at compile time.</li>
<li>Errors will show at compile time.</li>
<li>Declare the type of data for the variable before initializing and using it in the code.
<em>Compilation means the conversion of human-readable code to machine-readable code and compile-time means during the process of compilation.</em><h3 id="heading-dynamically-typed">Dynamically Typed:</h3>
The rules followed by dynamically typed language are:</li>
<li>Type checking is done at runtime.</li>
<li>Errors will show at runtime.</li>
<li>No need to declare the type of data before initializing and using it in the code.
<em>Runtime means during the time when the program is finally running after compilation is done.</em></li>
</ul>
<p>Now that you know about the types of programming languages, we can move on to the next topic in the next blog which is "memory management in programming languages" so hang on tight! we are just getting started.</p>
<p>Let me know in the comments down below if you like what you read or have any suggestions for me and make sure to follow me on all my social handles to stay connected. Links are on the top-right corner of <a target="_blank" href="https://clevercoderjoy.hashnode.dev/">this</a> page.</p>
]]></content:encoded></item><item><title><![CDATA[Introduction to JAVA]]></title><description><![CDATA["Sharing what you learn solidifies what you learn."
Learning your first programing language can be quite a challenging task when you are just starting out to build your career in tech. When I started learning to code I started with python programing ...]]></description><link>https://clevercoderjoy.hashnode.dev/introduction-to-java-by-clevercoderjoy</link><guid isPermaLink="true">https://clevercoderjoy.hashnode.dev/introduction-to-java-by-clevercoderjoy</guid><category><![CDATA[Java]]></category><category><![CDATA[Programming Blogs]]></category><dc:creator><![CDATA[clevercoderjoy]]></dc:creator><pubDate>Sun, 03 Apr 2022 03:20:48 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/unsplash/6GDW9BVdmkw/upload/v1648956088499/vVW7NsYfX.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>"Sharing what you learn solidifies what you learn."</p>
<p>Learning your first programing language can be quite a challenging task when you are just starting out to build your career in tech. When I started learning to code I started with python programing language because it has a very simple syntax and is easy to pick up but also because I never understood JAVA and its complicated syntax, because we have to write so many lines of code just to write a simple hello world program.
Here's an example of a simple "Hello World!" program in JAVA and python just to give you an idea of the syntax for both the language:</p>
<p>Python: 
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1648952486034/Zt4rfsbPM.png" alt="code.png" /></p>
<p>JAVA: 
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1648952762958/V5CmmUXqU.png" alt="image.png" /></p>
<p>Did you see that? How easy it is to write code in python compared to JAVA. Just one single line printed our "Hello World!" in python whereas JAVA needs 8 freaking lines for the same thing.
Then why do we need JAVA or other languages with such lengthy and complicated syntax and why not python or some other programing language which has such simple syntax like python?
The answer to this question is that every single language or technology that has ever been created solves a real-life problem but none of those technologies are perfect. So to improve on the previous or outdated tech new tech is being created all the time and so today, we have numerous different programming languages and technologies, each of them serving its own purpose to help in solving some or the other real-life problem.</p>
<p>Knowing the fact that it gets so overwhelming to understand the whys and why nots while learning any programing language, I will share what I have learned so far while learning JAVA by breaking down my knowledge of every concept involved in this language through these blogs so that it gets easier for others to understand the underlying concepts.</p>
<p>I am also sharing the resource from where I am learning so that you can refer to it too and trust me you'll this is one of the best resources out there over the internet.
<a target="_blank" href="https://www.youtube.com/watch?v=rZ41y93P2Qo&amp;list=PL9gnSGHSqcnr_DxHsP7AW9ftq0AtAyYqJ">The JAVA DSA Playlist by Kunal Kushwaha</a>
If you want to practice what you are learning then you can refer to this <a target="_blank" href="https://github.com/kunal-kushwaha/DSA-Bootcamp-Java">GitHub repository by Kunal Kushwaha:</a>. This has some amazingly organized topic-wise LeetCode questions for interview perspective. You will also need a good code editor to practice what you are learning.
There are plenty of code editors out there but for JAVA it is recommended to use the IntelliJ idea which you can download from this link <a target="_blank" href="https://www.jetbrains.com/idea/download/?fromIDE=#section=windows">here</a> or if you want to use an online code editor then <a target="_blank" href="https://replit.com/~">repl.it</a> would be your go-to online IDE. If you choose to use an offline code editor then you will have to install <a target="_blank" href="https://www.oracle.com/java/technologies/downloads/#java16">JAVA</a> so make sure you do that too.</p>
<p>Sit tight once you are done setting up your work environment and we will get started from the very next blog.</p>
<p>Let me know in the comments down below if you like what you read or have any suggestions for me and make sure to follow me on all my social handles to stay connected. Links are on the top-right corner of <a target="_blank" href="https://clevercoderjoy.hashnode.dev/">this</a> page.</p>
]]></content:encoded></item><item><title><![CDATA[My journey from being a born failure to an aspiring software developer: part-2]]></title><description><![CDATA[RECAP:
In the previous blog, I mentioned how I struggled to get into college. How little to none I was coding. You can read all about it by following the link here:   My journey from being a born failure to an aspiring software developer: part-1 
It ...]]></description><link>https://clevercoderjoy.hashnode.dev/my-journey-from-being-a-born-failure-to-an-aspiring-software-developer-part-2</link><guid isPermaLink="true">https://clevercoderjoy.hashnode.dev/my-journey-from-being-a-born-failure-to-an-aspiring-software-developer-part-2</guid><category><![CDATA[Web Development]]></category><category><![CDATA[software development]]></category><category><![CDATA[React]]></category><category><![CDATA[newbie]]></category><category><![CDATA[JavaScript]]></category><dc:creator><![CDATA[clevercoderjoy]]></dc:creator><pubDate>Thu, 23 Sep 2021 18:33:29 GMT</pubDate><content:encoded><![CDATA[<p>RECAP:
In the previous blog, I mentioned how I struggled to get into college. How little to none I was coding. You can read all about it by following the link here:   <a target="_blank" href="https://clevercoderjoy.hashnode.dev/my-journey-from-being-a-born-failure-to-an-aspiring-software-developer-part-1">My journey from being a born failure to an aspiring software developer: part-1</a> </p>
<p>It was around October when I started doing my research on how to get started with coding. I came across a guy; let's name him Mr. R. How he got into coding, how he started making money and was able to help his mom with her operation, and started his own youtube channel was a huge inspiration for me. I kind of started following him closely and started following the same path he followed to become a freelance software developer so I took an online certification course for python and DSA as my new year resolution. </p>
<p>From the start of 2021, I was working from 6 pm to 5 am in a call center, sleeping for 5 hours a day, and learning to code in the remaining time. At first, I was very religiously coding and finished the python certification within 2 weeks but when I started learning DSA things started to go bouncer over my head after one point of time. DSA is hard so to improve in that aspect I started competitive coding and that decision was like banging my head over a concrete wall. I used to literally waste my whole day trying to solve one question. I was able to code the basic problems but most of the intermediate questions were so complicated to even understand and companies would ask those kinds of questions in their coding round.</p>
<p>I had built 3 projects on python but those companies wanted me to solve those algorithm challenges and had no value for proof of work. And there I was, a jobless fellow, trying to learn Django, solve those algorithm challenges, build another project all in one day somehow trying to figure out what to do to get into these tech companies and slipping into depression day by day until that day.</p>
<p>I remember that day because I failed another interview because even companies providing Rs1000 for internships wanted experienced people. I was reconsidering my decision of leaving the job for making that career transition while browsing youtube and stumbled on a video of Tanay where he explained about web development and what neoG camp was. I did a little research around it and figured out that it was not just another course but actually could help me build my profile and I would learn a lot in the process.</p>
<p>I started with the level zero training in the mid of August and today while I write my second blog, the month of September is not yet over and I have 15+ projects in my portfolio, learned to work with HTML, CSS, JavaScript, Web Hosting, git, React.js and so much more. I was able to learn all of this in less than 2 months. Not only did I complete all the assignments given and build the projects but also feel very confident about my skills.</p>
<p>I am extremely confident that I will get a good job soon and also eagerly waiting to join level one of the camp to learn and master the concepts of web development. This has been the most fun learning experience of my life so far. I have been a big fat failure for most of my life but now if I say that I can do it then anyone in the world can do it too. All you need is to put in your time and your dedicated hard work.</p>
]]></content:encoded></item><item><title><![CDATA[My journey from being a born failure to an aspiring software developer: part-1]]></title><description><![CDATA[Y'all must have heard about genius and extremely bright kids making their way to colleges with big names and then to big companies. Their stories are inspirations for so many people out there. But honestly, it's not always that interesting to hear ab...]]></description><link>https://clevercoderjoy.hashnode.dev/my-journey-from-being-a-born-failure-to-an-aspiring-software-developer-part-1</link><guid isPermaLink="true">https://clevercoderjoy.hashnode.dev/my-journey-from-being-a-born-failure-to-an-aspiring-software-developer-part-1</guid><category><![CDATA[Web Development]]></category><category><![CDATA[software development]]></category><category><![CDATA[React]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[newbie]]></category><dc:creator><![CDATA[clevercoderjoy]]></dc:creator><pubDate>Fri, 17 Sep 2021 09:25:44 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/unsplash/V5DBwOOv0bo/upload/v1648957737008/cCuQ2Mjyq.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Y'all must have heard about genius and extremely bright kids making their way to colleges with big names and then to big companies. Their stories are inspirations for so many people out there. But honestly, it's not always that interesting to hear about their journey especially for those who've always been a failure throughout their lives because those successful kids were born geniuses who barely ever failed. These kinds of people require motivation from those with whom they can relate to, those who have been slapped by failure on their faces a countless number of times and yet they have managed to transform their lives in such a drastic way that people find it "some kind of hard to believe fantasy story".</p>
<p>Before I start let me give you a brief introduction about myself. I'm Joy, extremely lazy, hate maths, failed in 6th standard, repeated 9th standard, being extremely demotivated by someone; I opted for commerce, dropped commerce after a month, opted for science, again failed in 11th standard. I couldn't clear any of the competitive exams because I'm not that good with maths but getting 11 marks in exams like IIT Entrance felt like an achievement to me.</p>
<p>After much struggle somehow I got into a college named ABESIT, Ghaziabad. Starting from the first year I started studying hard so that I could pass my semester exams. I had to cram up most of the things because of numerical and mathematical questions since I didn't understand math and nor did I do up till today's date. Even after studying so hard, I got my first backlog in the first semester itself and then this process of getting and clearing backlogs continued like some kind of tradition. Every semester I had a couple of backlogs that I had to clear later in the next semester.</p>
<p>"When you know things it'll be easier for you to do."</p>
<p>I took costly coaching for learning java programming language when I was in 10th standard because I did not understand even a single line of code back then. But later since I knew and understood coding a little bit I took computer science in my intermediate school as well but didn't write a single line of code the whole year until my exams were on my head. This made me realize that I've forgotten everything I learned so I took up the same costly coaching again but this time I did not understand coding even after the coaching classes but somehow managed to clear my board exams.</p>
<p>During my time in college, I took part in some coding events in the college club, and a hackathon where my role was just to fill the space for a team member and did not code at all in the event. All these events took place when I was in the odd semester of my third year and because of the tension of clearing my backlogs and my exams, I stopped coding. I had no one to guide me on what should I do, how should I clear my backlogs or how should I clean up the mess that I made of my life. I didn't even think if I'd be able to secure a job from college placements but to my surprise, I was able to crack the placement offers for two companies. Let's say one of them was company 'X' and the other one was company 'Y'.</p>
<p>When my exams were almost over, someone called me from the company 'Y' and mentioned that I'll have to join the office from X date and further information would be provided in another couple of days. After my exams were finally over, I kept calling the company folks but ended up with no response at all. So I finally decided to join company 'X'.</p>
<p>During the onboarding process, I was told that the process in which I will be in has a semi-technical job and it will not involve picking up calls but later when I went to the work location I found myself picking up calls mostly from ridiculously brain-dead Indian customers who kept buying tech from a particular brand which they knew is gonna break and its repair would cost them double the purchase amount. Many of those customers had already received warnings regarding the product from their friends and relatives but still bought the product anyway and later call us up to abuse how pathetic the product was.</p>
<p>I was literally being abused on the job every single day and not only this those brain-dead customers used to call during the nighttime and demanded that their devices be taken on remote connection and once done they'd flash their nudes through the device camera. Some of them used to get drunk and call us just to entertain themselves with ridiculous questions and uncomfortable topics.</p>
<p>Despite all of this nonsense, I had gotten too comfortable with the work environment there and somewhere in my mind, I made myself believed that coding was not for me. Coding was hard and one needed to be really good to be coding for any company. I disqualified myself from coding. After working there for seven months, I got to know that the process for which I was working in company 'X' was shutting down. I took advantage of this situation and went for a job change because I was earning just Rs 10,000 per month and my room rent was Rs 2,000 more than my salary. I joined the company 'Z' which, again was a call center but at least I was not being abused there by brain-dead customers but the work there, I didn't understand at all.</p>
<p>"You are whom you surround yourself with."</p>
<p>I started working here picking up calls every single day just to earn Rs 25,000 per month. While I was working, I had a good friend who was a mechanical engineer and jobless at the same time since the mechanical industry had completely collapsed. He started learning to code since there's a lot of money and life with code just gets better and better. This made me think if a mechanical engineer can shift his career to coding, well, I was from the Information Technology branch so I could do it too.</p>
<p>NOTE: Read my remaining journey in Part - 2 of this blog from the link here:  <a target="_blank" href="https://clevercoderjoy.hashnode.dev/my-journey-from-being-a-born-failure-to-an-aspiring-software-developer-part-2">My journey from being a failure to a software developer</a> </p>
]]></content:encoded></item></channel></rss>