Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Data implementation

 
Vinicius Florentino
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible Data implements other interface like Closeable or other created by me? Data is implementing only DB now.
 
Vinicius Florentino
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And if Data can implements a subinterface of DB. example:

public interface X extends DB {
...new method
}

public class Data implements X...
 
Gilles Marceau
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

in my opinion, the answers to your two questions are both yes.
You have to comply with the assignment instructions, and regarding the DB
interface and the Data class, it states that :
"Data.java must implement the DB interface".

There is no restriction on other interfaces that Data must or must not implement. And stritcly speaking, implementing a subclass of DB means
implementing DB.

brgds,
Gilles
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic