About 133,000 results
Open links in new tab
  1. Java Type Casting - W3Schools

    Here is a real-life example of type casting. We calculate the percentage of a user's score in relation to the maximum score in a game. We use type casting to make sure that the result is a floating-point …

  2. Object Type Casting in Java - Baeldung

    May 11, 2024 · An overview of type casting in Java, covered with simple and easy to understand examples.

  3. Typecasting in Java - GeeksforGeeks

    Nov 12, 2025 · Upcasting is the process of casting a subtype to a supertype in the inheritance tree's upward direction. When a sub-class object is referenced by a superclass reference variable, an …

  4. Java Type Casting - DataCamp

    Learn Java type casting with clear examples of implicit and explicit conversions. Master safe casting techniques between data types and object references to prevent errors and data loss.

  5. Java Type Casting (With Examples) - Programiz

    In this tutorial, we will learn about the Java Type Casting and its types with the help of examples. Type Casting is the process of converting one data type (int, float, double, etc.) to another.

  6. Java rules for casting - Stack Overflow

    Java requires that you declare implemented interfaces by name. It does not have duck typing, unlike some other languages such as Python and Go.

  7. Java Object Casting: A Comprehensive Guide - javaspring.net

    Jan 16, 2026 · Java object casting is a powerful feature that allows you to convert objects between different types in the inheritance hierarchy. Upcasting is a safe and implicit operation, while …

  8. Javaref - Cast Operator

    Changes the type of an expression. The cast operator (often simply called cast) changes or specifies the type of an expression, throwing a ClassCastException if its argument cannot be coerced to the …

  9. Type Casting in Java: Everything You Need to Know - Simplilearn

    Apr 15, 2026 · Demystifying type casting in Java: From implicit to explicit, learn how to convert data types for smooth programming. Explore our comprehensive guide now!

  10. Java Class.cast () vs. Cast Operator - Baeldung

    Aug 28, 2024 · In this article, we’ve discussed the two casting options in Java and learned about their limitations and advantages using a relevant use case with a practical comparison.