26 - Shortcut Arithmetic Assignments in Java

preview_player
Показать описание

In this lesson, we will learn how to perform shortcut arithmetic operations in Java. These are ways to perform addition, subtraction, multiplication, and division written in a shorter way and in many cases makes the code easier to read.
Рекомендации по теме
Комментарии
Автор

To learn the shorthand I think you need to think of it a little bit differently, Jason says he is a math guy so he can't see the shorthand not only in writing but also in thinking about this, but I feel like it's easier to think about it if you don't have a math background (I agree if you have a math background you are hardwired differently and this makes little sense unless you practice it a lot), it is slight the advantage but it is there:


X+=Y ADD Y TO X
X-=Y SUBTRACT Y TO X
X*=Y MULTIPLY Y TO X
X/=Y DIVIDE Y TO X

joeroganpodfantasy