Top "Casting" questions

Casting is a process where an object type is explicitly converted into another type if the conversion is allowed.

Convert boolean to int in Java

What is the most accepted way to convert a boolean to an int in Java?

java casting boolean int
converting double to integer in java

In Java, I want to convert a double to an integer, I know if you do this: double x = 1.5; int …

java casting double rounding
Integer division: How do you produce a double?

For this code block: int num = 5; int denom = 7; double d = num / denom; the value of d is 0.0. It can be …

java casting integer-division
How to insert a character in a string at a certain position?

I'm getting in an int with a 6 digit value. I want to display it as a String with a decimal …

java string casting
Cast int to varchar

I have below query and need to cast id to varchar Schema create table t9 (id int, name varchar (55)); insert …

mysql sql database casting mariadb
PHP String to Float

I am not familiar with PHP at all and had a quick question. I have 2 variables pricePerUnit and InvoicedUnits. Here's …

php string casting floating-point
Converting Integer to Long

I need to get the value of a field using reflection. It so happens that I am not always sure …

java reflection casting
Fastest way to convert string to integer in PHP

Using PHP, what's the fastest way to convert a string like this: "123" to an integer? Why is that particular method …

php optimization casting
Why use static_cast<int>(x) instead of (int)x?

I've heard that the static_cast function should be preferred to C-style or simple function-style casting. Is this true? Why?

c++ casting static-cast
typecast string to integer - Postgres

I am importing data from a table which has raw feeds in Varchar, I need to import a column in …

postgresql casting