Basic Syntax

Cast

English

Overview

Converting data of one type so it can be treated as another type.

Details

A conversion operation that explicitly treats data of one type as another type. Unlike an implicit conversion, it can sometimes lose information. Casting a double to an int truncates anything after the decimal point, and casting a large long value down to int can overflow into an unexpected value -- implicit data loss is a real risk.

More Programming terms