---
title: "Forward Declarations"
url: https://docs.zeroc.com/ice/3.8/slice/forward-declarations
language: csharp
docs_index: https://docs.zeroc.com/llms.txt
---

> For an index of every page, see [llms.txt](https://docs.zeroc.com/llms.txt).

# Forward Declarations

Programming language: C#. Other languages: [C++](https://docs.zeroc.com/ice/3.8/slice/forward-declarations/cpp.md), [Java](https://docs.zeroc.com/ice/3.8/slice/forward-declarations/java.md), [JavaScript](https://docs.zeroc.com/ice/3.8/slice/forward-declarations/js.md), [MATLAB](https://docs.zeroc.com/ice/3.8/slice/forward-declarations/matlab.md), [PHP](https://docs.zeroc.com/ice/3.8/slice/forward-declarations/php.md), [Python](https://docs.zeroc.com/ice/3.8/slice/forward-declarations/python.md), [Ruby](https://docs.zeroc.com/ice/3.8/slice/forward-declarations/ruby.md), [Swift](https://docs.zeroc.com/ice/3.8/slice/forward-declarations/swift.md).

[Interfaces](https://docs.zeroc.com/ice/3.8/slice/interfaces/csharp.md) and [classes](https://docs.zeroc.com/ice/3.8/slice/user-defined-types/classes/csharp.md) can be forward declared, so that you can use them before their definition. This lets you write definitions that refer to each other, for example:

```slice
module Family
{
    interface Child;            // Forward declaration

    sequence<Child*> Children;

    interface Parent
    {
        Children getChildren();
    }

    interface Child             // Definition
    {
        Parent* getMother();
        Parent* getFather();
    }
}
```

You can use a forward-declared class, or the [proxy type](https://docs.zeroc.com/ice/3.8/slice/interfaces/proxy-types.md) of a forward-declared interface, as the element type of a sequence, the value type of a dictionary, the type of a field, and the type of an operation parameter or return value.

You can extend a forward-declared class or interface only after its definition:

```slice
interface Base;                         // Forward declaration

interface Derived1 extends Base {}      // Error!

interface Base {}                       // Definition

interface Derived2 extends Base {}      // OK, definition was seen
```

## Language Mapping

A forward declaration maps to nothing.
