Answer:
// package
import java.util.*;
// class definition
class Main
{
// main method of the function
public static void main (String[] args) throws java.lang.Exception
{
try{
// initialize variables
char a='x',b='y',c='z';
// char variables with different Characters
// char a='#',b='$',c='%';
// char a='1',b='2',c='3';
// print all the combinations
System.out.print(""+a+b+c+" "+a+c+b+" "+b+a+c+" "+b+c+a+" "+c+a+b+" "+c+b+a);
}catch(Exception ex){
return;}
}
}
Explanation:
Declare and initialize variables a,b,c with "x","y","z" respectively.
Then with the help of print statement we can print all combinations
of these characters.Similarly we can check this for different input
characters.
Output:
xyz xzy yxz yzx zxy zyx
#$% #%$ $#% $%# %#$ %$#
123 132 213 231 312 321