Advertisement
AkanthaAnil

OCA: Numeric Promotion Compilation Errors

Jul 18th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.36 KB | None | 0 0
  1. public class Test {
  2.      public static void main(String[] args) {
  3.          long l = 100_00l;
  4.          int i = 100;
  5.          float f = 2.02f;
  6.          double d = 10_0.35d;
  7.          f = l;
  8.          d = l;
  9.          f = d;
  10.          d = f;
  11.          f = i;
  12.          i = f;
  13.          i = (int)d;
  14.      }
  15. }
  16.  
  17. How many lines cause compilation failure?
  18.  
  19.  
  20.  
  21.  
  22. //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement