What is generics in java interview questions?



What is generics in java interview questions?..

Answer / Nagender Kumar

"Generics in Java are a feature that allows you to create classes, interfaces, and methods that work with multiple data types. It helps to write more flexible and reusable code by allowing the same methods to work with different types. Type parameters are used to define the type of objects that can be used with a generic class or method."n

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What are the different http methods?

1 Answers  


Do I need to import java.lang package any time? Why?

2 Answers  


what are class,constructor and primitive data types?

2 Answers   IBM,


What is the use of static class?

1 Answers  


How to Sort list of Strings in ascending order without using java api.

1 Answers   HCL, NIIT,


How many types of assembly languages are there?

1 Answers  


Write a program to print 15 random numbers using foreach of java 8?

1 Answers  


There is a Banking application. It has 2 types of account, Savings and Current. Write a method calculateInterest by passing an ArrayList of these account objects and calculate Interest accordingly. Write code for this situation

1 Answers   ABC, KPIT,


What if the main() method is declared as private? What happens when the static modifier is removed from the signature of the main() method?

1 Answers  


What is difference between length and length() method in java ?

1 Answers  


primitive data types in Java ?

3 Answers  


What are the data types supported by java?

1 Answers  


Categories