[1912] in java-interest

home help back first fref pref prev next nref lref last post

Re: interfaces?

daemon@ATHENA.MIT.EDU (Philip Brown)
Tue Sep 19 21:06:02 1995

To: java-interest@java.sun.com
Date: Tue, 19 Sep 1995 15:03:20 -0700 (PDT)
In-Reply-To: <9509191659.AA29440@cfdev1.lehman.com> from "Frank Greco" at Sep 19, 95 12:59:58 pm
From: phil@bolthole.com (Philip Brown)

> 
> 
> Can someone give me a decent explanation of what an "interface" (wrt
> java of course) is?  I cannot grok what the docs are trying to say.  Is
> it basically a class-ish way of organizing abstract methods?

yes.


In other words, using the C++ paradigm, you could have

class test{
  private:
        this_isnt_so_private();
   public:
	write(int);
	int read();
}


Or, using the java paradigm, you could have

class test implements writeread
{
	/* truely hidden stuff */
}


Interface writeread
{
	write(int);
	int read();
}


NOTE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I did this off the top of my head. the java syntax is probably not correct.

Forget about multiple inheritance. The real beauty of this, is that
unlike C++, you no longer have to distribute a .h file, that contains
more information about the class than you would like to share.
Plus, you can interface to potentially ANY object, not just an object which
happens to be a subclass of "X".
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post