Home> Java> javaTutorial> body text

Introduction to the basic process of Java program execution

藏色散人
Release: 2020-03-02 17:48:39
forward
2124 people have browsed it

Introduction to the basic process of Java program execution

The following tutorial column fromJava Learningwill introduce you to the basic process of Java program execution. I hope it will be helpful to friends in need!

Let us take a look at the Java program execution process: For example, hellojava.java file, the code is as follows:

  public class hellojava   {   public static void main(String[] args)   {   System.out.println("hello java!");   }   }
Copy after login

Compile in the current directory: javac hellojava.java

Compile in the current directory Run: java hellojava

Output: hello java!

Description: Compilation is to compile the file, you need to write the file name hellojava.java; Run is to the class, so just write the class name.

Description: The java executable file will search for the hellojava class in the file in the corresponding directory according to the environment variable CLASSPATH. CLASSPATH contains the current directory, so the program can find the hellojava.class file in the current directory. hellojava class)

Related recommendations: "Java Programming Self-Study Network"

The above is the detailed content of Introduction to the basic process of Java program execution. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!