What is diamond operator in java?



What is diamond operator in java?..

Answer / Ankit Srivastava

The diamond operator (<>) is a shortcut syntax for specifying generic types when extending or implementing generic classes or interfaces. It helps in reducing redundant code and simplifies the process of creating new generic instances.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

I want to control database connections in my program and want that only one thread should be able to make database connection at a time. How can I implement this logic?

1 Answers  


as we know a static method could access static data and static method only. then how could main method call the object of aclass which is not static and other non static data

1 Answers  


What is encapsulation in java?

1 Answers   IBS, NIIT,


can abstract class have constructor how can you achive this ?

4 Answers   Fidelity,


Write java code to print "Hello how are you" Thread1 should have "Hello" Thread2 should have "how are you" both the threads should start at the same time

4 Answers   Huawei,


How do you avoid global variables?

1 Answers  


what is Hashmap & Hashtable wirh example?

5 Answers   CTS, Saksoft,


How to sort array of 0 and 1 in java?

1 Answers  


What is the flag in java?

1 Answers  


What is the default initialized value of String type variable?

4 Answers  


What is class and object in java?

1 Answers  


How to display names of all components in a Container?

1 Answers   Microsoft, Wipro,


Categories