fork download
  1. class Temp{
  2.  
  3. public Integer a;
  4.  
  5. Temp(Integer i){
  6. this.a=i;
  7. }
  8.  
  9. public static Integer sum=0;
  10.  
  11. public static sum(Temp c){
  12. sum+=(c?.a)?:3
  13. }
  14. static void main(String[] args){
  15.  
  16. Temp x=new Temp(1);
  17. Temp y=new Temp(1);
  18. Temp z=new Temp(2);
  19. Temp k=new Temp(3);
  20.  
  21. sum(x);
  22. sum(y);
  23. sum(z);
  24. sum(k);
  25.  
  26. println sum
  27. }
  28. }
Success #stdin #stdout 0.9s 2252800KB
stdin
Standard input is empty
stdout
7