• Post Reply Bookmark Topic Watch Topic
  • New Topic

DataInterface

 
Cathy Young
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am (and I know almost every one of you is) thinking of an interface DataInterface.java which defines all the methods in Data.java, but I have a question: only public accessor is allowed in methods defined in the interface, and the methods implemented in the class should not have a weaker access than those in the interface. Then what should I do with those protected or private methods in Data.java. I doubt if we can change the signature of the given methods.
Thanks.
Cathy
 
Burk Hufnagel
Ranch Hand
Posts: 839
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DataInterface only needs to define the public methods of the Data class.
 
Cathy Young
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Burk.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!