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

How to perform Singleton of the java class object on multi JVM?

2 Answers  


What does \ mean in regex?

0 Answers  


How do I know if java is installed?

0 Answers  


There can be a abstract class without abstract methods, but what is the need to declare a class abstract if it doesn't contain abstract methods?

5 Answers   HCL,


How do you get the length of a string in java?

0 Answers  






what state does a thread enter when it terminates its processing? : Java thread

0 Answers  


What is the output of the below java program?

0 Answers  


Why does java not support pointers?

0 Answers  


Hi i am creating desktop application in that i want calling to mobile number. i have java telephone api (JTAPI) but i dont understand how it configure & use plese help me

0 Answers  


Explain importance of finally block in java?

0 Answers  


How do you replace a string in java?

0 Answers  


Why do you canvas?

0 Answers  


Categories