#9 Arithmetic Operators in Java

Поделиться
HTML-код
  • Опубликовано: 7 ноя 2024

Комментарии • 55

  • @Gattugamerfacts912
    @Gattugamerfacts912 Год назад +17

    Really sir you are great I complete 1 to 10 lecture in one day without any doubt thank you so much sir 🥺🙏

  • @beqari
    @beqari Год назад +104

    dude has 1.25x speed by default

  • @nirongajanayake2515
    @nirongajanayake2515 Год назад +5

    Sir, I am really grateful for your teachings ❤️❤️

  • @sandunjayasekara131
    @sandunjayasekara131 Год назад +3

    Best series for learning java, Thank you sir

  • @kirubasathish3683
    @kirubasathish3683 Год назад +8

    sir so num1 = num1 + 2; and num1 += 2; is the same thing?

  • @yitingchen8278
    @yitingchen8278 Год назад +11

    note: when trying to assign a value or fetch a value, post-increment will behavior differently from pre-increment.

  • @KshitijJaiswalBCS
    @KshitijJaiswalBCS Месяц назад

    Why doesn't type promotion does work in case of int and long? for ex - int x = 2^31-1; int y = 2^31-1; long z = x+y; System.out.println(z); gives -2 and not 2^32-2. (please note '2^x' notations are just for understanding and not actually used in the code)

  • @BLAZIN77KONG
    @BLAZIN77KONG Год назад +2

    best tutorial ever

  • @ISHADUA-l6r
    @ISHADUA-l6r 9 месяцев назад +2

    Why video name is Assignment Operator in Java? it should be Arithmatic Operators in Java

  • @durgaraoponnuru17
    @durgaraoponnuru17 Год назад +2

    When we do num1++ or some other operations, values are being changed in output. Again when we perform another operation, its being performed on default number, instead of updated value. Can anyone explain this.
    For eg: num1=7;
    when num1++ is performed, value changed to 8,
    Again when another operation say num1 +=1; is performed value still showing 8 instead of 9.

    • @MrPradeepchandu
      @MrPradeepchandu Год назад

      Because you are giving num1=7 at start of code everytime you run

    • @SanjanaGupta279
      @SanjanaGupta279 11 месяцев назад +1

      See There is two option first is to use looping statement(For loop, while loop) For Example:
      class HelloWorld {
      public static void main (String[] args) {
      int num1=1;
      while(num1

  • @sm07
    @sm07 Год назад +3

    What is the difference Between
    public static void main(String a[])

    • @quickkcare605
      @quickkcare605 Год назад +2

      Just a name difference, just like you can give variable any name

    • @whytimes863
      @whytimes863 Год назад +2

      No difference, bro. You can put any name there a[], args[], sampath[], anything.

    • @sm07
      @sm07 Год назад

      Thanks guys

    • @priyanshsrivastava3443
      @priyanshsrivastava3443 2 месяца назад +1

      no difference both are name suppose u use args than u can use a in any other operation which will make it easy to understand

  • @nishalsreekanta7802
    @nishalsreekanta7802 10 месяцев назад

    4:18 the output must have been 7 right? Because num1 is assigned with 9 after increment? 9 - 2 = 7. But how was the output 5 and even in multiplication it took 7 * 8 and not 5 * 8. Can someone explain this ?

    • @barathkraja5681
      @barathkraja5681 9 месяцев назад

      It was commented out with double slash after it was made to 9. So now num 1 will be with its original value and will remain as 7. Now when
      num1 -= 2 is coded, it will result in output as 5. The same goes with multiplication since now original value of num1 remains 7 and when the line num1 *=8 it's num 1= num1(which is 7) *8 = 56

  • @yashjangid4222
    @yashjangid4222 4 месяца назад +1

    sir please dont say star say Asterisk so the students can get a new work thank you sir

  • @challacharan1648
    @challacharan1648 Год назад

    very much help ful

  • @tharinduhasarangarubasinsi7714
    @tharinduhasarangarubasinsi7714 Год назад +1

    Sir you did really great :)

  • @emhoang252
    @emhoang252 10 месяцев назад

    thank you

  • @alfredndlovu356
    @alfredndlovu356 6 месяцев назад +1

    Was the title of this video not meant to be "Arithmetic Operators in Java" ?

  • @Manisha_1490
    @Manisha_1490 Год назад

    Tq sir😊😊

  • @abhijaiallgamesgamer2075
    @abhijaiallgamesgamer2075 Год назад

    i just realized u were using macOS

  • @vkyfox
    @vkyfox Год назад

    yovvvvv this is arithmetic operator yarrrrr

  • @mister_utaam667
    @mister_utaam667 18 дней назад

    How to find percentage sirr😅😅

  • @mango-strawberry
    @mango-strawberry Год назад +2

    9:56

  • @vivekvardhan6491
    @vivekvardhan6491 Год назад +1

    when you increment the value it should print 8 but why it is printing 7.

    • @hari3245
      @hari3245 Год назад

      Bcz we insert is this to system. Out. Println() ;
      // we insert than number it is perform value & condition & Inc/dec
      Ex:
      For(int vivek =1;vivek

    • @vivekvardhan6491
      @vivekvardhan6491 Год назад

      @@hari3245 So 1st the given value is going to print and then it will perform other condition right.

    • @hari3245
      @hari3245 Год назад

      @@vivekvardhan6491 yeah..

  • @Naveen_kumar14
    @Naveen_kumar14 Год назад

    Why he used double // slash can anyone explain me

    • @shazam8095
      @shazam8095 4 месяца назад

      it is used to make that line a comment which will be ignored by java while running

  • @Ilamaran-n9f
    @Ilamaran-n9f 3 месяца назад

    // for what purpose he was using this !!!

    • @Ilamaran-n9f
      @Ilamaran-n9f 3 месяца назад

      in the literal series also he didn't explain about it😔

    • @kundhanrockzstudio916
      @kundhanrockzstudio916 2 месяца назад

      Coz to ignore the title he used before , just the way rest all ignore ur comment dumbo

    • @IAmSharadhNaidu
      @IAmSharadhNaidu 2 месяца назад +1

      ​@@Ilamaran-n9fit's called a command which is used to ignore that line which basically means the compiler ignores that line from compiling we can use it by ctrl+l in vscode

    • @Ilamaran-n9f
      @Ilamaran-n9f 2 месяца назад +1

      @@IAmSharadhNaidu thx bro

  • @nandakishore8447
    @nandakishore8447 Год назад

    public class confus
    {
    public static void main (String args[])
    {
    int num = 7;
    int a = ++num;
    int b = num++;
    System.out.println(a);
    System.out.println(b);
    }

    }
    this program getting output as 8
    8
    instead 8
    7
    any explanation please

    • @ckubri5061
      @ckubri5061 Год назад

      bro im not sure wt u r asking but, the post n pre increment does the same job but differently...like said in the video.
      ++num n num++ will give the same output for 7.
      As we know if we give our intial value e.g num=9, we get 10 either if we give ++num or num++
      but ur class name😹

    • @barathkraja5681
      @barathkraja5681 9 месяцев назад

      So the reason why b is giving result as 8 is when a= ++num is executed value of num changes to 8 and so b fetches the last updated value of num which is 8 and prints it and then increments it to 9. Now when a=++num is executed a will be printed as 10 and b as 10 and then a as 11 and b as 11 and so on. Basically value of num changes even though you assign that to a separate variable like a or b.

  • @amitavaghosh7201
    @amitavaghosh7201 Год назад

    Too much videos uploaded at the same time