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

Difference between String and StringBuffer.

3 Answers   GE, IBM,


What is parsing a string?

0 Answers  


difference between vectorlist and hash

1 Answers   TCS,


What is math in java?

0 Answers  


How does sublist works in java?

0 Answers  


Explain about doubly linked list

0 Answers   Aditi Placement Service,


difference between java ,c#&java,c++

3 Answers  


how to use finalize()Method to resources

4 Answers   TCS,


What is the purpose of setAutoCommit() ?

1 Answers   Google,


Why is an interface be able to extend more than one interface but a class can’t extend more than one class?

0 Answers  


What is the meaning of find and replace?

0 Answers  


What is an example of procedure?

0 Answers  


Categories