SlideShare a Scribd company logo
BABA GHULAM SHAH BADSHAH UNIVERSITY (RAJOURI)
AJEELA MUSHTAQ
BABA GHULAM SHAH BADSHAH
UNIVERSITY- RAJOURI (J&K).
DEPARTMENT OF COMPUTER
SCIENCES
PRESENTATION TOPIC:-
PRESENTED BY:-
Ajeela Mushtaq Roll NO:-13-Mcs-15
PRESENTED TO:-
MR MIRZA WASEEM
INTERFACES
OUTLINE :
• INHERITANCE
• TYPES
• INTERFACES
DEFINING AN INTERFACE
EXTENDING AN INTERFACE
IMPLEMENTING INTERFACES
Inheritance
• The mechanism of deriving a new class from an old one
is called inheritance.
• The old class is referred to as the base class and the
new one is called the derived class or sub-class.
• A derived class can inherits some or all of the traits
from the base class.
Types
• Single inheritance:
A derived class with only one base class is
called single inheritance.
• Multiple inheritance:
A derived class with several base classes is
called multiple inheritance.
• Multi-level inheritance:
The mechanism of deriving a class from
another ‘derived class’.
• Hierarchical inheritance:
A derived class in which the traits of one
class may be inherited by more than one class.
• This is combination of more than one inheritance.
• Hence, it may be a combination of Multilevel and
Multiple inheritance or Hierarchical and Multilevel
inheritance or Hierarchical , Multilevel and Multiple
inheritance.
Hybrid inheritance:
INTERFACE
• An interface can contain one or more
methods,properties,indexers and events but none of
them are implemented in the interface itself.
• It is the responsibility of the class that implements the
interface to define the code for implementation of these
members.
• Syntax
interface interfacename
member declarations
EXTENDING AN INTERFACE
• Like classes, interfaces can also be extended. That is,
an interface can be subinterfaced from other interfaces.
• The new subinterface will inherit all the members of the
superinterface in the manner similar to subclasses.
interface name2 : name1
members of name2
• Interfaces are allowed to extend other interfaces,
subinterfaces cannot define the methods declared in
the superinterfaces.
• It is the responsibility of the class that implements the
derived interface to define all the methods.
• It is important to remember that an interface cannot
extend classes.
IMPLEMENTING INTERFACES
• Interfaces are used as ‘superclasses’ whose properties
are inherited by classes.
• It is therefore necessary to create a class that inherits
the given interface.
class classname : interfacename
body of classname
• Here the class classname ‘implements’ the interface
interfacename. a more general form of
implementation may look like this :
class classname : superclass, interface1,
interface2….
body of class name
This shows that a class can extend another class while
using system;
interface Addition
int Add ();
interface Multiplication
int Mul ();
Class Computation : Addition, Multiplication
int x, y;
public Computation(int x, int y) //constructor
this.x = x;
this.y = y;
Public int Add () // implement Add ()
return (x + y);
Public int Mul () // implement Mul ()
return (x * y);
Class InterfaceTest1
public Static void Main()
computation com = new computation (10,20);
Addition add = (Addition) com;
//casting
Console.WriteLine (“Sum = “ + add.Add () );
Multiplication mul = (Multiplication) com;
//casting
Console.WriteLine(“Product = “ + mul.Mul () );
Output
sum = 30
product = 200
Properties….
• All the members of an interface are implicitly public
and abstract.
• An interface cannot contain constant fields ,constructors
and destructors.
• Its members cannot be declared static.
• Since the method in an interface are abstract, they do
not include implementation code.
• An interface can inherit multiple interfaces.
Thank you…!
Have a nice day
19

More Related Content

What's hot

C# - Part 1
C# - Part 1C# - Part 1
C# - Part 1
Md. Mahedee Hasan
 
Ppt on this and super keyword
Ppt on this and super keywordPpt on this and super keyword
Ppt on this and super keyword
tanu_jaswal
 
