Forgot your password?
typodupeerror

Comment Re: How about Python or something? (Score 1) 245

I suppose I'm a knuckle-dragger. After reading about interfaces and seeing a few examples where I work I still don't understand how they are beneficial.

It's Java's version of a fairly common abstraction idea, that is, fixing a set of methods/functions (and what types they consume and produce) so that one person can write code that *uses* the set and another can *implement* them, *separately* [e.g. the ubiquitous "API" of something]. Sometimes, you can get this effect (in Java) from inheritance (all Animals have a size, and a way to tell if they are hungry, etc. even if the details of fish, puppies, and snakes are different) but **because Java does not allow multiple inheritance**, the interface concept can step in to help out (so maybe we want a Pet Store, that sells both Animals and pet supplies, so we create a Sellable interface with methods like price, purchase date, etc., and we can now write an inventory system without somehow shoehorning our existing inheritance hierarchies for Animals and Supplies together into some single master hierarchy....

Slashdot Top Deals

"Take that, you hostile sons-of-bitches!" -- James Coburn, in the finale of _The_President's_Analyst_

Working...