<?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: प्रथमेश | Prathmesh 🌟</title>
    <description>The latest articles on DEV Community by प्रथमेश | Prathmesh 🌟 (@prathmeshb).</description>
    <link>https://dev.to/prathmeshb</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%2F444148%2Fa98bf025-4fa7-43fd-b03c-4be81c035f16.jpg</url>
      <title>DEV Community: प्रथमेश | Prathmesh 🌟</title>
      <link>https://dev.to/prathmeshb</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/prathmeshb"/>
    <language>en</language>
    <item>
      <title>Associativity and Precedence of Operators in Java</title>
      <dc:creator>प्रथमेश | Prathmesh 🌟</dc:creator>
      <pubDate>Tue, 26 Jul 2022 14:08:23 +0000</pubDate>
      <link>https://dev.to/prathmeshb/associativity-and-precedence-of-operators-in-java-3e4o</link>
      <guid>https://dev.to/prathmeshb/associativity-and-precedence-of-operators-in-java-3e4o</guid>
      <description>&lt;p&gt;Precedence meaning - the right that somebody/something has to come before somebody/something else because he/she/it is more important. definition comes when you google it.&lt;/p&gt;

&lt;p&gt;Precedence in Java means the operators are applied and evaluated based on precedence. for example (+,-) has less procedure compared to (*,!). hence * &amp;amp; / are calculated first.&lt;/p&gt;

&lt;p&gt;In case if you want to change this order, you can use parenthesis.&lt;/p&gt;

&lt;p&gt;In Java the original common BODMAS Rule doesn't work instead precedence and associativity works. when precedence of is same like * and / then associativity works.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;B – Brackets &lt;br&gt;
O – Order of powers or roots, &lt;br&gt;
D – Division &lt;br&gt;
M – Multiplication &lt;br&gt;
A – Addition &lt;br&gt;
S – Subtraction.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;BODMAS rule&lt;/strong&gt; state that mathematical operations need to be solved from left to right in the order of BODMAS.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Whenever you start working on solving operators problem, first check the operators who has highest precedence value and then start solving but if you encounter operators which has same precedence value than check the associativity rule then start solving.&lt;/code&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Associativity&lt;/strong&gt; tells the direction of the execution of operators. It can either be left to right or vice versa.&lt;/p&gt;

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

    + - -&amp;gt; Left to Right

    ++, = -&amp;gt; Right to Left
&lt;/code&gt;&lt;/pre&gt;

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

int a = 7*5-34/2;

         /* calculation
         =35-34/2
          =35-17
       output   =18 */


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

&lt;/div&gt;

</description>
      <category>tutorial</category>
      <category>beginners</category>
      <category>operations</category>
      <category>programming</category>
    </item>
    <item>
      <title>Increment ++ and Decrement -- Operator explained in simple way</title>
      <dc:creator>प्रथमेश | Prathmesh 🌟</dc:creator>
      <pubDate>Tue, 12 Jul 2022 09:33:36 +0000</pubDate>
      <link>https://dev.to/prathmeshb/increment-and-decrement-operator-explained-in-simple-way-10f5</link>
      <guid>https://dev.to/prathmeshb/increment-and-decrement-operator-explained-in-simple-way-10f5</guid>
      <description>&lt;p&gt;In this article, you will learn about the increment operator ++ and the decrement operator -- .&lt;/p&gt;

&lt;p&gt;In programming (Java, C, C++, JavaScript etc.), the increment operator ++ decrement operator -- are used.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Increment operator (++) or Decrement operator (--)&lt;/strong&gt; --&amp;gt; This operators increase the value of variable by 1 or decrease the variable by 1.&lt;br&gt;
For eg&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int a = 5;
a++; //output will be 6
int b = 5;
a--; //output will be 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;These operators are further divided into &lt;br&gt;
1) Prefix increment/decrement (++a/--a)&lt;br&gt;
2) Postfix increment/decrement (a++/a--)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;1) &lt;strong&gt;Prefix increment/decrement operator&lt;/strong&gt; --&amp;gt; The ++ and -- are placed before number, first evaluate the value and then performs the work.&lt;br&gt;
For eg&lt;br&gt;
&lt;/p&gt;

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

System.out.println(++a); // here the new value is evaluated that is + so value will be 6 and output will be 6

System.out.println(a);   // output will be 6 because there is no further work to perform.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;2) &lt;strong&gt;Postfix increment/decrement (a++/a--)&lt;/strong&gt; --&amp;gt; In this work is perform first, and then evaluate the value.&lt;br&gt;
for eg&lt;br&gt;
&lt;/p&gt;

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

System.out.println(a++); // Here work is perform what work?

