Expressions in Java || Lesson 13 || Java Programming || Learning Monkey ||

Publié le: 20 avril 2023
sur la chaîne: Learning Monkey
1,401
23

Expressions in Java
In this class, We discuss Expressions in Java.
The reader should have prior knowledge of operators. Click Here.
We take an example and understand expressions.
Example:
int a=9, b=5, c=2, d;
d= a- b- c;
d = a + b * c;
d = a/ b/ c;
The first expression is d = 9-5-2.
Evaluate 9 – 5 -2.
We can evaluate the expression in two ways.
5 – 2 evaluated first, and we get 3.
Then evaluate 9 – 3 will output 6.
The second way, 9-5, is evaluated first. We get 4.
4 – 2 evaluated; next, we get 2.
Different evaluations provide different outputs.
Similarly, the remaining expressions give different outputs.
To evaluate the expressions, we need some set of rules or conditions.
The rules for evaluating expressions are provided by using precedence and associativity.
We will discuss precedence and associativity in our next class.

Link for playlists:
   / @learningmonkey  


Link for our website: https://learningmonkey.in

Follow us on Facebook @   / learningmonkey  

Follow us on Instagram @   / learningmonkey1  

Follow us on Twitter @   / _learningmonkey  

Mail us @ [email protected]


Sur cette page du site, vous pouvez voir la vidéo en ligne Expressions in Java || Lesson 13 || Java Programming || Learning Monkey || durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Learning Monkey 20 avril 2023, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 1,401 fois et il a aimé 23 téléspectateurs. Bon visionnage!