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

interfaces

 
daya daya
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friends,
i am beginner in java.
i have some doubts regarding interfaces.guide me please.
can we create objects for interfaces?how?
can we specify an interface as a return type in method?how?
dayadaya.
 
daya daya
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
list is an interface.
i saw a method like public list something()
how is it possible?
i am very much confused
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can we create objects for interfaces?


No, you can't instantiate (creating objects) an interface.

can we specify an interface as a return type in method?how?


Yes, like this way:

 
daya daya
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks rathi
i got it
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic