Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ Java Foundation - Variables and data types     - AngularJS application unit testing started (Programming)

- Spacewalk Linux system configuration and installation (Linux)

- Amazon EC2 server using Rsync + Inotify real-time synchronization (Server)

- Applications Linux leap second problem caused (Linux)

- SQLite3 simple operation (Database)

- MySQL development common query summary (Database)

- Android float ball and boot from the start (Programming)

- RHEL7 system making use of OpenStack mirror (Linux)

- Running into the site-wide HTTPS (Server)

- BCP importing and exporting large amounts of data Practice (Database)

- Why do I prefer Git (Linux)

- Thinking in Java study notes - Generics (Programming)

- Matters Oracle 11.2 single instance when connecting ASM need to pay attention and deal with the problem (Database)

- How to configure a server in a MySQL Cluster (Database)

- Hands to teach you to solve Ubuntu error message (Linux)

- RHEL 6.4 installed MySQL 5.6.27 (Database)

- Linux system Perl Lite netstat (Linux)

- Java Annotation Comments (Programming)

- MNIST presentation and database conversion (Database)

- DIY security of Linux platform (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:      
 
- top command causes the system load increases (Linux)
- How Ubuntu Snappy Core 2 running on Raspberry Pi (Linux)
- The multiplexed signal driving IO (Programming)
- Oracle set and remove columns unavailable (Database)
- Use the top command (Linux)
- grep regular expression (Linux)
- Orionode source Linux Mint installation (Linux)
- CentOS 6.5 using Virtualenv under development environment to build Python3 (Linux)
- Linux RPM default installation path (Linux)
- JVM garbage collector and memory allocation strategy (Programming)
- Workaround CentOS error message during compilation PHP5 common (Linux)
- Linux Oracle environment variable is invalid Problem Solving (Database)
- linux network security experience (Linux)
- High-performance Linux system firewall detailed analysis of double-effect (Linux)
- Ubuntu modify locale problem solving (Linux)
- Wine 1.7 is installed on a system based on RedHat or Debian (Linux)
- Timeout control related to Python threads and a simple application (Programming)
- Source code is installed MySQL 5.6.28 (Database)
- About MongoDB query method according to fuzzy field (Database)
- Ubuntu Server (Ubuntu 14.04 LTS 64-bit) installation libgdiplus 2.10.9 error solution (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.