Braintique.com header
Left Navigation Bar

Specifying an Interface

Let’s move on from here with our own custom interface, ICarnivore, rather than using an interface that comes out of the .NET Framework box.

To begin with, an interface is specified using the interface keyword and contains the signatures of the interface members. For example, if the ICarnivore interface containd one method, CanIEatU, the interface specification might look like this:

interface ICarnivore {
bool CanIEatU (object obj);
}

This interface specification says that there is one method, of type bool, that takes a parameter of type object. It’s worth emphasizing that the interface specification contains not a jot or iota of implementation code. It simply says: You have committd to implement me and therefore you must have a method named CanIEatU that takes an object argument and returns a bool.

Previous Table of Contents Next


Google
 
Web www.braintique.com
www.digitalfieldguide.com www.googleplexblog.com


Home | Barticles | Blogs | Books | Services | FAQ | Contact

© Braintique.com. All rights reserved.

Search Engine Optimization







RSS 2.0 Syndication feed

Syndication Viewer

Our Web host:
IX WebHosting



Food for Your Brain! Get a Barticle! Questions Answered Books for You What We Can Do For You Contact Us Brain Food Questions Answered Books for You What We Can Do For You Frequently Asked Questions About Us Google Research Photoshop Wi-Fi and Wireless Networking The Natural Way to Write