fork download
  1. class Ideone
  2. {
  3. public static void main (String[] args)
  4. {
  5. long blanks, tabs, newlines = 0L;
  6. int c;
  7. try {
  8. while ((c = System.in.read()) != -1) {
  9. if (c == ' ') {
  10. blanks++;
  11. } else if (c == '\t') {
  12. tabs++;
  13. } else if (c == '\n') {
  14. newlines++;
  15. }
  16. }
  17. System.out.printf("Blanks: %d, tabs: %d, newlines: %d.\n",
  18. blanks, tabs, newlines);
  19. } catch (java.io.IOException ex) {
  20. System.err.printf("IOException: %s\n", ex.getMessage());
  21. }
  22. }
  23. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:10: error: variable blanks might not have been initialized
					blanks++;
					^
Main.java:12: error: variable tabs might not have been initialized
					tabs++;
					^
Main.java:18: error: variable blanks might not have been initialized
				blanks, tabs, newlines);
				^
Main.java:18: error: variable tabs might not have been initialized
				blanks, tabs, newlines);
				        ^
4 errors
stdout
Standard output is empty