<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://script.spoken-tutorial.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=Java%2FC2%2FLogical-Operations%2FEnglish</id>
		<title>Java/C2/Logical-Operations/English - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=Java%2FC2%2FLogical-Operations%2FEnglish"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Java/C2/Logical-Operations/English&amp;action=history"/>
		<updated>2026-04-09T01:51:57Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.17</generator>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=Java/C2/Logical-Operations/English&amp;diff=4175&amp;oldid=prev</id>
		<title>Sneha at 07:50, 8 May 2013</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Java/C2/Logical-Operations/English&amp;diff=4175&amp;oldid=prev"/>
				<updated>2013-05-08T07:50:00Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://script.spoken-tutorial.org/index.php?title=Java/C2/Logical-Operations/English&amp;amp;diff=4175&amp;amp;oldid=118&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Sneha</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=Java/C2/Logical-Operations/English&amp;diff=118&amp;oldid=prev</id>
		<title>Chandrika: Created page with ''''Title of script''': Logical Operators in Java  '''Author''': TalentSprint  '''Keywords: '''boolean, comparison, logical operator, video tutorial    {| style=&quot;border-spacing:0;…'</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=Java/C2/Logical-Operations/English&amp;diff=118&amp;oldid=prev"/>
				<updated>2012-11-27T10:22:23Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;&amp;#039;&amp;#039;&amp;#039;Title of script&amp;#039;&amp;#039;&amp;#039;: Logical Operators in Java  &amp;#039;&amp;#039;&amp;#039;Author&amp;#039;&amp;#039;&amp;#039;: TalentSprint  &amp;#039;&amp;#039;&amp;#039;Keywords: &amp;#039;&amp;#039;&amp;#039;boolean, comparison, logical operator, video tutorial    {| style=&amp;quot;border-spacing:0;…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''Title of script''': Logical Operators in Java&lt;br /&gt;
&lt;br /&gt;
'''Author''': TalentSprint&lt;br /&gt;
&lt;br /&gt;
'''Keywords: '''boolean, comparison, logical operator, video tutorial&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| '''Visual Cue '''&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| '''Description'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Slide 1&lt;br /&gt;
&lt;br /&gt;
'''Welcome'''&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Welcome to the spoken tutorial on '''Logical Operators''' in Java.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Slide 2&lt;br /&gt;
&lt;br /&gt;
'''Learning Outcomes'''&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| In this tutorial, you will learn about the''' logical operators in java''' and&lt;br /&gt;
&lt;br /&gt;
'''how to check for multiple expressions using logical operators''' and '''how to overwrite precedence using parentheses'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Slide 3&lt;br /&gt;
&lt;br /&gt;
'''Tools Used'''&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| For this tutorial we are using &lt;br /&gt;
&lt;br /&gt;
'''Ubuntu 11.10''', &lt;br /&gt;
&lt;br /&gt;
'''JDK 1.6''' and &lt;br /&gt;
&lt;br /&gt;
'''Eclipse 3.7'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Slide 4&lt;br /&gt;
&lt;br /&gt;
'''Prerequisites'''&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| For this tutorial, you should have knowledge on '''relational operators in Java'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If not, for relevant tutorials, please visit our website as shown.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Slide 5&lt;br /&gt;
&lt;br /&gt;
'''Logical Operators'''&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Logical operators are used to check '''multiple conditions'''. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a list of the available logical operators in Java&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| and, or, not. We shall look into each of them in detail.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Switch to Eclipse.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Minimize Slides and open Eclipse&lt;br /&gt;
&lt;br /&gt;
Eclipse should contain the following code&lt;br /&gt;
&lt;br /&gt;
'''public class LogicalOperators{'''&lt;br /&gt;
&lt;br /&gt;
'''public static void main(String&amp;lt;nowiki&amp;gt;[] &amp;lt;/nowiki&amp;gt;args){'''&lt;br /&gt;
&lt;br /&gt;
'''}'''&lt;br /&gt;
&lt;br /&gt;
'''}'''&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| We have the Eclipse IDE and skeleton required for the rest of the code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We have created a class '''LogicalOperators''' and added the main method to it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let us create some variables.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| In the main function, type&lt;br /&gt;
&lt;br /&gt;
'''int age = 11;'''&lt;br /&gt;
&lt;br /&gt;
'''int weight = 42;'''&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| '''boolean b&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We shall store the result of conditions in b&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Type '''''int age''' is equalto '''11 '''semi-colon.''&lt;br /&gt;
&lt;br /&gt;
'''''int weight '''isequalto '''42 '''semi-colon.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| Highlight &lt;br /&gt;
&lt;br /&gt;
'''int age = 11;'''&lt;br /&gt;
&lt;br /&gt;
'''int weight = 42;'''&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| We have the age and weight of a person. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We shall check if the person '''is below 18yrs of age and is atleast 40kgs'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let us see how to do so.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Type after the previous line,&lt;br /&gt;
&lt;br /&gt;
'''boolean b&amp;lt;nowiki&amp;gt;;&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''b = age&amp;lt;nowiki&amp;gt; &amp;lt; 18 &amp;amp;&amp;amp; &amp;lt;/nowiki&amp;gt;weight &amp;gt;= 40'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Highlight &amp;amp;&amp;amp;'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Highlight expression'''&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Type,&lt;br /&gt;
&lt;br /&gt;
'''age''' ''less than '''''18''' ''ampersand ampersand'' '''weight''' ''greater than equal to'' '''40'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This statement has two expressions and a double ampersand symbol in between. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This condition checks if age is less than 18 and also if weight is greater than or equal to 40.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This operation is called the '''and''' operation.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Put the line '''age...''' inside the statement&lt;br /&gt;
&lt;br /&gt;
'''System.out.println();'''&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Let us now print the value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''System '''dot '''out '''dot '''println(''b'');'''''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| '''Save''' and '''Run'''.&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| '''Save '''and '''Run '''the program.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| Point to output&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Change '''42''' to '''32.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Save''' and '''Run'''.&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| As we can see, the output is '''true''' because both the conditions are satisfied.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now let us change the weight so that one condition is not satisfied and re run the code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Change '''42''' to '''32.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Save''' and '''Run''' the program.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| Point to output&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| As we can see, the output is now false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is because the condition age is less than 18 is true.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
But the condition the weight is not greater than or equal to 40 is false.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''and''' operation requires both the conditions to be '''true''' for the result to be true.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Therefore we get false as our output.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| This way, we use a double ampersand to do an '''and''' operation.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Lets say we have age and weight and it is enough if one of the conditions is satisfied.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In other words, we need to see if the first condition '''or''' the second condition is '''true.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is done using the '''or''' operation.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Comment out the old condition and type&lt;br /&gt;
&lt;br /&gt;
'''b = age&amp;lt;nowiki&amp;gt; &amp;lt;= 15 || &amp;lt;/nowiki&amp;gt;weight&amp;lt;nowiki&amp;gt; &amp;lt;= 30&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Let us first remove the earlier condition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Type&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''age''' ''less than equal to'' '''15''' ''pipe pipe'' '''weight''' ''less than equal to '''''30'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are two conditions and a double pipe symbol in between.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This statement checks if atleast one of the given two conditions is satisfied.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let us run the code to see the output.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| Save and Run&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| We see that the output is True.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| This is because, an '''or''' operation, does not need both the conditions to be true like the operation.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| It needs atleast one condition to be true.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| So although the condition for weight is not satisfied, the condition for age is satisfied.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| And we get a true.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Now let us change the age such a way that both the conditions are false and see the result.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| '''Save''' and '''Run'''.&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| '''Save''' and '''Run '''the program.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Change '''11''' to '''17'''&lt;br /&gt;
&lt;br /&gt;
'''Save''' and '''Run'''. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Point to output&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Now change '''11''' to '''17'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Save''' and '''Run '''the program.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now the output is false since both the conditions are not satisfied.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| This way, we use a double PIPE symbol to do an '''and''' operation.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| Now let us say we need to check for people who are older than 15 and with weight more than 30kilos.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In other words, we need to check the exact opposite of the condition we just did.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| In such situations, we use the '''not''' operation&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Add parentheses around the&lt;br /&gt;
&lt;br /&gt;
'''age...''' line&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| First enclose the condition in parentheses.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| Add '''!''' before the parentheses.&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| Add an exclamation mark before the condition.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| By using an exclamation mark, we check for the exact opposite of the condition inside the parentheses.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| This operation is called the '''not''' operation&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Since the earlier output was '''false''', now it must be the opposite, '''true'''. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| '''Save''' and '''Run'''. Point to output&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| '''Save''' and '''Run'''. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As we can see, the output is the opposite of earlier one.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Back to code.&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Let us say we want people '''younger than 15.'''&lt;br /&gt;
&lt;br /&gt;
Or people '''younger than 18''' and '''lighter than 40kilos'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let us see how would we go about this condition.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Remove the '''System...''' line and type&lt;br /&gt;
&lt;br /&gt;
'''age&amp;lt;nowiki&amp;gt; &amp;lt; 15 || &amp;lt;/nowiki&amp;gt;age&amp;lt;nowiki&amp;gt; &amp;lt; 18 &amp;amp;&amp;amp; &amp;lt;/nowiki&amp;gt;weight&amp;lt;nowiki&amp;gt; &amp;lt; 40&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Highlight the condition.'''&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Type,&lt;br /&gt;
&lt;br /&gt;
'''age '''''less than '''''15 '''&lt;br /&gt;
&lt;br /&gt;
''or''''' age '''''less than '''''18 '''&lt;br /&gt;
&lt;br /&gt;
''and''''' weight '''''less than '''''40'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As we can see, the condition itself is confusing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Moreover, we do not know if the '''or''' operation will be performed first or the '''and''' operation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It depends on the precedence of operators.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In such situations, we use parentheses to overwrite the precedence and also make the condition clear.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Change '''age&amp;lt;nowiki&amp;gt; &amp;lt;= 18 &amp;amp;&amp;amp; &amp;lt;/nowiki&amp;gt;weight&amp;lt;nowiki&amp;gt; &amp;lt;= 40&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
to '''(age&amp;lt;nowiki&amp;gt; &amp;lt;= 18 &amp;amp;&amp;amp; &amp;lt;/nowiki&amp;gt;weight&amp;lt;nowiki&amp;gt; &amp;lt;= 40)&amp;lt;/nowiki&amp;gt;'''&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| So let us add the parentheses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now the condition is clear.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We also make sure that the '''and''' operation is performed first and then the '''or''' operation.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| Let us run the code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Save. Run.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| Although the first condition age less than 15 is not satisfied,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
the second condition, which is,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
age less than 18 and weight less than 40 is satisfied.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Therefore, output is True.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| As a rule, use parentheses to avoid ambiguity and make the expressions clear.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.176cm;&amp;quot;| This how we use the logical operators to check for multiple conditions.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Minimize the '''Eclipse''' window and switch to slides.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Slide 6&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| We have come to the end of this tutorial. &lt;br /&gt;
&lt;br /&gt;
In this tutorial we have learnt '''about logical operators''', how to '''check for multiple expressions''' using '''logical operators '''and &lt;br /&gt;
&lt;br /&gt;
'''how to override the precedence using parentheses.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Slide 7'''Assignment'''&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| As an assignment for this tutorial, &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
find out if the two expressions, shown are equivalent?&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Slide 8'''About the Spoken Tutorial Project'''&lt;br /&gt;
&lt;br /&gt;
* Watch the video available at[http://spoken-tutorial.org/What_is_a_Spoken_Tutorial  ][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial http][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial ://][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial spoken][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial -][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial tutorial][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial .][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial org][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial /][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial What][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial _][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial is][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial _][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial a][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial _][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial Spoken][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial _][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial Tutorial]&lt;br /&gt;
&lt;br /&gt;
* It summarises the Spoken Tutorial project&lt;br /&gt;
&lt;br /&gt;
* If you do not have good bandwidth, you can download and watch it&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| To know more about the '''Spoken Tutorial''' project, watch the video available at the following link, that summarises the project.&lt;br /&gt;
&lt;br /&gt;
if you do not have good bandwidth, you can download and watch it&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Slide 9'''Spoken Tutorial Workshops'''The Spoken Tutorial Project Team&lt;br /&gt;
&lt;br /&gt;
* Conducts workshops using spoken tutorials&lt;br /&gt;
&lt;br /&gt;
* Gives certificates for those who pass an online test&lt;br /&gt;
&lt;br /&gt;
* For more details, please write to [mailto:contact@spoken-tutorial.org contact][mailto:contact@spoken-tutorial.org @][mailto:contact@spoken-tutorial.org spoken][mailto:contact@spoken-tutorial.org -][mailto:contact@spoken-tutorial.org tutorial][mailto:contact@spoken-tutorial.org .][mailto:contact@spoken-tutorial.org org]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| The Spoken Tutorial Project Team. Conducts workshops using '''spoken tutorials''' and gives certificates for those who pass an online test. For more details, please write to '''contact AT spoken HYPHEN tutorial DOT org.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Slide 10'''Acknowledgement'''&lt;br /&gt;
&lt;br /&gt;
* Spoken Tutorial Project is a part of the Talk to a Teacher project&lt;br /&gt;
&lt;br /&gt;
* It is supported by the National Mission on Education through ICT, MHRD, Government of India&lt;br /&gt;
&lt;br /&gt;
* More information on this Mission is available at&lt;br /&gt;
&lt;br /&gt;
* [http://spoken-tutorial.org/NMEICT-Intro http][http://spoken-tutorial.org/NMEICT-Intro ://][http://spoken-tutorial.org/NMEICT-Intro spoken][http://spoken-tutorial.org/NMEICT-Intro -][http://spoken-tutorial.org/NMEICT-Intro tutorial][http://spoken-tutorial.org/NMEICT-Intro .][http://spoken-tutorial.org/NMEICT-Intro org][http://spoken-tutorial.org/NMEICT-Intro /][http://spoken-tutorial.org/NMEICT-Intro NMEICT][http://spoken-tutorial.org/NMEICT-Intro -][http://spoken-tutorial.org/NMEICT-Intro Intro]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| '''Spoken Tutorial '''Project is a part of the '''Talk to a Teacher''' project and is supported by the '''National Mission on Education through ICT, MHRD, Government of India. '''More information on this Mission is available at '''spoken HYPHEN tutorial DOT org SLASH NMEICT HYPHEN Intro'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| Slide 11'''About the contributor'''&lt;br /&gt;
&lt;br /&gt;
* This tutorial has been contributed by '''TalentSprint'''&lt;br /&gt;
* '''www.talentsprint.com'''&lt;br /&gt;
&lt;br /&gt;
* Thanks for joining&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;border:0.035cm solid #000000;padding:0.097cm;&amp;quot;| This tutorial has been contributed by '''TalentSprint'''. Thanks for joining.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Chandrika</name></author>	</entry>

	</feed>