- 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
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
- Related Articles
- Boolean Literals in Java
- What are Boolean Literals in C++?
- What are literals in Java?
- What are literals in C++?
- What are Literals in Python?
- What are JSP literals?
- What is the difference between character literals and string literals in Java?
- What are Character Literals in C++?
- What are string literals in C#?
- What are integer literals in C#?
- What are Perl Numerical Literals?
- What are Perl String Literals?
- What are floating point literals in C#?
- What are string literals in C language?
- Literals in Java programming

Advertisements