Search:

Type: Posts; User: helloworld922

Search: Search took 0.11 seconds.

  1. Re: Fitting a large primitive into a small reference variable

    Java lets you cast down explicitly because it's useful sometimes. Remember, what we're really dealing with here are bits. So, in a 32 bit integer, 128 is 00000000000000000000000010000000. Casting...
  2. Re: Fitting a large primitive into a small reference variable

    Casting is casting. Implicit casting just means you don't have to specify what you're casting to, so Java will "implicitly" cast it for you.


    int a = 5;
    double b = a;


    Java will see this as:...
  3. Re: Fitting a large primitive into a small reference variable

    Java will only implicitly cast upwards:

    bytes -> shorts -> ints -> longs -> floats -> doubles -> String

    (technically, char's can be cast to int's implicitly)

    Anything else must be explicitly...
Results 1 to 3 of 3