fork download
  1. class sample{
  2. public static void main (String[] args){
  3. double a = 10.5;
  4. int c = (int)a;
  5. System.out.println("cは" + c );
  6.  
  7. foo((short)c);
  8. }
  9.  
  10. static void foo(short d){
  11. System.out.println("dは" + d );
  12. }
  13.  
  14. }
Success #stdin #stdout 0.16s 53560KB
stdin
Standard input is empty
stdout
cは10
dは10