ADT's vs. interfaces  
Author Message
Kenneth





PostPosted: 2004-11-30 14:22:00 Top

java-programmer, ADT's vs. interfaces what is the differences between ADT's and interfaces? also what are
abstract classes? can you also include examples?

thnks
 
Chris Smith





PostPosted: 2004-11-30 11:34:00 Top

java-programmer >> ADT's vs. interfaces Kenneth <email***@***.com> wrote:
> what is the differences between ADT's and interfaces? also what are
> abstract classes? can you also include examples?

ADTs are a theoretical concept used in describing data structures.
Interfaces are part of the Java programming language, and are suitable
(among many other purposes) for describing an ADT.

You seem to not be very familiar with Java. It would be worth your time
to check out http://java.sun.com/docs/books/tutorial/index.html

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
Kenneth





PostPosted: 2004-11-30 15:55:00 Top

java-programmer >> ADT's vs. interfaces Chris Smith wrote:
> Kenneth <email***@***.com> wrote:
>
>>what is the differences between ADT's and interfaces? also what are
>>abstract classes? can you also include examples?
>
>
> ADTs are a theoretical concept used in describing data structures.
> Interfaces are part of the Java programming language, and are suitable
> (among many other purposes) for describing an ADT.
>
> You seem to not be very familiar with Java. It would be worth your time
> to check out http://java.sun.com/docs/books/tutorial/index.html
>


you're right, i am not familiar with java. I am getting the hang of it
though. the link you gave me does not seem to have what interfaces or
ADT's are. do you have any other links?
 
 
Andrew Thompson





PostPosted: 2004-11-30 19:46:00 Top

java-programmer >> ADT's vs. interfaces On Mon, 29 Nov 2004 23:55:19 -0800, Kenneth wrote:

> Chris Smith wrote:
>> Kenneth <email***@***.com> wrote:
>>
>>>what is the differences between ADT's and interfaces? also what are
>>>abstract classes? can you also include examples?

(snip explanation)
>> You seem to not be very familiar with Java. It would be worth your time
>> to check out http://java.sun.com/docs/books/tutorial/index.html
>
> you're right, i am not familiar with java. I am getting the hang of it
> though. the link you gave me does not seem to have what interfaces or
> ADT's are. do you have any other links?

Try <http://www.google.com/search?hl=en&q=adt+interface+tutorial>

[ See my response of a few minutes ago. ]

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
 
 
Chris Smith





PostPosted: 2004-12-1 0:02:00 Top

java-programmer >> ADT's vs. interfaces Kenneth <email***@***.com> wrote:
> > You seem to not be very familiar with Java. It would be worth your time
> > to check out http://java.sun.com/docs/books/tutorial/index.html
>
> you're right, i am not familiar with java. I am getting the hang of it
> though. the link you gave me does not seem to have what interfaces or
> ADT's are. do you have any other links?

Yes, it does contain information about interfaces, as well as plenty of
other basic language topics you may encounter. I'm not trying to be
difficult here; it is just not possible for this newsgroup to rewrite
the entirety of a good introduction to Java. You're better off using
the existing material, and the link above is a good introduction.

If you're really anxious, interfaces are discussed under "Learning the
Java Language" in the "Trails Covering the Basics" section. However,
it's obvious that you could benefit from reading the rest of the
tutorial as well.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
 
Kenneth





PostPosted: 2004-12-1 7:56:00 Top

java-programmer >> ADT's vs. interfaces Chris Smith wrote:
> Kenneth <email***@***.com> wrote:
>
>>>You seem to not be very familiar with Java. It would be worth your time
>>>to check out http://java.sun.com/docs/books/tutorial/index.html
>>
>>you're right, i am not familiar with java. I am getting the hang of it
>>though. the link you gave me does not seem to have what interfaces or
>>ADT's are. do you have any other links?
>
>
> Yes, it does contain information about interfaces, as well as plenty of
> other basic language topics you may encounter. I'm not trying to be
> difficult here; it is just not possible for this newsgroup to rewrite
> the entirety of a good introduction to Java. You're better off using
> the existing material, and the link above is a good introduction.
>
> If you're really anxious, interfaces are discussed under "Learning the
> Java Language" in the "Trails Covering the Basics" section. However,
> it's obvious that you could benefit from reading the rest of the
> tutorial as well.
>


