fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Check
  9. {
  10. boolean isPermutation(String x,String y)
  11. {
  12. int q=x.toCharArray().length;
  13. int w=y.toCharArray().length;
  14. if(q==w)
  15. {
  16. for(int i=0;i<w;i++)
  17. {
  18. char r=x.charAt(i);
  19. for(int j=0;j<w;j++)
  20. {
  21. char s=y.charAt(j);
  22. if(r==s)
  23. break;
  24.  
  25. }
  26. if(j==w)
  27. return 0;
  28. }
  29. return 1;
  30. }
  31.  
  32. }
  33. }
  34. class Permutation
  35. {
  36. public static void main (String[] args)
  37. {
  38. {
  39. Check c=new Check();
  40. boolean o=c.isPermutation("abc","bca");
  41. system.out.println("For the given two strings, the condition of permutation is"+o);
  42. }
  43. }
  44. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:26: error: cannot find symbol
			if(j==w)
			   ^
  symbol:   variable j
  location: class Check
Main.java:27: error: incompatible types
			return 0;
			       ^
  required: boolean
  found:    int
Main.java:29: error: incompatible types
		return 1;	
		       ^
  required: boolean
  found:    int
Main.java:41: error: package system does not exist
		system.out.println("For the given two strings, the condition of permutation is"+o);
		      ^
4 errors
stdout
Standard output is empty