wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes interface as pointer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "interface as pointer" Watch "interface as pointer" New topic
Author

interface as pointer

vishwas bhatt
Ranch Hand

Joined: Nov 30, 2000
Posts: 129
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.

Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Do you have any c background?? If not you will probably not understand the reference to how something works in c.


"JavaRanch, where the deer and the Certified play" - David O'Meara
vishwas bhatt
Ranch Hand

Joined: Nov 30, 2000
Posts: 129
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"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
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

Joined: Nov 30, 2000
Posts: 129
cindy can you explain me this by giving any example.
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
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.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
vishwas bhatt
Ranch Hand

Joined: Nov 30, 2000
Posts: 129
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"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Check the File Access Chapter of this tutorial.
http://developer.java.sun.com/developer/onlineTraining/Programming/BasicJava1/
vishwas bhatt
Ranch Hand

Joined: Nov 30, 2000
Posts: 129
Thanks cindy.
this will help me lot thank's a lot.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: interface as pointer
 
Similar Threads
Question on Integer type
Fail to create generic array?
Tag Lig Question
Initialization of local object references variables
JNI - static variables vs. instance variables