chris, i just wanted a couple sentences(jist) of how ADT and interfaces
are related.


andrew, thnks for the tutorial link. i am reading it right now and i
think this will be sufficient.

thnks.
 
 
Starshine Moonbeam





PostPosted: 2004-12-3 12:31:00 Top

java-programmer >> ADT's vs. interfaces In article <cogp1v$cku$email***@***.com>, Kenneth
(email***@***.com) dropped a +5 bundle of words...

> what is the differences between ADT's and interfaces? also what are
> abstract classes? can you also include examples?

An abstract class is a class who's only purpose is to be extended.

Public abstract class Book {

}

Public class Fiction extends Book {

}

You can't instantiate an abstract class and if any method is abstract,
the class must be abstract. Unlike an interface however, you can have a
mixture of abstract methods and concrete methods and your variables
don't have to be static final.

With an interface, it's a little different. In java, there is no
multiple inheritance. Classes can use interfaces which have abstract
methods which must be made concrete by all the classes that implement
it. That way you can pass more general variables/methods to more
specific classes that use them.

It's a little light on details I guess but that's the gist of it. If
anyone can add more, feel free.



--
Starshine Moonbeam
mhm31x9 Smeeter#29 WSD#30
sTaRShInE_mOOnBeAm aT HoTmAil dOt CoM









 
 
Starshine Moonbeam





PostPosted: 2004-12-3 14:25:00 Top

java-programmer >> ADT's vs. interfaces In article <email***@***.com>, Starshine Moonbeam
(email***@***.com) dropped a +5 bundle of words...

> In article <cogp1v$cku$email***@***.com>, Kenneth
> (email***@***.com) dropped a +5 bundle of words...
>
> > what is the differences between ADT's and interfaces? also what are
> > abstract classes? can you also include examples?
>
> An abstract class is a class who's only purpose is to be extended.
>
> Public abstract class Book {
>
> }
>
> Public class Fiction extends Book {
>
> }
>
> You can't instantiate an abstract class and if any method is abstract,
> the class must be abstract. Unlike an interface however, you can have a
> mixture of abstract methods and concrete methods and your variables
> don't have to be static final.
>
> With an interface, it's a little different. In java, there is no
> multiple inheritance. Classes can use interfaces which have abstract
> methods which must be made concrete by all the classes that implement
> it. That way you can pass more general variables/methods to more
> specific classes that use them.
>
> It's a little light on details I guess but that's the gist of it. If
> anyone can add more, feel free.

Oh before I forget, you can't use extends from an interface. You have to
use implements.

public class BigBooks implements Books {

}



--
Starshine Moonbeam
mhm31x9 Smeeter#29 WSD#30
sTaRShInE_mOOnBeAm aT HoTmAil dOt CoM









 
 
Xavier Tarrago





PostPosted: 2004-12-3 16:36:00 Top

java-programmer >> ADT's vs. interfaces ADT & interface are not on the same level.

Abstract Data Type is an extension of a base type. It is a concrete class
that is designed to store coumpounds data for instance a signal, a complex,
a point... It's opposite is an object that have an identity. Two ADT are
equals if their content is equal.

An interface is a technical feature in java to describe an abstract entity.
Two abstract entities are equal if their references are equal (ie if it is
the same object)

"Starshine Moonbeam" <email***@***.com> a 閏rit dans le message de
news:email***@***.com...
> In article <cogp1v$cku$email***@***.com>, Kenneth
> (email***@***.com) dropped a +5 bundle of words...
>
> > what is the differences between ADT's and interfaces? also what are
> > abstract classes? can you also include examples?
>
> An abstract class is a class who's only purpose is to be extended.
>
> Public abstract class Book {
>
> }
>
> Public class Fiction extends Book {
>
> }
>
> You can't instantiate an abstract class and if any method is abstract,
> the class must be abstract. Unlike an interface however, you can have a
> mixture of abstract methods and concrete methods and your variables
> don't have to be static final.
>
> With an interface, it's a little different. In java, there is no
> multiple inheritance. Classes can use interfaces which have abstract
> methods which must be made concrete by all the classes that implement
> it. That way you can pass more general variables/methods to more
> specific classes that use them.
>
> It's a little light on details I guess but that's the gist of it. If
> anyone can add more, feel free.
>
>
>
> --
> Starshine Moonbeam
> mhm31x9 Smeeter#29 WSD#30
> sTaRShInE_mOOnBeAm aT HoTmAil dOt CoM
>
>
>
>
>
>
>
>
>


 
 
