search
HomeJavajavaTutorialWhat are the basic concepts of Java?

What are the basic concepts of Java?

Apr 26, 2023 pm 08:13 PM
java

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");}}

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!

Statement
This article is reproduced at:亿速云. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor