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. char choice;
  13.  
  14. System.out.println("Help on:");
  15. System.out.println(" 1. if");
  16. System.out.println(" 1. switch");
  17. System.out.println("Choose one: ");
  18. choice = (char) System.in.read();//another error here
  19.  
  20. System.out.println("/n");
  21.  
  22. switch(choice){
  23. case '1':
  24. System.out.println("The if:/n");
  25. System.out.println("if(condition) statement;");
  26. System.out.println("else statement;");
  27. break;
  28. case '2':
  29. System.out.println("The switch:/n");
  30. System.out.println("switch(expression){");
  31. System.out.println(" case constant:");
  32. System.out.println(" statement sequence");
  33. System.out.println(" break;");
  34. System.out.println(" //...");
  35. System.out.println("}");
  36. break;
  37. default:
  38. System.out.print("Selection not found.");
  39. }
  40. }
  41. }
Success #stdin #stdout 0.09s 27812KB
stdin
Standard input is empty
stdout
Help on:
 1. if
 1. switch
Choose one: 
/n
Selection not found.