1 note

  1. First acquainted with the
    basic dos commands of java .
    Compile and run
    jdk and jre
    mkdir-create directory
    cls and clear the screen.
    Drive letter: such as E: D: C:
    Insert picture description here

dir command, you can see the subdirectory
cd in a certain directory : switch directory cd …return to the previous directory cd.
Delete a directory in the current directory rd-rd directory name
del delete a file-del file name
Shortcut key:
press Automatically complete the tab when commanding,
open the command line win+R and
use the up and down arrows to scroll through the history command records
. The problem of copying the content in the command line window: right click -> mark (k) -> left click to
select the area to be copied -> enter( Enter) to get the content to be copied, and then
you can paste it to other places

javac command is used to compile java source code

e:\java basics>javac Hello.java

The java command is used to execute the compiled java program

e:\Java basics>java Hello
hello world!
Learn java for future software development—jdk is called developer toolkit—for
developers. We developed a piece of software for the students in the liberal arts school using java. We are the
developers and the students in the liberal arts are the users. We must use jdk.
jre: java runtime environment java runtime environment, this
thing is needed when running the program.
We need to have a certain understanding of java. How to compile and run? This also includes
the difference between java and C.
What is java?
1 C language:
2 The compiling and running of C language has requirements for the environment. Have
there been different results when compiling the same program with different compilers?
3 Pointer:
4 What is the size of the memory space occupied by char* p on a 32bit machine?
4Byte—The memory address where the pointer is stored.
5 On a 64bit machine, the size of the memory space occupied by char* p is 8Byte.
6 A C language program compiled under a 32bit machine
can be run
on a 64bit machine. 7 Compiled under a 64bit machine C language program
can not run on 32bit machine
8 Why?
9 1Byte = 8bit 1bit can store high and low power frequency, 0 or
1; 32-bit machine means that the size range of memory addressing is 32 0 to 32 1, high
Low frequency is transmitted by wires. It can be imagined that there must be 32 wires to transmit high and low frequency.
10 00000000 00000000 00000000 00000000
11
12 11111111 11111111 11111111 11111111
13 From 32 0s to 32 1s are the order of memory physical addresses.
To find the address, do you need 32 address lines to find it? 14
15 32bit machine under the pointer occupies 4Byte memory,
16 64bit machine under the pointer occupies 8Byte memory,
17 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000
18 11111111 11111111 11111111 11111111
11111111 11111111 11111111 11111111
19 Excuse me , put it on the 32bit machine When, can you
find the address?
20
21
22 java language: compile in one place, run everywhere
23 the same code, after being compiled once, it can be executed in any environment.
24 Because java runs on the java virtual machine. The java virtual machine is jvm
25 jvm: equivalent to an operating system, running java. Java
is not compiled . The compiled java program only runs on jvm. As for how to follow the hardware and host
The interaction between the host operating system is a JVM business, and programmers generally don't care about it
. I don't care which operating system it is on, because the compiled java program is executed on the
jvm.
29 There is no concept of pointer in java, pointer has been encapsulated.
Compared with C, Java has some shortcomings. For example,
C/C++ needs to operate and manage complex memory, and the operation and management of memory are
carried out by the programmer. A little carelessness will cause memory leaks and so on. But if it is managed
well, the efficiency of the program is very high. This is where people often say that C/C++ is more efficient than
Java. For good programmers, Java is indeed not as robust as
C/C++.
34 What is JVM?
35 jvm is called java virtual machine, which is not a fixed software at first glance. That it is
what is it? jvm is a set of standards. It is a standard established by SUN. People can
develop specific versions of jvm according to this set of standards. For example, HotSpot is
a software developed using jdk development tools in accordance with the jvm standard to
run compiled java programs.
36
37 OpenJDK is a developer tool
38
39 HotSpot---->An implementation of jvm
40 Java is open source, so jdk has source code, and openjdk also has source code

Guess you like

Origin blog.csdn.net/weixin_53273434/article/details/113100951