入门Java编程语言的学习(Learning the introductory Java programming language)

一、初识Java1.生活中的程序:从起床到教室上课的过程

穿衣打扮》起床》洗漱》出宿舍》》吃早餐》到教室

按照特定的顺序去完成某一件事的过程我们叫做生活中的程序

2.计算机中的程序:一组有序指令的集合,需要和计算机交流就要使用计算机语言,java就是计算机语言的一种

3.Java能做什么:1、开发桌面应用程序,比如:QQ、酷狗

2、开发Internet应用程序,比如:淘宝、天猫

4.Java技术平台:1、Java SE:标准版,java的技术与核心,开发桌面应用程序

2、Java EE:提供企业级项目的解决方案,开发网页应用

5.安装Jdk:Jdk:Java的一个核心工具包

Jre:Java的一个运行环境(表示Java除了可以在windows系统运行,还可以在苹果系统运行)

环境变量:告诉计算机可以执行.Java的运行程序在哪里

6.开发Java程序的步骤:1、编写一个Java源程序

新建记事本,将后缀名改为.java

2、编译java源程序,语法:javac 源文件名.java

编译后会生成一个.class的字节码文件

3、运行java程序,运行的是.class的文件,语法:java 源文件名

注意:java严格区分大小写

System.out.println ()        打印之后换一行,先打印再换行

System.out.print ()        打印之后不换行

7.转义字符:使用”\n”进行换行

使用”\t”空格一个制表符的位置,也就是一个tab的位置,8个英文字母的长度

8.Java中的注释://注释内容        单 行注释:表示对下一条语句进行一个解释

/* 注释内容 */ 多行注释:表示对下面一段语句进行一个解释

/**注释内容 */ 文档注释:表示对一段文本注释

注释的语句是不会进行编译的

9.Java的编码规范:1、遇到大括号 { 就进行一次缩进,缩进距离一个tab键的长度

2、每一个大括号 } 单独占一行,表示一段语句的结束

3、 ; 表示每行语句的结束,每一行只写一句代码

10.使用开发工具开发Java程序的步骤:1、新建一个java工程

2、选中新建的工程,选中src文件夹,点击右键new,新建一个class,新建时选中

public static void main这一项,会自动生成java源程序的框架

3、去编写java源程序

4、编译java源程序,开发工具会自动编译

5、运行java程序 

Java入门推荐:https://www.bilibili.com/video/BV1qL411u7eE?spm_id_from=333.337.search-card.all.click

搜索

复制

————————

1、 Java 1 Procedures in life: the process from getting up to class in the classroom

Dressing up, getting up, washing, going out of the dormitory, having breakfast and going to the classroom

The process of completing something in a specific order is called the program in life

2. Program in the computer: a set of ordered instructions. If you need to communicate with the computer, you need to use the computer language. Java is one of the computer languages

3. What Java can do: 1. Develop desktop applications, such as QQ and cool dog

2. Develop Internet applications, such as Taobao and tmall

4. Java technology platform: 1. Java se: Standard Edition, the technology and core of Java, developing desktop applications

2. Java EE: provide solutions for enterprise projects and develop web applications

5. Install a core toolkit of JDK: JDK: Java

JRE: a running environment of Java (it means that Java can run not only on Windows system, but also on Apple System)

Environment variable: tells the computer that it can execute Where is the running program of Java

6. Steps of developing Java program: 1. Write a java source program

Create a new notepad and change the suffix to java

2. Compile java source program, syntax: javac source file name java

A will be generated after compilation Class bytecode file

3. Running Java program, running is Class file, syntax: Java source file name

Note: Java is strictly case sensitive

System. out. Println() change a line after printing, print first and then change a line

System. out. Print() does not wrap lines after printing

7. Escape character: use “\ n” to wrap lines

Use “\ T” space to the position of a tab, that is, the position of a tab, and the length of 8 English letters

8. Comment in Java: / / comment content / / single line comment: indicates an explanation of the next statement

/*Comment content * / multiline comment: indicates an explanation of the following paragraph

/**Note content * / document note: indicates a note to a paragraph of text

Annotated statements are not compiled

9. Java coding specification: 1. Indent the curly braces {once, and the indent distance is the length of a tab key

2. Each brace} occupies a separate line, indicating the end of a statement

3、 ; Indicates the end of each line of statement, and each line only writes one sentence of code

10. Steps of using development tools to develop java programs: 1. Create a new Java project

2. Select the new project, select the SRC folder, and right-click new to create a new class. When creating a new class, select

Public static void main will automatically generate the framework of Java source program

3. To write java source code

4. Compile the Java source program, and the development tool will compile it automatically

5. Running Java programs

Java入门推荐:https://www.bilibili.com/video/BV1qL411u7eE?spm_id_from=333.337.search-card.all.click

search

copy