Given student table:

stuId stuName

----- -------

1001 Jack

1002 Jill

1003 John

1004 Jason

Given code snippet:

ResultSet resultSet = statement.executeQuery("select * from student");

while(resultSet.hasNext()) {

resultSet.next();

String stuName = resultSet.getString(2);

System.out.print(stuName + " ");

resultSet.next();

}

What will be the output?

Jack John

Jack Jason

Jill Jason

Jack Jill

Verified Answer
Correct Option - a

To get all Infosys Certified Java Programmer Exam questions Join Group https://bit.ly/infy_premium_group

We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.

Qtr No. 213, New Town Yehlanka Indore 454775

admin@prepflix.in