Java basics and java

Source: Internet
Author: User

Java basics and java
1. Some simple doscommands:

-D: Switch the carriage return drive.

-Dir (directory): lists the files and folders in the current directory.

-Del: delete an object

-Md: Create a folder

-Rd: delete a folder

-Cd (change directory): change the specified directory (enter the specified directory)

  • Go to the cd directory.
  • Roll back cd...; cd \

-Cls: (clear screen) clear screen

-Exit: exit the doscommand line.

 

2. Basic data constants:

Basic data types: 4 categories, 8 Types
A: The integer occupies the number of bytes.

Byte 1
Short 2
Int 4
Long 8
B: Floating Point Number
Float 4
Double 8
C: character
Char 2
D: Boolean
Boolean 1

 

3. JVM, JRE, and JDK:

To put it simply:

JVM is a Java virtual machine.

JRE: Java Runtime Environment

JDK: Java Development Kit

 

JDK includes the runtime environment and development kit

JRE includes core class libraries and virtual machines

 

4. Implicit and forced conversions:

Forced conversion: Direct conversion from small to large

Example: int a = 1; byte B = 2; int c = a + B;

Implicit conversion: Small conversion is highly risky and mandatory.

Target type variable name = (target type) (converted data );

Example: byte B = 1; int I = 2; byte c = (byte) (B + I );

5. identifier:

Identifier: indicates the name of a package, class, method, or variable.


A: unicode characters
Numbers, English case and Chinese characters (Chinese characters are not recommended)
B: underline _
C: Dollar sign $

Note:
A: it cannot start with A number.
B: it cannot be a keyword in java.

Common naming rules:

A: basic requirements: click here
B: common naming rules
A: Package (actually a folder for class management), all in lower case, multi-level packages are separated.
Example: com, com. itheima
B: class. The first letter of a word is capitalized.
Example: Student, Car
Uppercase letters of each word for multiple words
Example: HelloWorld
C: Methods and variables
Lowercase letters of a word
Example: age, show ()
Multiple words start from the second word and the first letter of each word is capitalized.
Example: maxAge, getAge ()

Related Article

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.