What are generics used for in Java
Even the pen owner has not understood the concept of reflection for a long time, suddenly a flash of light that understands a little, as if it could help everyone
First we create a person class
Create another test class
That is reflection. . .
You may be wondering what this is good for
General business development, we seldom use reflection
1. The advantages of reflection are: Can confirm objects and methods at runtime。
2. The following is a simple example of the reflection application scenario:
If a game has a configuration file, a renderType in the configuration file determines which RenderHandler should be called when the game starts rendering the game.
(RenderHandler: An interface, there is a rendering method, HighRenderHandler, LowRenderHandler, MiddleRenderHandler and a total of 10 implementation classes.)
When the game starts you will need to get a RenderHandler to render the game. Now there are two possibilities: One possibility is to use the switch to judge
The other is to use reflection:
3. The switch uses 14 lines of code and the reflection only uses 2 lines of code. In reality, you may not see such a stupid example, but it helps to understand the reflection.
- What do employees like about a job
- What's your favorite boxing movie
- What can you drink against inflammation
- Can masturbation reduce my performance in bed
- Will the bears be releasing Cody Parkey
- What are hydrocarbons
- What kind of
- Immunologists treat autoimmune diseases
- What is the Amazon Echo about
- What are some free sign websites online
- How do I contact a drom seller
- What is the maximum length of the DVI cable
- How can I copyright my game
- How do I get a scholarship
- What is the difference between RCS and VoLTE
- Why is there an alien abduction?
- Who does CBSE grade 12 papers
- Uses Google Apache Spark
- How do alcoholism drugs work
- Hillary Clinton is a respectful person
- All asset management companies are mutual funds
- What do you think of French SKAM
- What is the voltmeter charging effect
- Did Sigmund Freud ever conduct research experiments?
- What are the main functions of marketing
- What do you think of Post Malone
- How do I secure my computer system
- In which areas do we need innovations?
- Are there any professional alternatives to SmugMug
- How good is the Akash Institute
- Do you play online poker and why
- How can I remove blackheads quickly
- What calms your mind when you are stressed
- What does cancer mean in Mobile Legends