---
title: "Substitute"
description: "When used to annotate a method, it indicates that a method declaration is intended to be a substitute for a method declaration in another class."
kind: "annotation interface"
id: "com.oracle.svm.core.annotate.Substitute"
module: "nativeimage"
version: "25.6.0-elide.4"
canonical: "https://graalvm.elide.help/25.6.0-elide.4/api/nativeimage/com/oracle/svm/core/annotate/Substitute.html"
---

# @ Substitute

[nativeimage](../../../../../index.md) › [com.oracle.svm.core.annotate](index.md) · Every page: [llms.txt](../../../../../llms.txt)

Annotation interface in [`com.oracle.svm.core.annotate`](index.md). Since 22.3.

```java
@Retention(RUNTIME)
@Target({METHOD, CONSTRUCTOR, TYPE, FIELD})
public @interface Substitute
```

When used to annotate a method, it indicates that a method declaration is intended to be a substitute for a method declaration in another class. A substitute method must be declared in a class annotated with [`TargetClass`](TargetClass.md) as the [`value`](TargetClass.md#value%28%29) element of that annotation specifies the class containing the method to be substituted (the *substitutee* class).

The method to be substituted is determined based on a name and a list of parameter types. The name is specified by an optional [`TargetElement.name()`](TargetElement.md#name%28%29) element of this annotation. If this element is not specified, then the name of the substitution method is used. The parameter types are those of the substitution method.

There must never be an explicit call to a non-static method annotated with [`Substitute`](Substitute.md) unless it is from another non-static method in the same class.

When used to annotate a class, it indicates that the class is intended to be a full substitute for the class specified via [`TargetClass`](TargetClass.md). All methods in the target class that are not substituted in the annotated class are implicitly treated as [`Delete`](Delete.md)d.

See [`TargetClass`](TargetClass.md) for an overview of the annotation system.

## Elements

### polymorphicSignature()
<a id="polymorphicSignature()"></a>`boolean polymorphicSignature() default false`. Since 22.3. Default: `false`. Cite: `com/oracle/svm/core/annotate/Substitute.html#polymorphicSignature()`
