In C#, the default keyword sets a default value of a type parameter. This will be null for reference types and zero for value types.
I'm looking for an equivalent keyword or construct in Java. I'm very fuzzy on reference vs. value types in Java - do they behave the same?
I've got a function defined as
private T BuildEntityFromResultSet(ResultSet resultSet)
{
// Initialize T appropriately
T entity = <blank>; // default(T) in C#.
}
Is there a keyword to initialize T properly that can fill in the blank above? Is it necessary to be concerned about an initial value (other than null) in Java?
I saw this question, but it doesn't seem to answer mine.