Delcaring boolean?


#1

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) {

	System.out.println();

}

}

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.

Instructions
1.

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


#2

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