0
puclic class ClassA<T> {
}

what is the following technique called where you can pass a class type to another class and use it withing the class for type safety? I am talking about the <T> after my class name

2 Answers 2

1

Java generics.

It is the way of typecasting your class so that referential integrity is checked at compile time instead of runtime.

The complete tutorials are at

http://download.oracle.com/javase/tutorial/extra/generics/index.html

http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf

Sign up to request clarification or add additional context in comments.

Comments

1

It's called generics. Is that the whole question?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.