Core Java Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 238 Page Views: 

How are Java source code files named?



Posted By: Avi Date: 3 November 2010 03:10:53 PM
 Answer:

A Java source code file takes the name of a public class or interface that is defined within the file. A source code file may contain at most one public class or interface. If a public class or interface is defined within a source code file, then the source code file must take the name of the public class or interface. If no public class or interface is defined within a source code file, then the file must take on a name that is different than its classes and interfaces. Source code files use the .java extension


Posted By: avibtech


Date: 3 November 2010 03:10:53 PM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image iY9IcV
Related Questions
Core Java : Which characters may be used as the second character of an identifier, but not as the first character of an identifier?

Which characters may be used as the second character of an identifier, but not as the first characte....

The digits 0 through 9 may not be used as the first character of an identifier but they may be used ....
Category: Core Java Date: 11/7/2010 5:08:52 AM
Core Java : What is Unicode?

What is Unicode?

Unicode is used for internal representation of characters and strings and it uses 16 bits to represe....
Category: Core Java Date: 11/7/2010 4:35:52 AM
Core Java : When can an object reference be cast to an interface reference?

When can an object reference be cast to an interface reference?

An object reference be cast to an interface reference when the object implements the referenced inte....
Category: Core Java Date: 11/7/2010 2:46:53 AM
Core Java : Can a java program be compiled without main?

Can a java program be compiled without main?

Yes, it’s not required for the main method for compiling the java program. But it must have a main,....
Category: Core Java Date: 11/7/2010 1:52:47 AM
Core Java : What is anonymous class ?

What is anonymous class ?

An anonymous class is a type of inner class that don't have any name.
Category: Core Java Date: 11/7/2010 1:41:51 AM