if a java file without any source code is valid java file?

Answers were Sorted based on User's Feedback



if a java file without any source code is valid java file?..

Answer / kartik kudada

Yes, It is possible .

java file can be empty.
You could check it eclipse.

Is This Answer Correct ?    15 Yes 3 No

if a java file without any source code is valid java file?..

Answer / gaurav kumar

yes a java file without any source code is valid java file.
it will compile without any error but while running it gives
error-
"could not find or load main class----"

Is This Answer Correct ?    0 Yes 0 No

if a java file without any source code is valid java file?..

Answer / la_di

(I suppose you mean IS not IF)

No, an empty file is not a valid java file since you have
to use the same class-name as file name. (A file with a
valid class declaration but an empty body is valid thou)

Is This Answer Correct ?    5 Yes 11 No

Post New Answer

More Core Java Interview Questions

What is return data type?

0 Answers  


What is the base class for error and exception?

0 Answers  


Write an algorithm for quick sort?

0 Answers   Virtusa,


How do you use find and replace?

0 Answers  


What is aggregation?

1 Answers   Cap Gemini,






What is meant by interface?

0 Answers  


What is the difference between normal report & matrix report?

0 Answers  


How do you relate a Interface to a Class? Tell me in Detail?

4 Answers  


How do you replace a string in java?

0 Answers  


What class allows you to read objects directly from a stream?

0 Answers  


What is the difference between checked exception and unchecked exception?

0 Answers  


What are the two types of java programming?

0 Answers  


Categories