Home > Java > javaTutorial > body text

What are the basic concepts of Java?

王林
Release: 2023-04-26 20:13:06
forward
1219 people have browsed it

1. History of java development

1. The father of java: James Gao Jialin

2. Key time points: Java (1.0) was released in 1996, Java (5.0) was carried forward in 2004, Java (8.0) was the most widely used in 2014, and Java (16.0) is used this time in 2021.

2. Java cross-platform

Principle: Different platforms have corresponding Java virtual machines (JVM)

2. JRE and JDK

JRE is an environment used to run Java programs, including JVM and core class libraries

JDK is a Java development tool kit, including JRE and development tools (including compilation tools javac.exe and Running tool java.exe)

That is, JDK includes JRE and development tools, and JRE includes cross-platform JVM and core class library

3. Download JDK

Official website link

Baidu cloud link, extraction code: bjcp

The directory after installation has the following parts:

What are the basic concepts of Java?

4. Commonly used DOS commands

win R into CMD, cut disk, dir, cd, cls, exit commands

5. Configure Path environment variables

This is to add the bin directory to the system variable, and everything after jdk16 is ready

6. The first program

1. Create a new HelloWorld.java file

2. Open the HelloWorld.java file with Notepad and write the content

public class HelloWorld {public static void main(String[] args){System.out.println("HelloWorld");}}
Copy after login

3. After jdk11, you can directly use java&HelloWorld.java. If the program will output Chinese, then in Add -encoding&UTF-8

## after 7. Notepad

This is convenient for displaying line numbers. It will be uneasy to use IDE later

8. Note

Single line: //

Multi-line: /* /


Document:/**&*/

9. Keywords

Features: lowercase, editor corrects keywords Color code

10. Constants

Note: Character constants are single quotes, string constants are double quotes, and empty constants cannot be used directly output.

What are the basic concepts of Java?11. Data types

The smallest storage unit in a computer is a byte. A byte (B) is composed of eight bits (b)


What are the basic concepts of Java?
12. Variables

What are the basic concepts of Java?Format

: data type&variable type=variable value

Note: Add L after long type and F

after float type. 13. Identifier

Format

: 1. It consists of numbers, letters, and $; 2. It cannot start with a number; 3. It cannot be a keyword; 4. It is case-sensitive.

Method and variable convention (little camel case naming method) : 1. When the identifier is one word, the first letter is lowercase; 2. The identifier is composed of multiple words When the first letter of the first word is lowercase, the first letter of the other words is capitalized.

Class convention (large camel case nomenclature): 1. When the identifier is one word, the first letter is capitalized; 2. When the identifier is composed of multiple words, Capitalize the first letter of each word.

14. Type conversion

1. Automatic type conversion

: A value representing a small data range or a variable assigned to another variable representing a large data range


2. Forced type conversionWhat are the basic concepts of Java?: A value or variable representing a large data range is assigned to another variable representing a small data range (add A forced conversion is enough)

The above is the detailed content of What are the basic concepts of Java?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!