Kenneth





PostPosted: 2004-12-8 7:31:00 Top

java-programmer >> ADT's vs. interfaces Starshine Moonbeam wrote:
> In article <email***@***.com>, Starshine Moonbeam
> (email***@***.com) dropped a +5 bundle of words...
>
>
>>In article <cogp1v$cku$email***@***.com>, Kenneth
>>(email***@***.com) dropped a +5 bundle of words...
>>
>>
>>>what is the differences between ADT's and interfaces? also what are
>>>abstract classes? can you also include examples?
>>
>>An abstract class is a class who's only purpose is to be extended.
>>
>>Public abstract class Book {
>>
>>}
>>
>>Public class Fiction extends Book {
>>
>>}
>>
>>You can't instantiate an abstract class and if any method is abstract,
>>the class must be abstract. Unlike an interface however, you can have a
>>mixture of abstract methods and concrete methods and your variables
>>don't have to be static final.
>>
>>With an interface, it's a little different. In java, there is no
>>multiple inheritance. Classes can use interfaces which have abstract
>>methods which must be made concrete by all the classes that implement
>>it. That way you can pass more general variables/methods to more
>>specific classes that use them.
>>
>>It's a little light on details I guess but that's the gist of it. If
>>anyone can add more, feel free.
>
>
> Oh before I forget, you can't use extends from an interface. You have to
> use implements.
>
> public class BigBooks implements Books {
>
> }
>
>
>


you explained it clearly. i have a much better understanding now.

i'm glad there are people like you in this newsgroup.

thanks.
 
 
Tony Morris





PostPosted: 2004-12-11 9:20:00 Top

java-programmer >> ADT's vs. interfaces > Oh before I forget, you can't use extends from an interface. You have to
> use implements.

Not quite true.
interface X extends Y{} // perfectly valid.

It is an unfortunate thing that students are taught that inheritance is
typically from concrete types.
Well designed software typically inherits only from pure virtual types (i.e.
interfaces).
"That is, inheritance from concrete types is evil." (recommended google
search criteria)

In fact, I often write software where I enforce the following rules:
- All classes are declared final.
- All constructors are private.
- All references are of an interface type.

Google for "design by contract" for more information.

--
Tony Morris
http://xdweb.net/~dibblego/



 
 
Frances Del Rio





PostPosted: 2004-12-12 8:12:00 Top

java-programmer >> ADT's vs. interfaces

Tony Morris wrote:
>>Oh before I forget, you can't use extends from an interface. You have to
>>use implements.
>
>
> Not quite true.
> interface X extends Y{} // perfectly valid.

pls, what is the difference between extending and implementing? Can
only concrete classes be extended? could you implement a class instead
of extending it? or is 'implement' only for interfaces? I get confused
betw. abstract classes and interfaces, I find the distinction betw. them
a bit subtle.. an abstract class cannot be instantiated, but it can be
subclassed.. (right or wrong?) an interface cannot be instantiated
either (can it be subclassed)? a FINAL class cannot be subclassed (I
suppose this means it can't be instantiated either..) is all this right??

an instance var's scope is only within object..
a class variable if you change it on one object it changes for all other
instances of the same class from which our object has been
instantiated.. if not specif'd 'static' in decl. it's an instance var by
default (same with methods..) right or wrong?

you can inherit from only one class but from more than one interface,
right? if you implment an interface, it says in my SAMS 'Java 2', 'you
then have to implement all the methods in that interface' (this means
what, exactly? call them? overwrite them? all of them? even the ones
you don't use?) ok, I've been studying last night and today and have
been 'sorting out' my notes, and want to know I got right the most
essential things at least... thank you and everyone else who has
helped me in this ng... :) Frances