In Java, the true value of a Boolean value is 1 and the false value is 0. So the basis of transformation is to judge whether Boolean value is true or not. If true, the result of 1 is returned, otherwise, 0 is returned. Please refer to writeBoolean(boolean f) in DataOutputStream class and readBoolean () in DataInput for details.
Extended data:
Boolean data type Boolean variables are stored as 8-bit (1 byte) values, but they can only be true or false.
The Method of Creating Boolean Objects in javascript
Use the keyword new to define Boolean objects. The following code defines a logical object named myBoolean:
var myBoolean = new Boolean()
var myBoolean = new Boolean()
Note: If the logical object has no initial value or its value is 0, -0, null, "",false, undefined or NaN, the value of the object is false. Otherwise, its value is true (even when the independent variable is the string "false")!
Int is a data type. Use programming languages (C, C++, C#, Java, etc. ), which is an identifier used to define an integer variable.
Application mode
1, definition method:
int? Me; //define the plastic variable iint? I = 1; //Define the integer variable I, and initialize it to 1.
2. Define constants:
const? int? Me; //Compilation error, because you need to give the constant an initial value const? int? I = 1; //Define the constant i with the value of 1.
3.Java defined constants:
Final? int? I = 1; //Define the constant i with the value of 1.
Baidu Encyclopedia-Boolean (Computer Terminology)
Baidu Encyclopedia -INT (data type)