Java Thread Synchronization
Java Thread SynchronizationJava Thread Synchronization
Java Thread Synchronization
Benj Del Mundo
 
C# Delegates
C# DelegatesC# Delegates
C# Delegates
Raghuveer Guthikonda
 
JDBC
JDBCJDBC
Oop c++class(final).ppt
Oop c++class(final).pptOop c++class(final).ppt
Oop c++class(final).ppt
Alok Kumar
 
Java interface
Java interfaceJava interface
Java interface
BHUVIJAYAVELU
 
Multiple inheritance in c++
Multiple inheritance in c++Multiple inheritance in c++
Multiple inheritance in c++
Sujan Mia
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++
rprajat007
 
Java threads
Java threadsJava threads
Java threads
Prabhakaran V M
 
Constructor in java
Constructor in javaConstructor in java
Constructor in java
Hitesh Kumar
 
C++ Language
C++ LanguageC++ Language
C++ Language
Syed Zaid Irshad
 
Abstract Class & Abstract Method in Core Java
Abstract Class & Abstract Method in Core JavaAbstract Class & Abstract Method in Core Java
Abstract Class & Abstract Method in Core Java
MOHIT AGARWAL
 
Constructor in java
Constructor in javaConstructor in java
Constructor in java
Madishetty Prathibha
 
Java 8 features
Java 8 featuresJava 8 features
Java 8 features
NexThoughts Technologies
 
Java interfaces & abstract classes
Java interfaces & abstract classesJava interfaces & abstract classes
Java interfaces & abstract classes
Shreyans Pathak
 
Inheritance in oops
Inheritance in oopsInheritance in oops
Inheritance in oops
Hirra Sultan
 
Inheritance in c++ ppt (Powerpoint) | inheritance in c++ ppt presentation | i...
Inheritance in c++ ppt (Powerpoint) | inheritance in c++ ppt presentation | i...Inheritance in c++ ppt (Powerpoint) | inheritance in c++ ppt presentation | i...
Inheritance in c++ ppt (Powerpoint) | inheritance in c++ ppt presentation | i...
cprogrammings
 
Interfaces in java
Interfaces in javaInterfaces in java
Interfaces in java
Shiv Mehmi
 
Pure virtual function and abstract class
Pure virtual function and abstract classPure virtual function and abstract class
Pure virtual function and abstract class
Amit Trivedi
 

What's hot (20)

C# - Part 1
C# - Part 1C# - Part 1
C# - Part 1
 
Ppt on this and super keyword
Ppt on this and super keywordPpt on this and super keyword
Ppt on this and super keyword
 
Java Thread Synchronization
Java Thread SynchronizationJava Thread Synchronization
Java Thread Synchronization
 
C# Delegates
C# DelegatesC# Delegates
C# Delegates
 
JDBC
JDBCJDBC
JDBC
 
Oop c++class(final).ppt
Oop c++class(final).pptOop c++class(final).ppt
Oop c++class(final).ppt
 
Java interface
Java interfaceJava interface
Java interface
 
Multiple inheritance in c++
Multiple inheritance in c++Multiple inheritance in c++
Multiple inheritance in c++
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++
 
Java threads
Java threadsJava threads
Java threads
 
Constructor in java
Constructor in javaConstructor in java
Constructor in java
 
C++ Language
C++ LanguageC++ Language
C++ Language
 
Abstract Class & Abstract Method in Core Java
Abstract Class & Abstract Method in Core JavaAbstract Class & Abstract Method in Core Java
Abstract Class & Abstract Method in Core Java
 
Constructor in java
Constructor in javaConstructor in java
Constructor in java
 
Java 8 features
Java 8 featuresJava 8 features
Java 8 features
 
Java interfaces & abstract classes
Java interfaces & abstract classesJava interfaces & abstract classes
Java interfaces & abstract classes
 
Inheritance in oops
Inheritance in oopsInheritance in oops
Inheritance in oops
 