the work is to print  the value of a that is 5, after that the value will be evaluated to 6 
i.e is a + 1 = 6; 5 + 1 = 6;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you print value of &lt;code&gt;a&lt;/code&gt; for second time then output will show 6;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int a = 5;
System.out.println(a++); //output will be 5
System.out.println(a);   // after incrementation of a the value will be 6 and it will printed as a output.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's take another example to understand in java programming language&lt;br&gt;
&lt;/p&gt;

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

        int a = 5, 
        System.out.println(a++); // 5 will be output 
        System.out.println(++a); // 7 will be output
        System.out.println(a);   // 7 as it is 
        System.out.println(--a); // 6 because of subtraction
        System.out.println(a--); // 6 will be output
        System.out.println(++a); // 6 will be output

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;1&lt;/strong&gt; In &lt;code&gt;System.out.println(a++); // 5 will be output&lt;/code&gt; here first 5 will be printed and then ++ of 5 will happen so now new value of &lt;code&gt;a&lt;/code&gt; will be 6.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2&lt;/strong&gt; In &lt;code&gt;System.out.println(++a);&lt;/code&gt; the value of &lt;code&gt;a&lt;/code&gt; will be 7 because of addition ++a it is because addition is performed, after that 7 will be output.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3&lt;/strong&gt; In &lt;code&gt;System.out.println(a);&lt;/code&gt;   // 7 as it is value from previous.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4&lt;/strong&gt; In &lt;code&gt;System.out.println(--a);&lt;/code&gt; the value will be 6 because -- of &lt;em&gt;7-1=6&lt;/em&gt; i.e. value is 6&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5&lt;/strong&gt; In &lt;code&gt;System.out.println(a--); // 6 will be output&lt;/code&gt; because first print value of &lt;code&gt;a&lt;/code&gt; and then do subtraction i.e. &lt;em&gt;6-1=5&lt;/em&gt;. When new print command for value &lt;code&gt;a&lt;/code&gt; will be printed then 5 will be displayed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6&lt;/strong&gt; In &lt;code&gt;System.out.println(++a); // 6 will be output&lt;/code&gt; because ++a i.e. first do addition of _5+1=6 _and print value of a which is 6.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>tutorial</category>
      <category>programming</category>
      <category>java</category>
    </item>
    <item>
      <title>Programming explained in simple terms</title>
      <dc:creator>प्रथमेश | Prathmesh 🌟</dc:creator>
      <pubDate>Sat, 30 Apr 2022 11:45:09 +0000</pubDate>
      <link>https://dev.to/prathmeshb/programming-explained-in-simple-terms-30b9</link>
      <guid>https://dev.to/prathmeshb/programming-explained-in-simple-terms-30b9</guid>
      <description>&lt;p&gt;&lt;strong&gt;Programming -&lt;/strong&gt; &lt;em&gt;It is a set of step by step instructions given to the computer to perform a certain task we want it to do.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The computer can perform many complex tasks like complex calculations, software for booking a ticket for a flight, ordering online food from nearby restaurants etc.&lt;/p&gt;

&lt;p&gt;Let's create our first program in code IDE&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print("Hello, World");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output will be &lt;code&gt;Hello World&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;Let's understand code little by little. &lt;code&gt;print("Hello, World");&lt;br&gt;
&lt;/code&gt; this is called a &lt;em&gt;&lt;strong&gt;Statement&lt;/strong&gt;&lt;/em&gt;. Every program is made up of statements, and each statement has a goal to do something which is told by a human to perform.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Function -&lt;/strong&gt;&lt;/em&gt; This &lt;code&gt;print()&lt;/code&gt; is called function. These are already created terms in programming language and its work is to &lt;em&gt;print something on console as an output&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;String -&lt;/strong&gt;&lt;/em&gt; This &lt;code&gt;" "&lt;/code&gt; is called a string. In the string whatever text you write will be printed as it is. for example, if you have written the number &lt;code&gt;"9"&lt;/code&gt; then the number 9 will be printed in the console as it is. So string function is to print whatever input given by the user as it is.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Parentheses -&lt;/strong&gt;&lt;/em&gt; This &lt;code&gt;()&lt;/code&gt; symbol is called parentheses. In () we write instructions to perform with the help of functions like &lt;code&gt;print&lt;/code&gt;. It is necessary to write instructions between () to perform the task, if not written then the code will not work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;; -&lt;/strong&gt; This is used to end the statement of code. In many programs &lt;code&gt;;&lt;/code&gt; is used.&lt;/p&gt;

&lt;p&gt;There are many other ways to write print() function in different programming languages like &lt;code&gt;printf() in C&lt;/code&gt;, &lt;code&gt;document.write() in JavaScript&lt;/code&gt; etc.&lt;/p&gt;

&lt;p&gt;Show some virtual love by clicking ❤. 😊 If you want to add something or want to suggest something, you can write in the comment section.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
      <category>codenewbie</category>
    </item>
  </channel>
</rss>
