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. protected class AsciiValue {
  8. public static void main(String[] args) {
  9. char ch = 'c';
  10. int ascii = ch;
  11. // You can also cast char to int
  12. int castAscii = (int) ch;
  13. System.out.println("The ASCII value of " + ch + " is: " + ascii);
  14. System.out.println("The ASCII value of " + ch + " is: " + castAscii);
  15. }
  16. }
Compilation error #stdin compilation error #stdout 0.04s 2184192KB
stdin
Standard input is empty
compilation info
Main.java:7: error: modifier protected not allowed here
protected   class AsciiValue {
            ^
1 error
stdout
Standard output is empty