Public class differences and class

class A

{

}

class B

{

}

 

public class and class differences:

* A look at the definition java source files among multiple class

* A java source files among the public of the class is not required

* Define a class bytecode files to generate a xxx.class

* Definition of a java source files among the public that kind of thing, public is only one class, and the class name must be the same as the name of the source files and java. [Remember] rules

* Each class which can write the main method, you can set the program entry, want to perform mian method B.class in: java B, the main method of execution that is among x.class: java x

* Note: When performing java hello in the command window, then the requirements must have a primary method Hello.class among the main method would not operational phase error.

 

 

 

Guess you like

Origin www.cnblogs.com/god1/p/11916938.html