aspose file tools*
The moose likes Beginning Java and the fly likes what we should do with interface when create jar file ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "what we should do with interface when create jar file ?" Watch "what we should do with interface when create jar file ?" New topic
Author

what we should do with interface when create jar file ?

Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 438
hi, good day , say if i have an utility class which implements interface, when i create jar file, what i should do with interfaces ? as it doesn't generate .class ..

ii) is jar file only contains .class file ?

thank you for clear my doubt , have a nice day
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

??
Compiling interfaces WILL generate class files.


[My Blog]
All roads lead to JavaRanch
Pradeep Kadambar
Ranch Hand

Joined: Oct 18, 2004
Posts: 148
Yes compiling any valid Java code will generate .class files. Interfaces are no exception.

Regarding your query on contents of jar file, it can contain classes, source files (ANSCI files), images etc. :roll:
Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 438
thank you , sorry for stupid question, i was thinking only class would generate class , but interface not ..

then how the compiler differentiate that the .class file is belong to class or interface ? and why we can't instantiate interface or abstarct class ? thank you for guidance
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what we should do with interface when create jar file ?