How do generics work in java?



How do generics work in java?..

Answer / Ravikant Kumar

Generics in Java allow the programmer to create classes, interfaces, and methods that can operate on objects of multiple types. The type parameters are specified within angle brackets (<>) before the class name or method definition. For example: public class MyGenericClass<T> { ... }

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is entry set in java?

1 Answers  


what are the difference between Java and .Net?

5 Answers  


How is java hashmap implemented?

1 Answers  


Explain public static void main(string args[]).

1 Answers  


Can inner class extend any class?

1 Answers  


How does singleton class work?

1 Answers  


What is a text string?

1 Answers  


What is Mutex (Mutual Exclusion Object) ?

1 Answers   Ciena,


What do you mean by flow of struts?

1 Answers   Amdocs,


Hi, well i am unable to understand that why it is mandatory to have same hashcode, if two objects are same? Thanks in advance.

5 Answers  


How do you write methodology?

1 Answers  


How to read and write image from a file ?

1 Answers  


Categories