[5870] in java-interest

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

Re: keyword to introduce a method?

daemon@ATHENA.MIT.EDU (Francois BOUSSARD)
Fri Mar 1 10:40:58 1996

From: Francois BOUSSARD <fboussar@coplanet.fr>
Date: Fri, 1 Mar 1996 15:08:17 +0100
To: java-interest@java.sun.com


> >
> >Not true!!  In java, all methods are virtual.  Thus, if you call foo() on
			^^^^^^^^^^^^^^^^^^^^^^^

	I'm very surprised of this fact ! :
	I had 2 classes : 

		Master_A, 
		   |
   	   Derived_From_A. 

	each whith a method paint(Graphics)
		   +
	And a third one using Master_A pointers to unknown real-type objects. 

The good paint() was called for instances of  Derived_From_A ONLY after i 
created an INTERFACE Interface_Master_A wich declare 'abstract paint(..' and 
from which Master_A inherit !

	So the real-running good schems was :

	INTERFACE Interface_Master_A 
		abstract method()
		|
	CLASS Master_A implements Interface_Master_A
		method(){algo for Master_A}}
		|
	CLASS Derived_From_Master_A inherit Master_A
		method(){algo for Derived_From_Master_A}


	The big problem of this fact is that for using virtual functions, I have
to create Interfaces which declares abstract methods. Each new classes whith
new virtual functions have to implement a new Interface declaring those new 
abstract methods...
	
	After 5 level of abstraction and derivation, it begins to be very 
painfull.

	So. Did I missed something somewhere in the Java Syntax ???


Francois.
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

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