About 539,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. 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.

  3. 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 …

  4. casting - C# "as" cast vs classic cast - Stack Overflow

    Possible Duplicate: Casting vs using the ‘as’ keyword in the CLR I recently learned about a different way to cast. Rather than using SomeClass someObject = (SomeClass) obj; one can …

  5. casting - Downcasting in Java - Stack Overflow

    Dec 19, 2008 · Upcasting is allowed in Java, however downcasting gives a compile error. The compile error can be removed by adding a cast but would anyway break at the runtime. In ...

  6. 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 …

  7. casting - CAST to DECIMAL in MySQL - Stack Overflow

    I am trying to cast to Decimal in MySQL like this: CAST((COUNT(*) * 1.5) AS DECIMAL(2)) I'm trying to convert the number of rows in a table (times 1.5) to a floating point number with two …

  8. 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 …

  9. 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: …

  10. casting - How to cast or convert an unsigned int to int in C?

    Feb 26, 2011 · The real question is what you want to do when/if the value in the unsigned int it out of the range that can be represented by a signed int. If it's in range, just assign it and you're …