Top "Casting" questions

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

In Objective-C, what is the equivalent of Java's "instanceof" keyword?

I would like to check whether an object (e.g. someObject) is assignable (cast-able) to a variable of another type (…

objective-c types casting equality downcast
com.google.gson.internal.LinkedTreeMap cannot be cast to my class

I have some problems with getting my object from a JSON string. I got the class Product public class Product { …

java json casting gson
Cast List<int> to List<string> in .NET 2.0

Can you cast a List<int> to List<string> somehow? I know I could loop through …

c# generics casting
Cannot convert from type object to long

I have a hashtable named table. The type value is long. I am getting values using .values(). Now I want …

java casting types long-integer
Cast syntax to convert a sum to float

Using PostgreSQL 9.3, I want to convert the calculated values to data type float. My first attempt: SELECT float(SUM(Seconds))/…

sql postgresql casting type-conversion postgresql-9.3
Casting vs using the 'as' keyword in the CLR

When programming interfaces, I've found I'm doing a lot of casting or object type conversion. Is there a difference between …

c# casting clr
Using LINQ to convert List<U> to List<T>

I have 2 classes which have some identical properties. I stock into a list properties from 1st class, and after that, …

c# linq list .net-3.5 casting
Java convert Arraylist<Float> to float[]

How I can do that? I have an arraylist, with float elements. (Arraylist <Float>) (float[]) Floats_arraylist.toArray() …

java arrays casting arraylist autoboxing
Casting a void pointer to a struct

I started feeling comfortable with C and then I ran into type casting. If I have the following defined in …

c casting void
Most efficient way to cast List<SubClass> to List<BaseClass>

I have a List<SubClass> that I want to treat as a List<BaseClass>. It seems …

java inheritance casting