Access Specifier Examples C#

example
In this chapter you will learn:

  • How to implement access specifier in a program?
  • How to use get set modifier in C# programming?
Qu 1: Write a program to demonstrate private access specifier.
Answer

Output

Enter a number: 6

Enter second number:     8
6 + 8 = 14
__




  • Qu2: Write a program to explain get set accessor.
    Answer

    Output

    Enter number 1st:      56
    Enter number 2nd:     87Add = 143
    __

     

    Summary

    In this chapter you learned how to implement various types of access specifier and get set modifier in C# programming. In next chapter, some programming questions are given. You must do the exercises in order to improve your programming skills.


    Leave a Reply

    Your email address will not be published. Required fields are marked *