A simple understanding of Java Knowledge (Day1)

Source: Internet
Author: User

1.Java Language Overview (Learn)
(1) The history of the Java language
The father of Java

JDK1.4.2
JDK5
JDK7
JDK8
(2) Features of the Java language
There are many small features, with a focus on two open source, cross-platform
(3) The Java language is cross-platform, how can I guarantee it? Understand
We explain it through the case of translation.

For different operating systems, improve the different JVM to achieve.
(4) The Java language Platform
Javase
Javame--android
Java EE

The role and relationship of 2:JDK,JRE,JVM (mastery)
(1) function
JVM: Securing the Java language across platforms
Jre:java the operating environment of the program
Development environment of Jdk:java program
(2) Relationship
jdk:jre+ Tools
jre:jvm+ Class Library

3:JDK download, install, uninstall (master)
(1) Download to official website.
A: Can also go to Baidu search can.
B: I'll give it to you.
(2) Installation
A: The green version of the decompression can be used
B: The installation version must be installed step-by-step, generally as long as you click on the next step

Attention:
It is recommended that all development-related software should not be installed in a directory with Chinese or white space.
(3) Uninstall
A: Green version Delete folder directly
B: Installation Version
A: Control Panel--Add Remove Program
B: Through a professional software uninstall tool. (e.g. 360 software Manager uninstall)

4: First Program: HelloWorld case (Master)
class HelloWorld {
public static void Main (string[] args) {
System.out.println (" HelloWorld ");
}
}
(1) Program interpretation:
A:java The most basic unit of a program is a class, so we define a class.
Format: Class name
Example: Class HelloWorld
B: When you write content in a class, enclose it in curly braces. The
C:java program must have a main method to execute.
Format: public static void Main (string[] args)
D: To point to those things, enclose them in curly braces.
E: What are you going to do? Today we just made a simple output
Format: System.out.println ("HelloWorld");
Note: The contents of "" can be changed.

(2) Java program Development execution flow:
A: Write Java source program (. java)
B: Build. class file
C: Run through Java command. class file

5: Common problems (Mastering)
(1) The extension is hidden
How to find: Tools--Folder Options--View--Remove the check box for hidden extensions
(2) I want the file name to be the same as the class name. It is also possible for the
to not actually do so.
However, note:
Javac followed by the file name + extension
After Java followed by the class name without the extension
(3) The Java language is strictly case-sensitive, please note.
There is also the word don't write wrong.
(4) See illegal characters: \65307 must be a Chinese question.
We write programs that require punctuation marks to be all in the English state.
(5) The pairing problem of parentheses.
in general, the parentheses appear in pairs.
(6) encountered
could not find the main method in class HelloWorld, please define the Main method as
must be a format problem for the main method.

6:path environment variable (master)-----------------!!! Note that adding content on the contents of the original Path variable value is not an overwrite
(1) The role of the PATH environment variable
Ensure that the Javac command can run in any directory.
Similarly, you can configure QQ, etc.
(2) path configuration of two scenarios:
A: Scenario 1 (understanding)
B: Scenario 2
Find the location of the environment variable inside the system variable
New:
Variable name: java_home
Variable Value: D:\develop\Java\jdk1.7.0_60
Modify:
Variable name: Path
Variable value:%java_home%\bin; previous content

7:classpath Environment Variables (understanding)
(1) The role of CLASSPATH environment variables
Guaranteed class files can be run in any directory
(2) configuration of CLASSPATH environment variables
Find the location of the environment variable inside the system variable
New:
Variable name: classpath
Variable Value: E:\JavaSE\day01\code\HelloWorld case


8. Data type
Java is a strong type of language, variables in use must be declared type, according to different needs to produce different data types, different data types in memory of the memory size is not the same

Basic data types

Eight basic types of data
Value 23 34.56
Character Fu Nan
Logical results True and false

integer-store integers
1). Byte 1-byte 8-bit binary -128~127
Application: In file storage, IO read and write data
2). Short 2 byte 16-bit -2^15~2^15-1
Application: Relatively few -32768~32767
3). ***int 4 bytes 32 bit -2^31~2^31-1
The integer value (direct amount) written directly in the program is the int type by default

4). Long 8 bytes 64 bit -2^63~2^63-1

5). Character Char
A. Types of user-stored characters (with only one)
B. Indicates that character syntax is enclosed in single quotation marks, representing the character itself
C. Using Unicode encoding in Java, with a range of values (0~65535)

6).
A. Float 4-byte 32-bit (23-bit + 8-bit + 1-bit sign bit)
The small value (direct amount) written directly in the program is double by default
If you want to indicate the direct amount of float type, you need to add "F" or "F" behind the value

7). Double 8-byte 64-bit (52-bit + 11-bit + 1-bit sign bit)

8) BOOL Type Boolean
1. Only two values (reserved values): True (True) False (false)
2. The result of logical judgment can also be used to save

A simple understanding of Java Knowledge (Day1)

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.