First Java program (writing permutations to a file)

I'm trying to write combinations with repetitions to a text file, the problems is I'm trying to hack together some code without knowing the inner workings of java. I'm not really sure what I'm effecting when I'm rearranging the code. import java.io.*; public class Main { public static void main(String args[]) { brute("123", 3, new StringBuffer()); } static void brute(String input, int depth, StringBuffer output) { if (depth == 0) { // System.out.println(output); { try{ // Create file FileWriter fstream = new FileWriter("out.txt",true); BufferedWriter out = new BufferedWriter(fstream); out.write("blah" + output);} else { for (int i = 0; i

以上就是First Java program (writing permutations to a file)的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