In the below code, why doesn't the compiler show casting error?Instead itz compiling without error.Can you explain why? public class One { private final int i =10; private byte k = i; } Here int value is assigned to byte.Then compiler should say type mismatch.right?Please correct me!
its all because of final key word. this code also works. public class One { public final int i =10; public byte k = i; } if you remove final keyword public class One { private int i =10; private byte k = i; } it will show "Type Mismatch: Cannot convert from int to byte"
Don't get me started about those stupid light bulbs.