Can anyone tell me what is wrong with this For Loop?
Code:
public class EmployeeApplication
{
public static void main(String[] args)
{
//define variables
Employee obj; //the object of Employee class
String sSource = args[0];
/* if you have multiple inputs you can use for loop
* to take all inputs one by one
*/
for( int i = 0; i < sSource.length(); i++)
{
obj = sSource[];
}
String s1 = sSource.substring(0, 11); //SSN
String s2 = sSource.substring(12,sSource.length()); //Name
//create an instance of each variable
obj = new Employee();
//calling the methods of the first object
obj.setsEmpId(s1);
obj.setsEmpName(s2);
System.out.println(obj); //toString is automatically called
}
}