Getting Started with Java 1

Java Tips

1.java source file has a lot of class, only one class for the public, and if there is a class for the Public, then the java source code name must be identical to the name of the class, if there is no public class, a class with the same name can, java in the extension are "xXX.java"

2.java application program entrance main (), java applets not in main (), to the inlet, but the nesting of the page.

3. The main application entry () method:
public static void main (String[] args){ }

Inside the braces and the following main () method is called content thereof; Java application must have one and only one main () method, this class of application called the main class, main () method must be declared as public, static , void, which is a public class is public, static is a static class can be loaded via the class name, is non-void return value; String [] args String in S must be capitalized;

4.java output statement: System.out.println ( "available for purchase to the Java
World!"); / * String "Welcome to Java world!" Is output to the standard output of the system, where system is the system the object class, out the object is a system object, standard output, a method is the println out output, the role is a parameter string format specified in the standard output system, and carriage return.

5, java applet (Java Applet) is composed of several classes, there must be one and only one extends Applet class, i.e., it is a subclass of the Applet class, this class is called the Applet class of the main class, the main Applet class must be of publica, Applet class is a system-provided classes. Applet is running on the browser, you must create an html file by writing html code to tell what kind of Applet loaded and run.

6.javac java language compiler is used to compile the java language bytecode files, i.e. (.java becomes .class), java is a java language interpreter bytecode execution.

7.java compiler using the format: Javac [compiler options] filename
that is (javac)

Javac command compiles its option to javac viewed by entering the command window
Here Insert Picture Description

8.java interpreter using the format:

 java [-options] class [args...]

           (执行类)

or

 java[-options] -jar jarfile [args...]

           (执行 jar 文件)

[-Options] Specific cocoa java viewed by entering the command window

9.java documentation generator (javadoc.exe), java and other compiled languages ​​biggest difference is that document maintenance

java document generator using the format: Javadoc
[Options] [packagenames] [sourcefiles] [@files]

10.java debugger (jdb.exe)

11.applet browser (appletviewer.exe)

12.java statement, import XXX *, XXX package referenced class;. Class XX, defines the general category; interfance XXXX, interface definition

Published 38 original articles · won praise 0 · Views 1131

Guess you like

Origin blog.csdn.net/weixin_45489155/article/details/104833138