Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ Java Foundation - Variables and data types     - Linux Getting Started tutorial: Experience Xen Virtual Machine chapter (Linux)

- Text editing and viewing text Linux command (Linux)

- UNIX and class UNIX system security check notes (Linux)

- I like Linux Security (Linux)

- Ubuntu users Steam controller does not work solutions (Linux)

- Install Java 8 on Ubuntu using PPA (Linux)

- Upgrading KDE Plasma 5.3 in Ubuntu 15.04 (Linux)

- Compile and install Memcached can not find GCC (Programming)

- Use the vi text editor and copy and paste Linux tips (Linux)

- Install the Solaris 10 operating system environment over the network to sparc (Linux)

- Linux alpine use the command line to access Gmail (Linux)

- Household use Linux Security (Linux)

- Java 8 Lambda principle analysis (Programming)

- Three binary tree traversal (recursive, non-recursive traversal and Morris) (Programming)

- Android main thread message system (Handler Looper) (Linux)

- Partition and file system under Linux (Linux)

- Use Git in Eclipse (Linux)

- Linux deploy Tutorial (Linux)

- Python in os.path Magical (Programming)

- Install Firefox 28 on Ubuntu, Linux Mint (Linux)

 
         
  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:      
 
- Function Getting the Linux shell (Programming)
- To install the mail client terminal Evolution 3.13.2 under Ubuntu 14.04 (Linux)
- Visual Studio Code experience (Linux)
- Shell Script: Bulk add users, and set the random character password (Programming)
- Linux ACL permissions (Linux)
- Installation and operation GAMIT software under Linux operating system (Linux)
- Linux system firewall defense network attacks (Linux)
- Puppet 3.5 Source package Installation and Configuration (Server)
- Python system default encoding (Programming)
- Linux --- manual release system cache (Linux)
- Getting Started with Linux system to learn: how to configure a static IP address for CentOS7 (Linux)
- In Debian 4.3 compiler under Linux-2.6.28 kernel Summary (Programming)
- Linux monitoring tools introduced series --smem (Server)
- CoreOS use register mirror to build private warehouse (Linux)
- ActiveMQ configuration Getting Started Tutorial (Server)
- MySQL Slave synchronization problem solving (Database)
- Zabbix system email alert Python script (Server)
- Java implementation chain store binary search tree (recursive method) (Programming)
- iOS GCD multithreading simple to use (Programming)
- How to use Linux iptables tool for network sharing (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.