About 1,920,000 results
Open links in new tab
  1. casting - Converting double to integer in Java - Stack Overflow

    Jun 24, 2011 · is there a possibility that casting a double created via Math.round() will still result in a truncated down number No, round() will always round your double to the correct value, and …

  2. What are the rules for casting pointers in C? - Stack Overflow

    Jun 23, 2013 · There are rules about casting pointers, a number of which are in clause 6.3.2.3 of the C 2011 standard. Among other things, pointers to objects may be cast to other pointers to …

  3. Implicit and explicit casting advantages and disadvantages

    Dec 26, 2015 · I know what implicit and explicit casting are. Now I have a question for which I could not find a satisfactory answer. What are the advantages and disadvantages of implicit …

  4. Casting variables in Java - Stack Overflow

    Mar 13, 2011 · Casting in Java isn't magic, it's you telling the compiler that an Object of type A is actually of more specific type B, and thus gaining access to all the methods on B that you …

  5. c# - Direct casting vs 'as' operator? - Stack Overflow

    Sep 25, 2008 · Direct Casting Types don't have to be strictly related. It comes in all types of flavors. Custom implicit/explicit casting: Usually a new object is created. Value Type Implicit: …

  6. Casting objects in Java - Stack Overflow

    Mar 15, 2011 · Casting can be used to clearly state that you are calling a child method and not a parent method. So in this case it's always a downcast or more correctly, a narrowing conversion.

  7. casting - Explanation of ClassCastException in Java - Stack Overflow

    Apr 10, 2021 · Do you understand the concept of casting? Casting is the process of type conversion, which is in Java very common because its a statically typed language. Some …

  8. casting - How do I convert between numeric types safely and ...

    Feb 2, 2015 · For example, casting using 4294967295us as u32 works and the Rust 0.12 reference docs on type casting say A numeric value can be cast to any numeric type. A raw …

  9. Regular cast vs. static_cast vs. dynamic_cast - Stack Overflow

    Aug 26, 2008 · Static cast is also used to cast pointers to related types, for example casting void* to the appropriate type. dynamic_cast Dynamic cast is used to convert pointers and references …

  10. java: How can I do dynamic casting of a variable from one type to ...

    2 Your problem is not the lack of "dynamic casting". Casting Integer to Double isn't possible at all. You seem to want to give Java an object of one type, a field of a possibly incompatible type, …