应用命令行运行java程序,首先进入到你创立的.java文件夹,而后关上cmd,顺次输出
1.javac filename.java(你所命名的java文件的名字,不要遗记后缀.java)
之后应该会生成一个filename.class文件。
2.java filename(这次不须要加.java)

视频外面应该是说javac是complier,java是interpreter

之后就能够看到程序输入了.
视频中呈现了一些命令
ls 浏览以后文件夹里的文件
rm filename.class 删除filename.class文件
cat filename.java 命令用于连贯文件并打印到规范输出设备上
这些是Linux的命令....
而后是一些Java的语法个性:
Key Syntax Features. Our first programs reveal several important syntax features of Java:

All code lives inside a class.
The code that is executed is inside a function, a.k.a. method, called main.
Curly braces are used to denote the beginning and end of a section of code, e.g. a class or method declaration.
Statements end with semi-colons.
Variables have declared types, also called their “static type”.
Variables must be declared before use.
Functions must have a return type. If a function does not return anything, we use void,
The compiler ensures type consistency. If types are inconsistent, the program will not compile.
Static Typing. Static typing is (in my opinion) one of the best features of Java. It gives us a number of important advantages over languages without static typing:

Types are checked before the program is even run, allowing developers to catch type errors with ease.
If you write a program and distribute the compiled version, it is (mostly) guaranteed to be free of any type errors. This makes your code more reliable.
Every variable, parameter, and function has a declared type, making it easier for a programmer to understand and reason about code.
There are downside of static typing, to be discussed later.

Coding Style. Coding style is very important in 61B and the real world. Code should be appropriately commented as described in the textbook and lectures.

Command line compilation and execution. javac is used to compile programs. java is used to execute programs. We must always compile before execution.