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

Can you change array size in java?

0 Answers  


how we can make a write-only class in java?

0 Answers  


what is the difference between @include page and @include file

2 Answers  


garbate collector(GC)?

4 Answers  


What is static import in java?

0 Answers  






what is the difference b/w static and final methods?

1 Answers  


What modifiers are used with a top level class?

3 Answers  


What function extracts specified characters from a string?

0 Answers  


What is string args [] in java?

0 Answers  


Can static method access instance variables ?

0 Answers  


How can you take string into InputStream?

3 Answers  


What is the use of a copy constructor?

0 Answers   Flextronics,


Categories