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 about interrupt() method of thread class ?

0 Answers  


why did you choose your career in IT?

1 Answers   LIC,


How can you traverse a linked list in java?

0 Answers  


How do you start a new line in java?

0 Answers  


What is a generic code?

0 Answers  


Why are strings immutable in Java?

1 Answers  


Difference between comparator and comparable in java?

0 Answers  


What is the use of object and class classes?

0 Answers  


Why is the main method static in Java?

1 Answers  


wht is customised exception?

1 Answers   Logica CMG, Novell, Prudential,


Is array synchronized in java?

0 Answers  


What is thread life cycle?

0 Answers  


Categories