- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Java AND Operator Examples
The following simple example program demonstrates the logical AND operator. Copy and paste the following Java program into Test.java file and compile and run this program −
Example
public class Test { public static void main(String args[]) { boolean a = true; boolean b = false; System.out.println("a && b = " + (a && b)); } }
Output
This will produce the following result −
a && b = false
Advertisements