java学习(Java learning)

今天开始学习Java,了解了Java的一些基本常识和跨平台原理

Java源文件经过Javac。exe编译为.class字节码文件,字节码文件只要产生就能在任何安装有Java虚拟机的操作系统平台上运行

Java.class文件动态的调ava.exe文件执行代码,Java.exe动态的调用Java虚拟机执行代码

Java的运行需要jdk(开发运行环境),jdk包含jre(运行环境)

jre中又有jvm(虚拟机)

jre里还有java运行时需要的动态库(.dlll)等文件构成运行环境

Java的变量命名规则和c语言很相似都是强类型定义,必须指定类型

Java的变量分为局部变量和成员变量

局部变量只存在于定义它所在的方法体也就是{}内

成员变量在全局有效

一个类产生相应的字节码(哪怕他是在同一源文件里面)

一个源文件能有多个类但只有一个可以加public

Java程序时从main()方法开始执行的的

下面给出一段代码框架

public  class chen{

public static void main(String[] args){

System.out.println(“hello,world”);

}

}

————————

Today, I began to learn Java and learned some basic knowledge and cross platform principles of Java

Java source files pass through javac. Exe compiled as Class bytecode file. As long as the bytecode file is generated, it can run on any operating system platform with Java virtual machine installed

Java. Class file dynamically called Ava Exe file execution code, Java Exe dynamically calls Java virtual machine to execute code

The running of Java requires JDK (development and running environment), which contains JRE (running environment)

There is also a JVM (virtual machine) in JRE

JRE also has the dynamic library (. Dlll) and other files required by Java runtime to form the running environment

The variable naming rules of Java are very similar to those of C language. They are strongly typed definitions, and the type must be specified

Java variables are divided into local variables and member variables

Local variables only exist in the method body where they are defined, that is, {}

Member variables are globally valid

A class generates the corresponding bytecode (even if it is in the same source file)

A source file can have multiple classes, but only one can add public

Java program is executed from the main () method

Here is a code framework

public  class chen{

public static void main(String[] args){

System.out.println(“hello,world”);

}

}