Inheritance in c++ ppt (Powerpoint) | inheritance in c++ ppt presentation | i...
Inheritance in c++ ppt (Powerpoint) | inheritance in c++ ppt presentation | i...Inheritance in c++ ppt (Powerpoint) | inheritance in c++ ppt presentation | i...
Inheritance in c++ ppt (Powerpoint) | inheritance in c++ ppt presentation | i...
 
Interfaces in java
Interfaces in javaInterfaces in java
Interfaces in java
 
Pure virtual function and abstract class
Pure virtual function and abstract classPure virtual function and abstract class
Pure virtual function and abstract class
 

Similar to Interfaces .net

Inheritance.pptx
Inheritance.pptxInheritance.pptx
Inheritance.pptx
PRIYACHAURASIYA25
 
L7 inheritance
L7 inheritanceL7 inheritance
L7 inheritance
teach4uin
 
L7 inheritance
L7 inheritanceL7 inheritance
L7 inheritance
teach4uin
 
Java Inheritance - sub class constructors - Method overriding
Java Inheritance - sub class constructors - Method overridingJava Inheritance - sub class constructors - Method overriding
Java Inheritance - sub class constructors - Method overriding
NithyaN19
 
Java Inheritance
Java InheritanceJava Inheritance
Java Inheritance
Rosie Jane Enomar
 
Ch5 inheritance
Ch5 inheritanceCh5 inheritance
Ch5 inheritance
HarshithaAllu
 
UNIT 5.pptx
UNIT 5.pptxUNIT 5.pptx
Oops
OopsOops
OOPS Characteristics (With Examples in PHP)
OOPS Characteristics (With Examples in PHP)OOPS Characteristics (With Examples in PHP)
OOPS Characteristics (With Examples in PHP)
baabtra.com - No. 1 supplier of quality freshers
 
Unit3 part2-inheritance
Unit3 part2-inheritanceUnit3 part2-inheritance
Unit3 part2-inheritance
DevaKumari Vijay
 
Unit3 inheritance
Unit3 inheritanceUnit3 inheritance
Unit3 inheritance
Kalai Selvi
 
Inheritance
InheritanceInheritance
Inheritance
prashant prath
 
Java chapter 5
Java chapter 5Java chapter 5
Java chapter 5
Abdii Rashid
 
Inheritance & Polymorphism - 1
Inheritance & Polymorphism - 1Inheritance & Polymorphism - 1
Inheritance & Polymorphism - 1
PRN USM
 
INHERITANCE.pptx
INHERITANCE.pptxINHERITANCE.pptx
INHERITANCE.pptx
AteeqaKokab1
 
lecture 6.pdf
lecture 6.pdflecture 6.pdf
lecture 6.pdf
WaqarRaj1
 
Java - Inheritance Concepts
Java - Inheritance ConceptsJava - Inheritance Concepts
Java - Inheritance Concepts
Victer Paul
 
Inheritance ppt
Inheritance pptInheritance ppt
Inheritance ppt
Nivegeetha
 
Inheritance in C++
Inheritance in C++Inheritance in C++
Inheritance in C++
RAJ KUMAR
 
11 Inheritance.ppt
11 Inheritance.ppt11 Inheritance.ppt
11 Inheritance.ppt
LadallaRajKumar
 

Similar to Interfaces .net (20)

Inheritance.pptx
Inheritance.pptxInheritance.pptx
Inheritance.pptx
 
L7 inheritance
L7 inheritanceL7 inheritance
L7 inheritance
 
L7 inheritance
L7 inheritanceL7 inheritance
L7 inheritance
 
Java Inheritance - sub class constructors - Method overriding
Java Inheritance - sub class constructors - Method overridingJava Inheritance - sub class constructors - Method overriding
Java Inheritance - sub class constructors - Method overriding
 
Java Inheritance
Java InheritanceJava Inheritance
Java Inheritance
 
Ch5 inheritance
Ch5 inheritanceCh5 inheritance
Ch5 inheritance
 
