SlideShare a Scribd company logo
1 of 1
Download to read offline
Can you allow a class to be inherited, but prevent a method from being overridden in C#?
Solution
yes,I can allow a class to be inherited in the following cases
Ican expalin with th following example by writing small code
Example:
class A
{
protected virtual void show()
{
//Statements
}
}
class B : A
{
sealed protected override void shoe()
{
//Statements
}
}

More Related Content

More from wailesalekzydelore94

select an engineering articlejournal with ethical senerio and justi.pdf
select an engineering articlejournal with ethical senerio and justi.pdfselect an engineering articlejournal with ethical senerio and justi.pdf
select an engineering articlejournal with ethical senerio and justi.pdf
wailesalekzydelore94
 
In the cae below identify the subject matter of the controversy, whe.pdf
In the cae below identify the subject matter of the controversy, whe.pdfIn the cae below identify the subject matter of the controversy, whe.pdf
In the cae below identify the subject matter of the controversy, whe.pdf
wailesalekzydelore94
 
Listed below are the major steps in protein synthesis and some event.pdf
Listed below are the major steps in protein synthesis and some event.pdfListed below are the major steps in protein synthesis and some event.pdf
Listed below are the major steps in protein synthesis and some event.pdf
wailesalekzydelore94
 
1.What are 2nd messengers Give specific examples. How are they used.pdf
1.What are 2nd messengers Give specific examples. How are they used.pdf1.What are 2nd messengers Give specific examples. How are they used.pdf
1.What are 2nd messengers Give specific examples. How are they used.pdf
wailesalekzydelore94
 
Hi everyoneI need to help me in this case studyI want summary in.pdf
Hi everyoneI need to help me in this case studyI want summary in.pdfHi everyoneI need to help me in this case studyI want summary in.pdf
Hi everyoneI need to help me in this case studyI want summary in.pdf
wailesalekzydelore94
 
Explain why a gallstone located in the bile duct at a point distal t.pdf
Explain why a gallstone located in the bile duct at a point distal t.pdfExplain why a gallstone located in the bile duct at a point distal t.pdf
Explain why a gallstone located in the bile duct at a point distal t.pdf
wailesalekzydelore94
 
(Match grouping symbols) A Java program contains various pairs of gr.pdf
(Match grouping symbols) A Java program contains various pairs of gr.pdf(Match grouping symbols) A Java program contains various pairs of gr.pdf
(Match grouping symbols) A Java program contains various pairs of gr.pdf
wailesalekzydelore94
 

More from wailesalekzydelore94 (20)

The pentose phosphate cycle has an oxidative and a nonoxidative sect.pdf
The pentose phosphate cycle has an oxidative and a nonoxidative sect.pdfThe pentose phosphate cycle has an oxidative and a nonoxidative sect.pdf
The pentose phosphate cycle has an oxidative and a nonoxidative sect.pdf
 
Standpoint theory suggests that our understanding of gender-based co.pdf
Standpoint theory suggests that our understanding of gender-based co.pdfStandpoint theory suggests that our understanding of gender-based co.pdf
Standpoint theory suggests that our understanding of gender-based co.pdf
 
select an engineering articlejournal with ethical senerio and justi.pdf
select an engineering articlejournal with ethical senerio and justi.pdfselect an engineering articlejournal with ethical senerio and justi.pdf
select an engineering articlejournal with ethical senerio and justi.pdf
 
Que don 20 (1 point) C D You discover a heritable trait that is found.pdf
Que don 20 (1 point) C D You discover a heritable trait that is found.pdfQue don 20 (1 point) C D You discover a heritable trait that is found.pdf
Que don 20 (1 point) C D You discover a heritable trait that is found.pdf
 
