---
title: "What is internal protector?"  
description: "What is internal protector?"  
author: "Om ji mishra"  
published: 2019-10-11  
updated: 2019-10-11  
canonical: https://www.mindstick.com/forum/105411/what-is-internal-protector  
category: "c#"  
tags: ["c#", "programming language"]  
reading_time: 3 minutes  

---

# What is internal protector?

What is [internal](https://www.mindstick.com/interview/773/describe-the-accessibility-modifier-protected-internal) protector?

## Replies

### Reply by Om ji mishra

protected internal is a keyword and access modifier also. We use this keyword for restricted unwanted data using out of assembly and inherit classes.

Firstly we have to know that when we use an internal access modifier that means we can use those methods the same assembly or out of the assembly and when we use protected that means we can use those methods in any other inherited class.

Now when we use both access modifiers(protected internal) then we can use those methods out of assembly and inherited class also.

Some important things about protected internal access modifier: -

- - We can use protected internal access modifier's the same assembly or out of the assembly without inherited class by creating an object of the base class.
- - We can use protected internal access modifier's the same assembly \ or out of the assembly in the derived class by creating an object of the derived class.
- - We can also use this access modifier's method by using the base \ keyword in the derived class. \ Syntax: - base.<method name>();
- We can also use this access modifier method by using this \ keyword the derived class. \ Syntax: - this.<method name>();

## Code: -(Without inherited class)

```
using System;

namespace HelloGeeksApp
{
   class profile
   {
       protected internal string name;
       public void print(string a)
        {
            string name= a;
            Console.WriteLine("\nMy name is " + name);
        }
    }

   class Program
    {
       static void Main(string[] args)
        {
            profile ac = new  profile();
            ac.name = Console.ReadLine();
            ac.print("Om Ji Mishra ");
            Console.ReadLine();
        }
    }
```

**Output: -** My name is Om Ji Mishra

## Code: - (With inherited class)

using System;

```
namespace HelloGeeksApp
{
   class profile
   {
       protected internal string name;
       public void print(string a)
        {
            string name= a;

            Console.WriteLine("\nMy name is " + name);
        }
    }
  class sau: profile
    {
       static void Main(string[] args)
        {
            sau ac = new sau();
            ac.name = Console.ReadLine();
            ac.print("Om Ji Mishra ");
            Console.ReadLine();
        }
    }
}
```

**Output: -** My name is Om Ji Mishra


---

Original Source: https://www.mindstick.com/forum/105411/what-is-internal-protector

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
