answersLogoWhite

0


Best Answer

The basic rule is that the file name should match the name of the topmost public class in the .java file. The names are usually camel case and can contains alphabets and numbers. It should begin only with an alphabet.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the rules in naming a source file in JAVA program?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering
Related questions

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 a Javacode?

If someone talks about "Java code," then they're are most likely referring to the source code of a Java program.


Why cant someone hack a Java program if they know the Java programming language?

Knowing Java does not allow you to hack a Java program because the source code is not available to hackers. Also, a program interprets the bit-code before you see it, so even with a decompiler, hacking the program will not be possible.


What do you get when you compile a java program?

The java interpreter or JVM (Java Virtual Machine) is not able to execute the java source code for a program. The java source code first needs to be compiled into bytecode that can be processed by JVM. Producing bytecode make the program platform independent as each platform has its own JVM. It is also possible to directly write bytecode, bypassing the need to compile, but that would be tedious job and also not good for security purpose as the compiler checks for various errors in a program.


Full form of jndi in java?

JNDI stands for Java Naming and Directory Interface JNDI is an API specified in Java technology that provides naming and directory functionality to applications written in the Java programming language


Difference between a java complier and the Java JIT?

A java compiler takes Java source code and turns it into Java bytecode, which can then be run by the java virtual machine.Using JIT means that the java code will be compiled and executed at the time that you run the program, which will slow down the program because it has to compile the code at the same time that it runs.


How do you extract the java source code of a java based open source software?

If the software is open source then generally they will provide the code in a separate link. I don't think it is possible to reverse-engineer the code of a program.


Why 2 files in java program?

There are programming languages in which the source file is read and interpreted directly, but those are usually slower than when the program is compiled, to an EXE, or as in Java, for a virtual machine.


What does the acronym JNDI stand for?

The acronym 'JNDI' stands for Java Naming and Directory Interface. What this refers to is the naming system for Java, a computer programming language.


What are tools or software that are needed to editcompile and run to java?

To edit Java source code you can use any text editor. In order to compile a Java source file to Java bytecode you need the Java Development Kit (JDK). The program which does this is called "javac" and can produce .class files which can be used by the Java Runtime Environment (JRE) to execute.


What do you mean by multithread program in java?

A Program in Java that spawns multiple threads is called a multithreaded program in Java.


What is JAVA drive by?

AnswerA Java Drive-By is a Java Applet that is coded in Java and is put on a website. Once you click "Run" on the pop-up, it will download a program off the internet. This program can be a virus or even a simple downloader. If you'd like to get the source code or wanna know more information about a Java Drive-By, use Google.