5/13/2020 Online Java Compiler - Online Java Editor - Java Code Online
Sponsored: The Ruby Blend Podcast 🎧 Episode #11 "Open Source Funding" Listen
Online Java Compiler IDE
For Multiple Files, Custom Library and File Read/Write, use our new - Advanced Java IDE
Project Name: PER1
1 import java.util.*;
2 class permutations{
3
4 void permute(String str, int l, int r){
5 if (l==r){
6 System.out.println(str);
7 }
8 else{
9 for(int i=0;i<=r;i++){
10 str=swap(str,l,i);
11 permute(str,l+1,r);
12 str=swap(str,l,i);
13 }
14 }
15 }
16 String swap(String a, int m, int n){
17 char c[]=a.toCharArray();
18 char temp=c[n];
19 c[n]=c[m];
20 c[m]=temp;
21 return (String.valueOf(c));
22 }
23
24
25 }
26
27
28 public class MyClass {
29
30 public static void main(String args[]) {
31 Scanner sc=new Scanner(System.in);
32 String s=sc.nextLine();int l=s.length();
33 permutations p1=new permutations();
34 p1.permute(s,0,l-1);
35
36 }
37 }
Execute Mode, Version, Inputs & Arguments
CommandLine Arguments
Stdin Inputs
Result
https://www.jdoodle.com/online-java-compiler/ 1/2
5/13/2020 Online Java Compiler - Online Java Editor - Java Code Online
Thanks for using our
Online Java Compiler IDE
to execute your program
Know Your JDoodle JDoodle For Your Organisation
JDoodle Supports 72 Languages and Do you have any specific compiler
2 DBs. Click here to see all. requirements?
Fullscreen - side-by-side code and Do you want to integrate compilers
output is available. click the " " icon near with your website, webapp, mobile app,
execute button to switch. courses?
Dark Theme available. Click on " " Do you need more than our Embed
icon near execute button and select dark and API features?
theme.
Looking for Multiple Files,
You can embed code from JDoodle Connecting to DB, Debugging, etc.?
directly into your website/blog. Click here
Are you building any innovative
to know more.
solution for your students or recruitment?
JDoodle offers an API service. You
Want to run JDoodle in-house?
can execute programs just by calling our
API. Click here to know more. Custom Domain, White labelled
pages for your institute?
If you like JDoodle, Please share us in
Social Media. Click here to share. Contact us - We are happy to help!
Check our Documentation Page for
more info.
JDoodle is serving the programming
community since 2013
https://www.jdoodle.com/online-java-compiler/ 2/2