js转java代码 java转换js代码( 二 )


{
return;
}
if (start == 0)
{
indexs = new int[array.length];
}
for ( indexs = ind; indexsarray.length; indexs++ )
{
recursionSub (list, count, array, indexs + 1, start, indexs);
if (start == count - 1)
{
int[] temp = new int[count];
for ( int i = count - 1; i = 0; i-- )
{
temp[start - i] = array[indexs[start - i]];
}
list.add (temp);
}
}
}
public static void main ( String[] args )
{
int[] array = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
LinkedListint[] list = new LinkedListint[] ();
recursionSub (list, 3, array, 0, -1);
for ( int[] strings : list )
{
System.out.println (Arrays.toString (strings));
}
}
}
js组合算法代码转成java代码不必转换js转java代码,js转java代码我早已熟透组合排列算法js转java代码:java如下
import java.util.Arrays;
import java.util.LinkedList;
public class Guy
{
public static void recursionSub ( LinkedListint[] list, int count, int[] array, int ind, int start, int... indexs )
{
start++;
if (startcount - 1)
{
return;
}
if (start == 0)
{
indexs = new int[array.length];
}
for ( indexs = ind; indexsarray.length; indexs++ )
{
recursionSub (list, count, array, indexs + 1, start, indexs);
if (start == count - 1)
{
int[] temp = new int[count];
for ( int i = count - 1; i = 0; i-- )
{
temp[start - i] = array[indexs[start - i]];
}
list.add (temp);
}
}
}
public static void main ( String[] args )
{
int[] array = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
LinkedListint[] list = new LinkedListint[] ();
recursionSub (list, 3, array, 0, -1);
for ( int[] strings : list )
{
System.out.println (Arrays.toString (strings));
}
}
}
如何将这些JS代码转换成JAVA代码javascript 和java都不是一个道理的,不是说转换就可以的,为什么很多人喜欢跨语言转换代码,你们为什么不能这样问呢:如何用java来实现某种功能,岂不是更好?
js转java代码的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于java转换js代码、js转java代码的信息别忘了在本站进行查找喔 。

推荐阅读