• Post Reply Bookmark Topic Watch Topic
  • New Topic

interface creates instance for desired class  RSS feed

 
Raza Mohd
Ranch Hand
Posts: 247
Java MyEclipse IDE MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

Can we create an interface having the same method validate() which is implemented in my three different classes.
and as desired i would like my interface to generate the instance of desired class.

can anybody tell me. what would be the pattern for that?

Thanks in advance.
Raza!
 
Prabhakar Reddy Bokka
Ranch Hand
Posts: 198
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is Factory Design Pattern.
 
Raza Mohd
Ranch Hand
Posts: 247
Java MyEclipse IDE MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Prabhakar !
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!