Posts Tagged ‘primitives’

Posted by Tatyana at 16 February 2010

Category:

Tags: , , , , ,

Here is a very useful java conversion table that I’ve created while preparing for the Sun Certified Java Programmer exam.

primitives conversion

Java primitive conversions table

And here is a complete overview of the Golden rules of widening, boxing & varargs:

1. Primitive Widening > Boxing > Varargs.
2. Widening and Boxing (WB) not allowed.
3. Boxing and Widening (BW) allowed.
4. While overloading Widening + vararg and boxing + vararg are mutually exclusive of each other.
5. Widening between wrapper classes not allowed
6. Widening+varArgs & Boxing+varargs are individually allowed (but not allowed in overloaded version of method)
7. Boxing+Widening is preferred over Boxing+Varargs.

More explanation here.

VN:F [1.9.13_1145]
Rating: 0.0/5 (0 votes cast)
Share