# Generating Java code with the AI assistant

[Preview](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Introduction/feature-preview-program-overview.htm)

Use a prompt to generate Java code in supported code-editing contexts in Talend Studio.

## About this task

The AI assistant can generate Java code in Java components, in the cProcessor component, and in repository code sections. You can also use this assistance in Routines and Beans editors.

## Procedure

1. Open a supported Java code-editing context.
2. Open ![AI assistant](https://help.qlik.com/talend/en-US/studio-user-guide/Resources/images/qlik_answers.svg)AI assistant, and enter a prompt that describes the Java code you need. For example: Generate a routine to return a SOUNDEX value for a String.
3. Review the generated code and adapt it to your Job, Route, Routine, or Bean.
4. Click Accept to apply the proposed changes.

   ![Example of Java code proposed by the AI assistant in a Route.](https://help.qlik.com/talend/en-US/studio-user-guide/Resources/images/qlik-answers-java-code.png)

## Results

The code-editing context contains Java code proposed by the AI assistant.