07-29-2016, 11:14 PM | #1 |
Registered User
Join Date: Nov 2015
Posts: 127
|
What is Typecasting ?
What is Typecasting ?
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
08-02-2016, 12:48 AM | #2 |
Registered User
Join Date: Jun 2016
Location: USA
Posts: 55
|
The process of converting one data type to another is called Casting. It is used when a function returns a data of type in a different form then we need to perform an operation.
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
08-02-2016, 12:51 AM | #3 |
Registered User
Join Date: Jun 2016
Location: UK
Posts: 66
|
Type casting is a way to convert a variable from one data type to another data type. For example, if you want to store a 'long' value into a simple integer then you can type cast 'long' to 'int'. You can convert the values from one type to another explicitly using the cast operator as follows
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. , To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. , To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. , To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. , To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. , To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. , To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. , To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. , To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
08-03-2016, 03:00 AM | #4 |
Registered User
Join Date: May 2016
Location: Ahmedabad, Gujarat
Posts: 14
|
Type casting is a process of converting one type to another. You can convert the values from one type to another explicitly using the cast operator.
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
08-29-2016, 02:41 AM | #5 |
Registered User
Join Date: Jun 2016
Posts: 169
|
The process of changing data of one datatype in to different datatype is known as type casting. in some cases we need to change to int variable to float when we've to add it with a float variable to get a float variable. The Compiler automatically type cast the variable when something like this happen in Java.
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|