Beanshell is a java scripting language which is included in Jmeter.

${Variable Name} can be used to create parameter inside a sampler, by replace a string with parameter name. (Please see jMeter Document for reference)

To create an Incremental Number (String), you have to create the following items in the same hierarchy.

1. User Defined Variable ( count = 1)

1.2. Loop controller (Sampler -> ${count})

1.3. BeanShell PostProcessor (Put the following code in side the Script)

This is an example of how to create an Incremental number (String) which is a kind of the same way you have done in Java.

String s= vars.get("count");
int i = Integer.parseInt(s);
i++;
print(i+"");
vars.put("count",i.toString());

That is, it’s not very hard to create a script with BeanShell, but it’s not that easy without an auto-complete tools.