"Java Development" data type

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.