I know getClass() method in java.lang.Object. But In my application, I know all of my classes. So, What is the actual purpose of using this method?
I know getClass() method in java.lang.Object . But In my application, I know all
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’re wading into the wonderful world of Reflection. Using reflection, you can programmatically inspect classes, set their fields, call their methods, etc. You can do some really powerful stuff with it, and most frameworks that you use on a daily basis (e.g. Hibernate, Spring, Guice, etc.) depend very heavily on it to make things happen.