What are the considerations for the use of java generic interfaces
Today, I would like to share with you the relevant knowledge of what matters needing attention in the use of java generic interface, detailed content, clear logic, I believe that most people still know too much about this knowledge, so share this article for your reference, I hope you can get something after reading this article, let's take a look at it.
Attention to use
1. The implementation class is not a generic class, and the interface should specify the data type.
2. The implementation class is also a generic class, so the generic type should be consistent.
3. The type parameters of generics can only be class types, not simple types. You cannot use instanceof operations on exact generic types.
Example
Interface Info {public T getValue ();} class InfoImpl implements Info {public String getVar () {return null;}} what are the basic data types of Java?
1. Integer type, which is used to represent the data type of integer.
2. Floating point type, which is used to represent the data type of decimals.
3. Character type. The keyword of character type is "char".
4. Boolean type, which is the basic data type that represents logical values.
These are all the contents of the article "what are the points for attention in using the java generic interface?" Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.