Delcaring boolean?

Ok, so I’m playing around with codeacademy. The site says to declare one, I just put true or false between the parenthesis.

public class DataTypesB {
public static void main(String[] args) {




Makes no sense. Everything I know, I need to first declare the variable somewhere before I use it in the println() between the parenthesis.

Here’s what the site says…

Introduction to Java
Data Types II: boolean

Fantastic! You just printed an int data type.

The next data type we will use is the boolean.

A boolean is a data type that can only be either true or false.


Type either true or false between the parentheses of System.out.println(); to print a boolean value.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.