import
java.util.Properties;
import
javax.naming.CompoundName;
import
javax.naming.InvalidNameException;
public
class
GFG {
public
static
void
main(String[] args)
throws
InvalidNameException
{
Properties props =
new
Properties();
props.put(
"jndi.syntax.separator"
,
":"
);
props.put(
"jndi.syntax.direction"
,
"left_to_right"
);
CompoundName CompoundName1
=
new
CompoundName(
"a:b:z:y:x"
, props);
String pos1 = CompoundName1.get(
0
);
String pos2 = CompoundName1.get(
1
);
System.out.println(pos1);
System.out.println(pos2);
}
}