Parthenogenesis has been documented in most vertebrate Classes (e.g. .pdf
Parthenogenesis has been documented in most vertebrate Classes (e.g. .pdfParthenogenesis has been documented in most vertebrate Classes (e.g. .pdf
Parthenogenesis has been documented in most vertebrate Classes (e.g. .pdf
 
organisms in this domain first produce oxygenSolutionThe three.pdf
organisms in this domain first produce oxygenSolutionThe three.pdforganisms in this domain first produce oxygenSolutionThe three.pdf
organisms in this domain first produce oxygenSolutionThe three.pdf
 
In the cae below identify the subject matter of the controversy, whe.pdf
In the cae below identify the subject matter of the controversy, whe.pdfIn the cae below identify the subject matter of the controversy, whe.pdf
In the cae below identify the subject matter of the controversy, whe.pdf
 
Listed below are the major steps in protein synthesis and some event.pdf
Listed below are the major steps in protein synthesis and some event.pdfListed below are the major steps in protein synthesis and some event.pdf
Listed below are the major steps in protein synthesis and some event.pdf
 
1.What are 2nd messengers Give specific examples. How are they used.pdf
1.What are 2nd messengers Give specific examples. How are they used.pdf1.What are 2nd messengers Give specific examples. How are they used.pdf
1.What are 2nd messengers Give specific examples. How are they used.pdf
 
In a Pp heterozygous organisms, one of the chromosomes carrying the .pdf
In a Pp heterozygous organisms, one of the chromosomes carrying the .pdfIn a Pp heterozygous organisms, one of the chromosomes carrying the .pdf
In a Pp heterozygous organisms, one of the chromosomes carrying the .pdf
 
How do vesicles carrying proteins destined for secretion move to the .pdf
How do vesicles carrying proteins destined for secretion move to the .pdfHow do vesicles carrying proteins destined for secretion move to the .pdf
How do vesicles carrying proteins destined for secretion move to the .pdf
 
Hi everyoneI need to help me in this case studyI want summary in.pdf
Hi everyoneI need to help me in this case studyI want summary in.pdfHi everyoneI need to help me in this case studyI want summary in.pdf
Hi everyoneI need to help me in this case studyI want summary in.pdf
 
Explain why a gallstone located in the bile duct at a point distal t.pdf
Explain why a gallstone located in the bile duct at a point distal t.pdfExplain why a gallstone located in the bile duct at a point distal t.pdf
Explain why a gallstone located in the bile duct at a point distal t.pdf
 
Family members with eye cataract are shown with a solid left half of .pdf
Family members with eye cataract are shown with a solid left half of .pdfFamily members with eye cataract are shown with a solid left half of .pdf
Family members with eye cataract are shown with a solid left half of .pdf
 
Find the dimension of the space P5 Please explain Find the dimensio.pdf
Find the dimension of the space P5 Please explain Find the dimensio.pdfFind the dimension of the space P5 Please explain Find the dimensio.pdf
Find the dimension of the space P5 Please explain Find the dimensio.pdf
 
Do routers have IP addresses If so, how many Please explain answer.pdf
Do routers have IP addresses If so, how many Please explain answer.pdfDo routers have IP addresses If so, how many Please explain answer.pdf
Do routers have IP addresses If so, how many Please explain answer.pdf
 
discuss the importance of The Age discrimination in employment act (.pdf
discuss the importance of The Age discrimination in employment act (.pdfdiscuss the importance of The Age discrimination in employment act (.pdf
discuss the importance of The Age discrimination in employment act (.pdf
 
Cocaine sometimes produces extreme alertness and an exaggerated awar.pdf
Cocaine sometimes produces extreme alertness and an exaggerated awar.pdfCocaine sometimes produces extreme alertness and an exaggerated awar.pdf
Cocaine sometimes produces extreme alertness and an exaggerated awar.pdf
 
Catalysts are molecules that lower the activation energy for a given .pdf
Catalysts are molecules that lower the activation energy for a given .pdfCatalysts are molecules that lower the activation energy for a given .pdf
Catalysts are molecules that lower the activation energy for a given .pdf
 
(Match grouping symbols) A Java program contains various pairs of gr.pdf
(Match grouping symbols) A Java program contains various pairs of gr.pdf(Match grouping symbols) A Java program contains various pairs of gr.pdf
(Match grouping symbols) A Java program contains various pairs of gr.pdf
 

Recently uploaded

Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 

Recently uploaded (20)

diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"
 
ANTI PARKISON DRUGS.pptx
ANTI         PARKISON          DRUGS.pptxANTI         PARKISON          DRUGS.pptx
ANTI PARKISON DRUGS.pptx
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
Supporting Newcomer Multilingual Learners
Supporting Newcomer  Multilingual LearnersSupporting Newcomer  Multilingual Learners
Supporting Newcomer Multilingual Learners
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 

Can you allow a class to be inherited, but prevent a method from bei.pdf

  • 1. Can you allow a class to be inherited, but prevent a method from being overridden in C#? Solution yes,I can allow a class to be inherited in the following cases Ican expalin with th following example by writing small code Example: class A { protected virtual void show() { //Statements } } class B : A { sealed protected override void shoe() { //Statements } }