[Java Learning] Getting to Know Java

Introduction to Java

Pre-school questions: (learn with questions, and explore the answers by yourself during learning)

  1. What is Java? what can be done
  2. What are the prospects for development?
  3. What do I need to learn?
  4. What kind of job can I find after finishing my studies?
  5. How can I learn it?

1. Introduction to Java

·Java

·Java是一门面向对象的程序设计语言
·1995年由sun公司发布
·2010年sun公司被Oracle公司收购
·JDK版本8.0

·JVM

·JVM(Java Virtual Machine),Java虚拟机
·JVM是Java平台无关性实现的关键

Java程序执行过程:
	源文件(Program.java) --> compiler(编译器)--> 字节码文件(Program.class)
	--> interpreter(解释器,由JVM完成解释执行的过程)--> Program

·JDK

·JDK(Java Development Kit),Java语言的软件开发工具包。
·两个主要组件:
	-javac -编译器,将源程序转成字节码
	-java -运行编译后的java程序(.class后缀的)

·JRE

·JRE(Java Runtime Environment)
·包括Java虚拟机(JVM)、Java核心类库和支持文件
·JRE与JDK的区别:
	1.如果只需要运行Java程序,下载并安装JRE即可
	2.如果要开发Java软件,需要下载JDK
	3.在JDK附带有JRE
	(JRE面向使用人员,JDK面向开发人员)
·JDK、JRE 和 JVM 三者的关系:
	JRE = JVM + JavaSE标准类库
	JDK = JRE + 开发工具集(例如Javac编译工具等)

·Java platform

1.JavaSE(Java标准版):主要用于桌面程序的开发(如QQ等);【JavaEE的基础】
2.JavaEE(Java企业版):主要用于Web网站的开发(如电商网站等)
3.JavaME(Java微型版):主要用于移动设备的开发(随着安卓和IOS的兴起,现在用的较少)

2. Installation and configuration of Java environment

Complete the "JDK environment construction and configuration under Windows"
for details: [Java study notes] JDK, JRE installation and Java environment variable configuration notes

3. Develop your first Java program

  1. Write a source file and save it (you can write it in Notepad, then save it as a .java file)
    insert image description here
    insert image description here
  2. Compile the file (open the cmd command line window, enter javac HelloWorld.java)
    (here the reader configures global variables by default)
    Go to the directory where the .java file was just saved, open the cmd window
    insert image description here
    Compile the .java file and get the corresponding .class bytecode file
    insert image description here
    insert image description here
  3. run the program
    insert image description here

So far, we have completed the development and operation of the first Java program!

Guess you like

Origin blog.csdn.net/weixin_45954198/article/details/123163680