Home > Back-end >  In Java public problem
In Java public problem

Time:09-16

This is what circumstance, why the public in the class in front of the Testone cannot compile, but remove the front of the public can run

CodePudding user response:

With the public, and public file name to modify the class

CodePudding user response:

refer to the original poster fat beef ^ * ^ reply:
this is what circumstance, why added public class in front of the Testone cannot compile, but remove the front of the public can run


You compile name backwards, the main class is Testone,

CodePudding user response:


This is your main class, but you perform the test. The Java

CodePudding user response:

reference 3 floor efforts won't be late to reply at any time:

This is your main class, but you perform the test. The Java

Compilation is not javac Test. Java

CodePudding user response:

reference fat beef, 4/f ^ * ^ reply:
Quote: refer to the third floor at any time in the efforts were not late reply:

This is your main class, but you perform the test. The Java

Compilation is not javac Test. Java

To run the program from class contains the main method of it

CodePudding user response:

reference fat beef, 4/f ^ * ^ reply:
Quote: refer to the third floor at any time in the efforts were not late reply:

This is your main class, but you perform the test. The Java

Compilation is not javac Test. Java


Only the main class can add public, the inner class can't add to the public

CodePudding user response:

Inside a class file can have only one class is a class of public to modify the file name to the public class

CodePudding user response:

The name of a class class must correspond to a. Java file, unless it is a inner classes, or compiler

CodePudding user response:

Leakage, a public key to modify the class class
  • Related