Relational or Comparison Operators - Java programming tutorial for beginners
Relational or Comparison Operators & logical expressions - Java programming tutorial for beginners
In this video we are going to talk about Relational Operators
By definition, a relational operator is an operator that allows you to make comparisons in a program
Relational operators are used in logical expressions
And a logical or boolean expression is any expression that evaluates to either true or false
Let’s take an example to explain further
Suppose we have two integer variables
int a = 10;
int b = 28;
And we want to compare these two variables
To do that we will use a logical expression and that expression will contain a relational operator
Since a logical expression evaluates to a boolean value
Let us declare a boolean variable first
Now, let‘s write the logical expressions in which we will compare the two variables
c = (a==b);
c = (a!=b);
etc.
So here are the logical expressions
And, as you can notice in Java there exist 6 relational operators that allows you to make comparisons
the equal to operator
the not equal to operator
the less than or equal to operator
the less than operator
the greater than or equal to operator
the greater than operator
As I said, each of these expressions will compare the values in variables a and b before returning a boolean value that is either true or false
What we can note here is that each relational operators is a binary operator, that means that it requires two operands
Relational operators can be used with all primitive Data types which are short, long, double, float, integer and char as well
For char values, whether an expression evaluates to true or false depends on the Unicode value as a decimal integer of the characters in the character set
For example we can write
char d = ‘A’;
char e = ‘B’;
Then
c = (d == e);
So guys, that’s it concerning Relational Operators
In the next video, we will talk about Logical Operators
Thanks for viewing, I hope this video was informative and please do not forget to like and SUBSCRIBE to this channel for more. Thanks !!!!!
#codingriver
#java
#programming
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Relational or Comparison Operators - Java programming tutorial for beginners», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.