UNIT 5.pptx
UNIT 5.pptxUNIT 5.pptx
UNIT 5.pptx
 
Oops
OopsOops
Oops
 
OOPS Characteristics (With Examples in PHP)
OOPS Characteristics (With Examples in PHP)OOPS Characteristics (With Examples in PHP)
OOPS Characteristics (With Examples in PHP)
 
Unit3 part2-inheritance
Unit3 part2-inheritanceUnit3 part2-inheritance
Unit3 part2-inheritance
 
Unit3 inheritance
Unit3 inheritanceUnit3 inheritance
Unit3 inheritance
 
Inheritance
InheritanceInheritance
Inheritance
 
Java chapter 5
Java chapter 5Java chapter 5
Java chapter 5
 
Inheritance & Polymorphism - 1
Inheritance & Polymorphism - 1Inheritance & Polymorphism - 1
Inheritance & Polymorphism - 1
 
INHERITANCE.pptx
INHERITANCE.pptxINHERITANCE.pptx
INHERITANCE.pptx
 
lecture 6.pdf
lecture 6.pdflecture 6.pdf
lecture 6.pdf
 
Java - Inheritance Concepts
Java - Inheritance ConceptsJava - Inheritance Concepts
Java - Inheritance Concepts
 
Inheritance ppt
Inheritance pptInheritance ppt
Inheritance ppt
 
Inheritance in C++
Inheritance in C++Inheritance in C++
Inheritance in C++
 
11 Inheritance.ppt
11 Inheritance.ppt11 Inheritance.ppt
11 Inheritance.ppt
 

More from ajeela mushtaq

String.ppt
String.pptString.ppt
String.ppt
ajeela mushtaq
 
Sets automata
Sets automataSets automata
Sets automata
ajeela mushtaq
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
ajeela mushtaq
 
Mail merge
Mail mergeMail merge
Mail merge
ajeela mushtaq
 
Linux hotspot
Linux hotspotLinux hotspot
Linux hotspot
ajeela mushtaq
 
Incremental
IncrementalIncremental
Incremental
ajeela mushtaq
 
Gprs
GprsGprs
Graphics a buffer
Graphics a bufferGraphics a buffer
Graphics a buffer
ajeela mushtaq
 
Disk allocation methods
Disk allocation methodsDisk allocation methods
Disk allocation methods
ajeela mushtaq
 
Data com prsntation
Data com prsntationData com prsntation
Data com prsntation
ajeela mushtaq
 
Avl tree
Avl treeAvl tree
Avl tree
ajeela mushtaq
 
Dynamic routing
Dynamic routingDynamic routing
Dynamic routing
ajeela mushtaq
 

More from ajeela mushtaq (12)

String.ppt
String.pptString.ppt
String.ppt
 
Sets automata
Sets automataSets automata
Sets automata
 
Polymorphism
PolymorphismPolymorphism
Polymorphism
 
Mail merge
Mail mergeMail merge
Mail merge
 
Linux hotspot
Linux hotspotLinux hotspot
Linux hotspot
 
Incremental
IncrementalIncremental
Incremental
 
Gprs
GprsGprs
Gprs
 
Graphics a buffer
Graphics a bufferGraphics a buffer
Graphics a buffer
 
Disk allocation methods
Disk allocation methodsDisk allocation methods
Disk allocation methods
 
Data com prsntation
Data com prsntationData com prsntation
Data com prsntation
 
Avl tree
Avl treeAvl tree
Avl tree
 
Dynamic routing
Dynamic routingDynamic routing
Dynamic routing
 

Recently uploaded

制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
ukwwuq
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
ufdana
 
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
bseovas
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
wolfsoftcompanyco
 
7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
Danica Gill
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
Paul Walk
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
eutxy
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
uehowe
 
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
CIOWomenMagazine
 
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
cuobya
 
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
cuobya
 
