Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
some one ask me in interview for c# developer for job question

But i cannot answer him .

This question is :

IF you create class and do some changes in this class and you dont need this changes

happen .

what the ways that prevent this changes happen

tell us two way to prevent changes from doing in this class .


I work in as developer c# .

can you tell me how i can answer this question if possible

What I have tried:

How to prevent changes done in class
Posted
Updated 9-Dec-16 5:38am
v2
Comments
CPallini 9-Dec-16 7:56am    
I'm pretty sure that wasn't exactly the question.
ZurdoDev 9-Dec-16 9:26am    
I agree, that question does not make much sense. Perhaps they meant how to keep someone from overriding the methods?
Nathan Minier 9-Dec-16 10:40am    
If I even remotely understand:
Declare immutable properties and methods as private OR declare the class as sealed.

1 solution

1) You use source control and rollback your changes on the file.
2) With no source control you can use undo or ctrl+z in the editor and if you haven't closed the editor.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900