answersLogoWhite

0

An integer stores a whole number. The exact range depends on the language; in Java, "int" stores whole numbers in a range of approximately minus 2 billion to plus to billion.

A boolean variable, on the other hand, stores only one of two values - these are often called "true" and "false" (as in Java). Boolean variables are often used to keep track of information that can be thought of as a reply to a "yes/no" question. For example, to mark whether a certain item is active or not you have only two choices, so it makes sense to use a boolean variable.

User Avatar

Wiki User

11y ago

What else can I help you with?

Related Questions

What is difference between an integer variable and floting point variable?

The set of the possible values.


How does the absolute beginner to Browser-side scripting supposed to know what boolean or string means?

Boolean means yes or no, true or false, 0 or 1. There can only be 2 alternatives in boolean. In JavaScript there is a function typeof which will show whether variable is boolean, string, integer or any other. I am providing a few examples. Try those and you will understand what type of variable is providedvar a = 12;alert("Variable is of type: "+typeof(a));var a = "hello";alert("Variable is of type: "+typeof(a));


Can you do a boolean test on integer in java?

No


What is the difference between Declaration and Assignment?

Declaration is basically defining data type and length and assignment is to assign the value. Below is the declaration -- var a integer /* this means we are declaring a variable a as integer data type */ a= 5 /* this is assignment,we are assigning 5 to variable a */


What is the difference between controlled variable?

Variables define a certain value, such as an integer, string, boolean value, etc. Functions are defined to run a certain task, and may or may not return a value. You can have a function that calculates the sum of two numbers and returns the sum once calculated.


What is difference between number and integer?

an integer is a whole number


Is the difference between a negative integer and a positive integer always a negative integer?

sometimes


Can you compare a boolean to an integer?

no, you cant. it only works on string


What are the 3 parts of variables?

The three parts of variables are the name, value, and type. The name is the identifier used to reference the variable, the value is the data stored in the variable, and the type indicates the kind of data the variable can hold, such as integer, float, string, or boolean. Together, these components define how a variable can be used within a program.


What is the difference between instantiation and initialization in C plus plus?

Instantiation is creating the instance of the variable/object . While Initialization is to provide the variable with some value. int i; // i is an instance of an integer i=10; //initialised with the value 10


Is the difference of a positive integer and a negative integer always positive?

The difference between any numbers is always positive.


What is the prefix for variable?

In programming, the term "prefix" typically refers to a naming convention that precedes the name of a variable. Common prefixes include "int" for integer variables, "str" for string variables, "bool" for boolean variables, and so on. These prefixes help developers quickly identify the data type of a variable.