Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ Java Foundation - Variables and data types     - Eclipse remove all comments and code spaces (Linux)

- Single list summarizes the basic operation (Programming)

- Improve the efficiency of Linux development tools 5 (Linux)

- Fedora 20 installation source Xen4.3.0 (Linux)

- How ONLYOFFICE collaborative editing document on Linux (Linux)

- MBR partitions under Linux (Linux)

- How Linux system password security guarantee (Linux)

- RedHat 6.5 installation and deployment Openfire (Server)

- Android memory optimization of the memory cache (Linux)

- Ten to improve the efficiency of the Linux bash tricks (Linux)

- Raspberry Pi 2 to install the latest version of the FPC and Lazarus 1.5 (Linux)

- linux raid levels and concepts introduced (Linux)

- HttpClient4 usage upgrade from HttpClient3 (Programming)

- Red Hat Enterprise Linux configuration VNC multi-user access methods (Linux)

- Tsung first test installation (Linux)

- Use Vagrant build cross-platform development environment for Python (Server)

- Use a soft Raid play multiple SSD hard drive performance and enhance data security (Linux)

- MySQL to NoSQL avatar (Database)

- CentOS card fails to start at boot progress bar certmonger solve (Linux)

- SpringMVC garbage processing (Programming)

 
         
  Java Foundation - Variables and data types
     
  Add Date : 2017-08-31      
         
         
         
  Each language will be designed to a lot of data, so you will come into contact with different data types, the initial contact data type is also faint, in the Java language, finally a little understand, comb,

The concept of a variable
A memory area in memory
Variable name + data type
Can vary within the same type of range
Why Define Variables:
Used to keep the same type of constant constant, and can be reused
Using variables Note:
The scope of the variable, a pair of {} between the effective
Initialize the value
Define the format of the variable:
Data type Variable name = Initialize value
Example: int x = 4
Note: The format is fixed
Understanding: Variables are like unknowns in mathematics.
type of data:

Integer The default type is int
The decimal default type is: double
Occupied memory and range of values
Integer
Occupied storage space (bytes)
Size range
Byte
1
-128-127
Short
2
-215 to 215-1
Int
4
-231 to 231-1
Long
8
-263 to 263-1
Floating point type
 
 
Float
4
-3.403E38 to 3.403E38
Double
8
-1.798E308 ~ 1.798E308
Character type
 
 
Char
2 (Unicode encoding)
 
Boolean type
 
 
Boolean
1 (actually 1 / 8byte)
 
Resolution: Why byte occupies a byte, the range is -128 ~ 127
First need to know that in binary, the most significant bit is the sign bit, 0 for positive, 1 for negative, other bits are data bits.
Byte total of 8 bits, said 256 (28).
The maximum value is 01111111, and the decimal value is 127
The minimum value is 10000000, 1 is the sign bit, representing a negative number, converted to decimal 128. So the minimum value is -128
Specifically why is -128? How are binary and decimal conversions at the bottom? Will be related to the original code, code, complement, and listen to the next chapter analysis.
 
summary:
In the final analysis, the most important software system is data, data is the core of the enterprise. Although some of the underlying things we do not need to master, but only to find out these later used to be handy, ripe!
     
         
         
         
  More:      
 
- Linux NFS FTP use (Server)
- Red Flag Linux Desktop 6.0 hard disk installation guide (Programming)
- Process monitoring tools Supervisor start MongoDB (Database)
- SUSE Linux install Oracle 10g and problem solving (Linux)
- Spring loaded container finishes executing a method (Programming)
- PL / SQL data types (Database)
- The easiest 11g Active DataGuard (ADG) to establish the configuration process (Database)
- map and hash_map STL containers (Programming)
- Differential test piece using MongoDB performance YCSB (Database)
- Upgrading to Debian 7.6 glibc 2.15 (Linux)
- Linux System Getting Started Learning: Linux how to install 7zip (Linux)
- Vim configuration instructions (Linux)
- The Hill sorting algorithm (Programming)
- Linux System Getting Started Learning: After starting in Ubuntu or Debian, enter the command line (Linux)
- Simple to install Tor browser to Ubuntu 14.04 and Linux Mint 17 (Linux)
- Timing Nginx logs cut and remove the log records of the specified number of days before (Server)
- Java8 Lambda expressions and flow operations (Programming)
- Let VMware ESXi virtual switch support VLAN (Linux)
- SQL Server 2008 database synchronization Notes (Database)
- Make Windows boot disk to install USB in Ubuntu Linux (Linux)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.