Logical operators, JAVA Programming

Assignment Help:

Logical Operators

Operator

Functionality

Example/ Explanation

 

 

&&

Looks at 2 expressions & returns a value of "true" if the expressions on the left & right of the operator are both true

If day = 'friday' && date=13 then alert("do You believe in astrology?") Compares the value of the day and the date. If it is true that today is

a Friday and if it is also true that the date is the 13th, then an alert box pops up with the message "Are You believe in astrology?"

 

 

 

 

 

||

Looks at two expressions & returns a value of "true" if either one -- although not both -- of the expressions are true.

if day='friday'&&date=13  then alert("do you believe in astrology?") else if day='friday'||date=13  then alert("Aren't you glad it isn't Friday the 13th?") Compares the value of the day & the value of the date. If it is true that today is a Friday & if it is also true that the date

is the 13th, then an alert box pops up with

the message " do You believe in astrology?" If both are not true, the script moves onto the next line of code...  Which compares the value of the day & the value of the date? If either one -- however not both -- is true, then an alert box pops up with the message "Aren't you glad it isn't Friday the 13th?"


Related Discussions:- Logical operators

Explain about java sdk, Java SDK is not so comfortable with people used to ...

Java SDK is not so comfortable with people used to command line interpreter. IDEs contain compilers, editors, debugging facilities, drag and drop methods, etc. This compiler strive

Develop a farm production system, Develop a Farm Production System Proje...

Develop a Farm Production System Project Description: I want software that will allow me to input/record the each day production of our farm and allow me to view the data bac

Myfirstprogram in java, The purpose of this assignment is to help you learn...

The purpose of this assignment is to help you learn the Java environment and practice I/O instructions, assignment, and simple arithmetic operators. Teams: The assignment can

Student, short Java application that stores words in an Array or ArrayList....

short Java application that stores words in an Array or ArrayList.

Explain primitive data types in java, Explain primitive data types in java?...

Explain primitive data types in java? Java's primitive data types are extremely similar to those of C. They involve boolean, byte, short, long, int, float, double, and char. Th

Convert string to super ascii, A string S is said to be "Super ASCII", if i...

A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''''a''''-''''z'''') and

Explain what is multilevel inheritance, Explain what is Multilevel Inherita...

Explain what is Multilevel Inheritance ? The Car-Motorcycle-MotorVehicle instances showed single-level inheritance. There's nothing to stop you from going next. You can describ

How we use a car object in a different class, How we Use a Car object in a ...

How we Use a Car object in a different class ? class Car { String licensePlate; // e.g. "New York 543 A23" double speed; // in kilometers per hour double maxSpeed;

What is preferred organizational structure for organization, What is the pr...

What is the preferred organizational structure for the organization? The Network Organization is becoming the preferred organizational structure.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd