Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are Boolean literals in Java?
Boolean literals represent only two values true or false. And in Java the value of 1 is assumed as true and the value of 0 is assumed as false.
Example
public class Test{
public static void main(String args[]) throws Exception{
boolean bool1 = true;
boolean bool2 = false;
boolean bool = (25==(100/4));
System.out.println(bool1);
System.out.println(bool2);
System.out.println(bool);
}
}
Output
true false true
Advertisements