<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: jana009</title>
    <description>The latest articles on DEV Community by jana009 (@jana009).</description>
    <link>https://dev.to/jana009</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F572152%2Fe44a989d-0cc5-407e-9cc0-7083978855db.png</url>
      <title>DEV Community: jana009</title>
      <link>https://dev.to/jana009</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jana009"/>
    <language>en</language>
    <item>
      <title>Exception Handling</title>
      <dc:creator>jana009</dc:creator>
      <pubDate>Sat, 23 Sep 2023 20:45:35 +0000</pubDate>
      <link>https://dev.to/jana009/exception-handling-3opi</link>
      <guid>https://dev.to/jana009/exception-handling-3opi</guid>
      <description>&lt;p&gt;Hi Guys,&lt;/p&gt;

&lt;p&gt;In programming, lots of time we face errors. As a programmer we need to know how to handle those unexpected scenario in a best way so that's why we are going to see about &lt;strong&gt;Exception Handling&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Exception:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Exception&lt;/strong&gt; is an unwanted or unexpected situation which causes the program to &lt;strong&gt;&lt;em&gt;terminate abnormally&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Default Exception Handler:
&lt;/h2&gt;

&lt;p&gt;When executing the program if an exception occurs then the method in which the exception created is responsible to create the &lt;strong&gt;Exception Object&lt;/strong&gt;.The Exception Object Contains 3 information&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Name of the Exception&lt;/li&gt;
&lt;li&gt;Description of the Exception&lt;/li&gt;
&lt;li&gt;Stack trace(provide the information from which method and which line exactly the error occurs) and handover this object to the JVM(Java Virtual Machine).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then JVM gives the object to &lt;strong&gt;&lt;em&gt;Default Exception Handler&lt;/em&gt;&lt;/strong&gt; and terminates the program abnormally without executing rest of the lines.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example with no Exception:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class ExcepExample{
    public static void main(String args[]){

        int num=10/2;
        System.out.println("Print the A Value  "+num);
        System.out.println("End of the Program! ");

    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cu_JTRiZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ihq0u8l8gu0razt2fb6h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cu_JTRiZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ihq0u8l8gu0razt2fb6h.png" alt="Without Exception" width="336" height="82"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Example with Exception
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class ExcepExample{
    public static void main(String args[]){

        int num=10/0;
        System.out.println("Print the A Value  "+num);
        System.out.println("End of the Program! ");

    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xPCr_cFE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bh6pzdbciuzqhsf1j8jw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xPCr_cFE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bh6pzdbciuzqhsf1j8jw.png" alt="With Exception" width="433" height="111"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In Example Without Exception the program runs successfully and we got the output but in the Example with Exception the program terminates abruptly without executing the rest of the lines and prints the details of the Exception &lt;strong&gt;ArithmeticException&lt;/strong&gt;.&lt;br&gt;
In above exception exception example&lt;br&gt;
&lt;em&gt;ArithmeticException&lt;/em&gt; =&amp;gt; Name of the Exception&lt;br&gt;
&lt;em&gt;/ by zero&lt;/em&gt; =&amp;gt; Description of the Exception&lt;br&gt;
&lt;em&gt;at ExcepExample.main(ExcepExample.java:4)&lt;/em&gt; =&amp;gt; Is the stack trace.&lt;/p&gt;

&lt;p&gt;So as programmer we need to handle this scenario and make program to terminate in normal way.&lt;/p&gt;

&lt;p&gt;For that will use try...catch&lt;/p&gt;

&lt;h2&gt;
  
  
  Try...Catch
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Syntax
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;try{&lt;br&gt;
    //code Which cause the Exception&lt;br&gt;
}Catch(Exception ex){&lt;br&gt;
   // Customize the how to display the exception&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class ExcepExample{
    public static void main(String args[]){

        try{
                int num=10/0;
                System.out.println("Print the A Value  "+num);
        }catch(ArithmeticException ex){
            ex.printStackTrace();
       }

        System.out.println("End of the Program! ");

    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qHzvpxTy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i19su9jjiulzxn86hved.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qHzvpxTy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i19su9jjiulzxn86hved.png" alt="try...catch" width="374" height="108"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>beginners</category>
      <category>exception</category>
      <category>programming</category>
    </item>
    <item>
      <title>Callback Function</title>
      <dc:creator>jana009</dc:creator>
      <pubDate>Fri, 29 Jul 2022 19:06:54 +0000</pubDate>
      <link>https://dev.to/jana009/callback-function-3dml</link>
      <guid>https://dev.to/jana009/callback-function-3dml</guid>
      <description>&lt;p&gt;Hi guys,&lt;/p&gt;

&lt;p&gt;Today we are going to discuss the &lt;strong&gt;Callback function&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Callback is the one of the weird concept if you people are coming from the &lt;strong&gt;C&lt;/strong&gt; programming language.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Callback&lt;/em&gt;&lt;/strong&gt; is nothing but a function which is passed as an parameter to the other function and being used  inside that(the function where it is passed as an parameter.) function&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;function greeting(name) {&lt;br&gt;
  alert('Hello ' + name);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;function processUserInput(callback) {&lt;br&gt;
  var name = prompt('Please enter your name.');&lt;br&gt;
  callback(name);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;processUserInput(greeting);&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Glossary/Callback_function"&gt;Example Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Snippet Explanation :&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;First the &lt;strong&gt;proceessUserInput&lt;/strong&gt; method executes which takes &lt;strong&gt;greeting&lt;/strong&gt; function as an parameter, Where the first line of the method asks as to type the name.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Second line where the &lt;strong&gt;greeting&lt;/strong&gt;(callback) function calls which the function inside the other function.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It takes name output from the &lt;strong&gt;processUserInput&lt;/strong&gt; and alerts the greeting message.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;OUTPUT&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Please enter your name.  John&lt;/p&gt;

&lt;p&gt;Hello John&lt;/p&gt;

&lt;p&gt;That's it 😃 &lt;/p&gt;

&lt;p&gt;Thanks! for reading&lt;/p&gt;

&lt;p&gt;Comment your feedback to boost up 💪 my writing &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Javascript</title>
      <dc:creator>jana009</dc:creator>
      <pubDate>Sat, 25 Jun 2022 19:32:13 +0000</pubDate>
      <link>https://dev.to/jana009/javascript-cgg</link>
      <guid>https://dev.to/jana009/javascript-cgg</guid>
      <description>&lt;p&gt;Hello👋&lt;/p&gt;

&lt;p&gt;It's my first blog so i am not familiar with writing the blog...So could you provide me tips and feedbacks that needs to improved in the comment section .Thanks in advance!!!&lt;/p&gt;

&lt;p&gt;Javascript is a scripting language which was used for manipulating dom but now it becomes more powerful with different frameworks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Javascript Data types:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Primitive Types&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In Primitive types the datas are stored as values in memory(Call by value) and are fixed in size&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  - Boolean
  - Null
  - Undefined
  - Number
  - String
  - Symbol
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Non-Primitive Type&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In Non-Primitive types the datas are stored in memory with its address and reference the value(Call by reference).It is not in fixed size&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  -Objects
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Boolean&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
It is either &lt;em&gt;true&lt;/em&gt; or &lt;em&gt;false&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;Example&lt;/strong&gt;: var isOdd =true;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Null&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
In javascript null is an type where it as absence of any type.(i.e no memory was created for that particular value)&lt;br&gt;
&lt;strong&gt;Example&lt;/strong&gt;: var name=null;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Undefined&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
It means the variable with out any value.&lt;br&gt;
&lt;strong&gt;Example&lt;/strong&gt;:var name;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Number&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
In javascript both integer and floating values are assigned with 'Number' type&lt;br&gt;
&lt;strong&gt;Example&lt;/strong&gt;:var value1=5;/var value2=5.2&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;String&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
It is a combination of characters&lt;br&gt;
&lt;strong&gt;Example&lt;/strong&gt;:var greeting="hello";&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Objects&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
In javascript objects are key and value pair&lt;br&gt;
&lt;strong&gt;Example&lt;/strong&gt;:var name={firstName:"john",&lt;br&gt;
lastName:"doe"&lt;br&gt;
}&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>basics</category>
      <category>datatypes</category>
    </item>
  </channel>
</rss>
