answersLogoWhite

0

Yes you can name a file (class if you use eclipse) java or even have java in the name.

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

Is it possible to have more than one public class in the same file?

No. There can be multiple java classes in the same .java file, but the name of the file must match the name of the public class in the file.


It is not an error not to end a Java file name with the java extension?

If you want to compile a java program the name of that source code must end with extension .java


What is the name of java file?

Adobe flash player


Java program file must match the name of class with extension true or false?

The name of the .java file should exactly match with the name of the public class in the file. Ex: public class Test { ..... } this file should be saved as Test.java


Can a .java file contain more than one java classes?

Yes, it can. However, there can only be one public class per .java file, as public classes must have the same name as the source file.


Why the name of a java file is same as the name of the public class?

It is not compulsory that the java file name and name of the public class should be same. if u will give java file name and public class name different then u have to compile and run the program with another names. for example: u have named class sample i.e. (public class sample) and main function is also defined in this class. and u have saved the file as abc.java then u will first comple the file as: javac abc.java now run the file (type java class name(in which main function is defined) i.e. java sample try it.


The name of a Java program file must match the name of the class with the extension java A True B False?

True


Why you same name in class and file in java?

For run the program


Do you have type a file extension if you want to include the file name?

No, you do not have to type the file extension if you want to include the file name. You only use file extension to make the specific file be able to be run by the program. Example: I want to make my file into a java program so i can use with a specific type of program which only runs java file i put .jav at the end of the title to make it from a text file to a java file.


What is the command to compile a java program named Greetingsjava?

The command to compile a Java program is "javac", followed by the class name (file name).


What should you name the file that contains the object code in java?

ObjectNameHere.java


How Can i compile group of java files once?

You can simply list them with spaces separating each file name: javac class1.java class2.java