
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the difference between an interface and a class in C#?
An interface is a class without fields or method implementation. It cannot implement the methods it defines.
A class generally implements the methods defined in an interface.
Interface
Interfaces define properties, methods, and events, which are the members of the interface. Interfaces contain only the declaration of the members. It is the responsibility of the deriving class to define the members.
public interface interface_name { // interface_members }
Class
Class is a blueprint for a data type. This does not actually define any data, but it does define what the class name means. That is, what an object of the class consists of and what operations can be performed on that object.
class class_name { // class_members }
- Related Questions & Answers
- What is the difference between an interface and an abstract class in C#?
- What is the difference between a class and an object in C#?
- Difference between Abstract Class and Interface in C#
- Difference between abstract class and interface
- Difference between Abstract Class and Interface in C# Program
- Difference Between Class and Interface in Java
- What are the differences between a class and an interface in Java?
- Difference Between Interface and Abstract Class in Java & C#
- Difference between Abstract Class and Interface in Java
- Difference Between Thread Class and Runnable Interface in Java
- What is the difference between Enumeration interface and enum in Java?
- What is the difference between abstract class and a concrete class in Java?
- What is the difference between Static class and Singleton instance in C#?
- What is the difference between a list and an array in C#?
- What is the difference between an int and a long in C++?
Advertisements