[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024
hackersuli
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Brad Spiegel Macon GA
 
Explore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories SecretlyExplore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories Secretly
Trending Blogers
 
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
fovkoyb
 
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
vmemo1
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
davidjhones387
 
Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
Laura Szabó
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
Toptal Tech
 

Recently uploaded (20)

制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
制作原版1:1(Monash毕业证)莫纳什大学毕业证成绩单办理假
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
 
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
 
7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
 
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
 
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
 
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
 
[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
 
Explore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories SecretlyExplore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories Secretly
 
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
 
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
 
Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
 

Interfaces .net

  • 1. BABA GHULAM SHAH BADSHAH UNIVERSITY (RAJOURI) AJEELA MUSHTAQ
  • 2. BABA GHULAM SHAH BADSHAH UNIVERSITY- RAJOURI (J&K). DEPARTMENT OF COMPUTER SCIENCES PRESENTATION TOPIC:- PRESENTED BY:- Ajeela Mushtaq Roll NO:-13-Mcs-15 PRESENTED TO:- MR MIRZA WASEEM INTERFACES
  • 3. OUTLINE : • INHERITANCE • TYPES • INTERFACES DEFINING AN INTERFACE EXTENDING AN INTERFACE IMPLEMENTING INTERFACES
  • 4. Inheritance • The mechanism of deriving a new class from an old one is called inheritance. • The old class is referred to as the base class and the new one is called the derived class or sub-class. • A derived class can inherits some or all of the traits from the base class.
  • 5. Types • Single inheritance: A derived class with only one base class is called single inheritance.
  • 6. • Multiple inheritance: A derived class with several base classes is called multiple inheritance.
  • 7. • Multi-level inheritance: The mechanism of deriving a class from another ‘derived class’.
  • 8. • Hierarchical inheritance: A derived class in which the traits of one class may be inherited by more than one class.
  • 9. • This is combination of more than one inheritance. • Hence, it may be a combination of Multilevel and Multiple inheritance or Hierarchical and Multilevel inheritance or Hierarchical , Multilevel and Multiple inheritance. Hybrid inheritance:
  • 10. INTERFACE • An interface can contain one or more methods,properties,indexers and events but none of them are implemented in the interface itself. • It is the responsibility of the class that implements the interface to define the code for implementation of these members.
  • 12. EXTENDING AN INTERFACE • Like classes, interfaces can also be extended. That is, an interface can be subinterfaced from other interfaces. • The new subinterface will inherit all the members of the superinterface in the manner similar to subclasses. interface name2 : name1 members of name2
  • 13. • Interfaces are allowed to extend other interfaces, subinterfaces cannot define the methods declared in the superinterfaces. • It is the responsibility of the class that implements the derived interface to define all the methods. • It is important to remember that an interface cannot extend classes.
  • 14. IMPLEMENTING INTERFACES • Interfaces are used as ‘superclasses’ whose properties are inherited by classes. • It is therefore necessary to create a class that inherits the given interface. class classname : interfacename body of classname
  • 15. • Here the class classname ‘implements’ the interface interfacename. a more general form of implementation may look like this : class classname : superclass, interface1, interface2…. body of class name This shows that a class can extend another class while
  • 16. using system; interface Addition int Add (); interface Multiplication int Mul (); Class Computation : Addition, Multiplication int x, y; public Computation(int x, int y) //constructor this.x = x; this.y = y; Public int Add () // implement Add () return (x + y); Public int Mul () // implement Mul () return (x * y); Class InterfaceTest1 public Static void Main() computation com = new computation (10,20); Addition add = (Addition) com; //casting Console.WriteLine (“Sum = “ + add.Add () ); Multiplication mul = (Multiplication) com; //casting Console.WriteLine(“Product = “ + mul.Mul () );
  • 18. Properties…. • All the members of an interface are implicitly public and abstract. • An interface cannot contain constant fields ,constructors and destructors. • Its members cannot be declared static. • Since the method in an interface are abstract, they do not include implementation code. • An interface can inherit multiple interfaces.
  • 19. Thank you…! Have a nice day 19