File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is empty file valid source file???.

 
sun ram
Ranch Hand
Posts: 61
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Is empty file valid source file.
for emptry file javac desn't report any error. But it is not generating class file.
Bye
SR
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
en empty source file is valid...
the compiler doesn't generate any class file because there is nothing to generate anyway...
HIH
------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform
 
Vikrama Sanjeeva
Ranch Hand
Posts: 756
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sun ram:
Hi,
Is empty file valid source file.
for emptry file javac desn't report any error. But it is not generating class file.
Bye
SR

javac converts the java statements (present in source file) into byte code.This code is then saved in seperate file having "class"
extension.An emty java source file contains no statement(sine it is empty), therefore there will be no byte code, & hence no need for seperate "class" file.
Bye.
Viki.

------------------
Count the flowers of ur garden,NOT the leafs which falls away!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic