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 Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. String str="this is Rayani";
  13. String s;
  14. int count=0;
  15. for(i=0;i<str.length;i++)
  16. {
  17. if(str[i]!=" " && str[i+1]!=" ")
  18. {
  19. s=s.concat(str[i]);
  20. if(str[i]='t')
  21. count++;
  22. }
  23. else
  24. {
  25. System.out.println(s-count);
  26. s=" ";
  27. count=0;
  28. }
  29. }
  30. }
  31. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:15: error: cannot find symbol
        for(i=0;i<str.length;i++)
            ^
  symbol:   variable i
  location: class Ideone
Main.java:15: error: cannot find symbol
        for(i=0;i<str.length;i++)
                ^
  symbol:   variable i
  location: class Ideone
Main.java:15: error: cannot find symbol
        for(i=0;i<str.length;i++)
                     ^
  symbol:   variable length
  location: variable str of type String
Main.java:15: error: cannot find symbol
        for(i=0;i<str.length;i++)
                             ^
  symbol:   variable i
  location: class Ideone
Main.java:17: error: cannot find symbol
         if(str[i]!=" " && str[i+1]!=" ")
                ^
  symbol:   variable i
  location: class Ideone
Main.java:17: error: array required, but String found
         if(str[i]!=" " && str[i+1]!=" ")
               ^
Main.java:17: error: cannot find symbol
         if(str[i]!=" " && str[i+1]!=" ")
                               ^
  symbol:   variable i
  location: class Ideone
Main.java:17: error: array required, but String found
         if(str[i]!=" " && str[i+1]!=" ")
                              ^
Main.java:19: error: cannot find symbol
          s=s.concat(str[i]);
                         ^
  symbol:   variable i
  location: class Ideone
Main.java:19: error: array required, but String found
          s=s.concat(str[i]);
                        ^
Main.java:20: error: cannot find symbol
          if(str[i]='t')
                 ^
  symbol:   variable i
  location: class Ideone
Main.java:20: error: array required, but String found
          if(str[i]='t')
                ^
Main.java:25: error: bad operand types for binary operator '-'
          System.out.println(s-count);
                              ^
  first type:  String
  second type: int
13 errors
stdout
Standard output is empty