0

How to write possible strings formed by using the characters 'c', 'a', 't', 'd', 'o', and 'g' exactly once.

I'm new to this, please help me 😞

7th Feb 2021, 6:28 AM
Airose P. Abel
Airose P. Abel - avatar
3 odpowiedzi
+ 2
Airose P. Abel Make a character array and using new String (char[] a) convert it into string like this char[] arr = {'a', 'b', 'c'}; String str = new String (arr); System.out.println(str);
7th Feb 2021, 6:35 AM
A͢J
A͢J - avatar
0
Looks like you want to generate the permutations https://en.wikipedia.org/wiki/Permutation This tutorial explains implementation in java https://www.baeldung.com/java-array-permutations
7th Feb 2021, 9:18 AM
Benjamin Jürgens
Benjamin Jürgens - avatar
0
You can also use toString(char) method
7th Feb 2021, 8:22 PM
Sattar
Sattar - avatar