This week's book giveaways are in the AI and JavaScript forums.
We're giving away four copies each of GANs in Action and WebAssembly in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Java Reflection API

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody suggest a good source of information (tutorials, code samples, books, etc.) on Java Reflection API?
 
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sergei,
I just pulled out whatever I have - Not sure if any of these will be of use but
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure. (I assume you've already checked the API itself, right?)
 
Author and "Sun God"
Posts: 185
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sergei,
Hi. Sun has a refection tutorial. I haven't read it, but I believe it's fine.
My book encourages you to use reflection only in a limited form that avoids most of its disadvantages (Item 35, "Prefer interfaces to reflection"). Briefly, I believe that reflection should generally be used only to instantiate objects, which can then be accessed via the interface(s) they implement. The advantages of this approach are: compile-time type safety, cleanliness, and performance. Sometimes you need the full power of reflective access, but often you don't.

------------------
Joshua Bloch
Author of Effective Java
 
Ranch Hand
Posts: 1934
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
corejava volume 1 & 2 dwell into reflection in a good deal.
You have to be aware that using reflection will be a performance kill if you don't use it the right way.
 
Fire me boy! Cool, soothing, shameless self promotion:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!