Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what we should do with interface when create jar file ?

 
Nakata kokuyo
Ranch Hand
Posts: 472
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
??
Compiling interfaces WILL generate class files.
 
Pradeep Kadambar
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 472
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic