1. Java Development Kit Java SDK (contains many of our Java Runtime Libraries)
(1)JRE:Java Runtime Environment Java run-time environment
(2)Java: Development language
(3)Eclipse: Development tools myclipes idea
2, the class name to be the same as the file name to unify string s must be uppercase
Write a Java program output Helloworld
public class helloworld{
public static void Main (string[] args) {
System.out.println ("Helloworld");
}
}
The term of a program comes from life, usually the process of accomplishing certain things and things.
Java domain
Javase to do standard development
Java EE does server-side
Javame doing small-scale software development
Developing the application on the left
Developing programs on the internet side
Print ("") has no line-wrapping effect
println ("") has a line break effect
Program:
public class Helloworld {
public static void Main (string[] args) {
System.out.println ("Helloworld");
System.out.println ("Helloworld");
System.out.print ("Helloworld");
System.out.println ("Helloworld");
}
}
Operation Result:
Helloworld
Helloworld
Helloworldhelloworld
Java specification
Class names are decorated with public
One line is written with a single statement, ending with a semicolon.
Where to use {}
To indent
Write the program to achieve the following effect
public class Show {
public static void Main (string[] args) {
System.out.println ("My Name: the Prince of Tennis ");
System.out.println ("My hobby: playing tennis ");
}
}
Naming rules
Letters, numbers, underscores,$ and cannot start with numbers
Variable, attribute, method naming specification
Capital Initials -Hump rule
3. Data type
(1) basic data Types
Digital type
1, Integer type (byte, short,int,long)
2. Floating-point data type:float,double
Character type (char)
Boolean type (Boolean)
Data types are compared to the size of the storage space
BYTE, short(char),int,long,float,double
Coercion type conversions: Assigning a high-level data type to a lower-class data type must use a forced type conversion
Add the data type you want to convert before the data you want to convert
int i=768;
byte b= (byte) i;
The data type used to hold the character, takes 2 bytes, uses Unicode encoding, its first 128 byte encoding and ASCII compatible characters storage range in \u0000~\uffff, when defining the character type of data should pay attention to " , such as ' 1 ' denotes the character ' 1 ' instead of the value 1,
char c = ' 1 '; We try to output C to see,System.out.println (c), the result is 1, and if we output it System.out.println (c+0), the result becomes 49.
Java,java Data types