Can any one tell me What this line of code do? i learnt it in an android tutorial but could not understand it, could any one tell me the specifics of it?.
Class ourClass = Class.forName("com.prem.firsttry.STARTINGPOINT");
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.
This method loads and links a Java class. Constructs a
Classobject and gives it to you. You can go ahead and make an Object out of it bynewInstance().Most popular use of such method is to check if a particular class exists and can be loaded (such as some JDBC driver). If not, this method throws exceptions. This also causes static initialization on the said class.