约 822,000 个结果
在新选项卡中打开链接
  1. casting - Converting double to integer in Java - Stack Overflow

    2011年6月24日 · 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, …

  2. Casting objects in Java - Stack Overflow

    2011年3月15日 · 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 …

  3. Python: typing.cast vs built in casting - Stack Overflow

    2023年1月4日 · 23 str(x) returns a new str object, independent of the original int. It's only an example of "casting" in a very loose sense (and one I don't think is useful, at least in the …

  4. powershell - Why Use [PSObject] Type Casting - Stack Overflow

    2025年2月5日 · Why Use [PSObject] Type Casting Generally, do NOT use [psobject] casts: In most cases, it is at best an unnecessary, virtual no-op and at worst results in unexpected …

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

    2008年9月25日 · 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. Regular cast vs. static_cast vs. dynamic_cast - Stack Overflow

    2008年8月26日 · 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 …

  7. casting - How to cast int to enum in C++? - Stack Overflow

    2017年5月28日 · How do I cast an int to an enum in C++? For example: enum Test { A, B }; int a = 1; How do I convert a to type Test::A?

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

    2021年4月10日 · 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 …

  9. Why is casting a const reference directly to a mutable reference ...

    2018年11月24日 · The superficial answer to the question "why?" is that these simply are the rules of as expressions in Rust. Quoting from the Nomicon: Casting is not transitive, that is, even if e …

  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, …