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
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply 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: 437
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: 14669
    
  11

??
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: 437
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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: what we should do with interface when create jar file ?
 
Similar Threads
Interfaces Question(s)
jar
eclipse export jar question
setting classpath jar
Use Reflection to "find" classes