# Parameters tab

![Parameters tab](/files/gharEXaBvNlsAIqRb9tj)

You can use the **Parameters** table to avoid using hard-coded string values, such as field names (customer for example).

Another example is in the `User Defined Java Class - Calculate the date of Easter.ktr` sample transformation, which is in the `data-integration/samples/transformations` directory. That sample KTR has a parameter called **YEAR**. The **YEAR** parameter is referenced with the `getParameter()method`, as shown in the following example:

```
getParameter("YEAR")
```

At runtime, it will return the year String value.

## Class Member Variables and the getVariable Function

When getting parameters that point to transformation parameters, the User Defined Java Class step behaves differently depending on when the `getVariable` function is called. If it is in the `init()` method, the parameters behave as expected. If the initialization is on a class member variable, the variable is not resolved by design, as shown in the following example:

```java
private final String par = getVariable("somePar"); // DOES NOT resolve correctly
private String par2 = null;
 
public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException {
   logBasic("Parameter value="+par+"\[MEMBER INIT\]");
   logBasic("Parameter value="+par2+"\[INIT FUNCTION\]");
   setOutputDone();
   return false;
}
 
public boolean init(StepMetaInterface stepMetaInterface, StepDataInterface stepDataInterface) {
   par2 = getVariable("somePar"); // WORKS FINE
   return parent.initImpl(stepMetaInterface, stepDataInterface);
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pentaho.com/pdia-data-integration/10.2-data-integration/pdi-transformation-steps-reference-overview/user-defined-java-class/options-user-defined-java-class/parameters-tab.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
