You are viewing a single comment's thread. Return to all comments →
State state = (State) Class.forName(sb.toString()).newInstance();
This line create a new Instance of a State class.
For example; If stdin class name is AndhraPradesh, Class AndhraPradesh's yourNationalFlower() method returns an instance of Lily class.
Class Lily's whatsYourName() method returns "Lily".
Seems like cookies are disabled on this browser, please enable them to open this website
Covariant Return Types
You are viewing a single comment's thread. Return to all comments →
This line create a new Instance of a State class.
For example; If stdin class name is AndhraPradesh, Class AndhraPradesh's yourNationalFlower() method returns an instance of Lily class.
Class Lily's whatsYourName() method returns "Lily".