• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

interface as pointer

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi.
this is first time.i hope i will got a perfect answer.
myself preparing java from just JAVA. i have got problem in that
in interface topic there is one line that i don't understand.
"Interface is just like pointer to function in 'c' "
please help
wating for you reply.

 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have any c background?? If not you will probably not understand the reference to how something works in c.
 
vishwas bhatt
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks cindy for your replay.
i have got good c and c++ background. i understand the topin "pointer to function" very well . but i can't match this with interface in java.
please help me.
wating of you replay.
 
Cindy Glass
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you have a class that has an interface, and you are familiar with the methods of that interface, then you know that the new class will have all of those methods.
Implementing the interface "flags" or "points out" to the world that the methods (functions) are available.
 
vishwas bhatt
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
cindy can you explain me this by giving any example.
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Consider this example. We define one interface which is implemented by two classes. Another class may be passed any class which implements the interface, and calls the method defined in the interface. Which implementing class to create and pass in is not known until run-time (chosen by a command-line argument).

I hope this helps.
 
vishwas bhatt
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
frank ,
i realy got it...!!! what i want . thank's a lot . thanks.
i got one more problem regarding java I/O . I want some tutorial
for I/O which can teach me i/O on very elementary level (low -level). i am aware about whole hirarchy . but i want more . help
me.
hoping for same response ( thank's again)
 
Cindy Glass
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check the File Access Chapter of this tutorial.
http://developer.java.sun.com/developer/onlineTraining/Programming/BasicJava1/
 
vishwas bhatt
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks cindy.
this will help me lot thank's a lot.
 
I think she's lovely. It's this tiny ad that called her crazy:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic