OK, the two-day Ubuntu Common Command learning end, and now start the Java language learning.
At the end of this article, I said the JDK file installation under Ubuntu, and now by the way, the JDK environment variable configuration under win
In the official website to download the system-compliant JDK files, can be exe or Zip,exe can be installed directly, the installation path can be customized; zip only needs to unzip to the path you want to put, will produce a jdk1--version number of the folder containing Bin,lib folder
Start configuration: The main configuration is two blocks: 1.bin file directory in the path 2.lib directory placed in the Classpath can be noted each path with;
Java Foundation--helloworld
public class helloworld{
Usually the first sentence HelloWorld for the class name. 1: The first letter of the class name must be uppercase
Note Point 2: the Java file name must be the same as the class name, Helloworld.java
Java Fundamentals-constants, variables, data types, basic data types
Integral type ==================
BYTE byte 8-bit bit 1 byte
Short 16-bit 2
int integral type 32bit 4
Long length int 64bit 8
Floating-point ============== bytes
Float Single Precision 4
Double Dual Precision 8
Logic ==============
Boolean Boolean True False
======
char characters (single character) using single quotation marks 2
The above are eight basic data types, just remember the size of the sort
Data class Conversion ======
1, the same type of data type conversion can be image of a large bucket and bucket, large barrels of water poured into the bucket will overflow, small barrels poured into the bucket will not be lost
The size of the bucket is the number of bits of the data type
2, cast for different types, float a=3.14;int b= (int) A;
Today the main simple to talk about some of the basic data types, the difference is to use a CMD command prompt or terminal tools, constantly write different data types and change the value of the variable length, compiled to see what will prompt.
"Java Development" data type