Question: The variable names stores name as last name and first name separated by a comma. For example Jones, Sharon complete the code to store the

The variable names stores name as last name and first name separated by a comma. For example Jones, Sharon complete the code to store the first name and last name in separate variables and then print a line with first name and last name separated by a space. Assume all variables are declared and initialized.

commaPosition = name.indexOf(______);

lastName - name.substring(____, ____);

firstName - name.substring(commaPosition + ____, name.length());

System.out.println(____);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!