Android
AND-401 · Question #104
Consider the following code snippet: String[] result_columns = new String[] {KEY_ID, COL1, COL2}; Cursor allRows = myDatabase.query(true, DATABASE_TABLE, result_columns, null, null, null, null…
Sign in or unlock AND-401 to reveal the answer and full explanation for question #104. The question stem and answer options stay visible for context.
Question
Consider the following code snippet:
String[] result_columns = new String[] {KEY_ID, COL1, COL2}; Cursor allRows = myDatabase.query(true, DATABASE_TABLE, result_columns, null, null, null, null, null, null); Which of the following prints out the values of COL1 column correctly if the result is not empty?
Options
- Aif (cursor.moveToFirst()) {
- Bdo {
- Cif (cursor.moveToFirst()) {
- Dif (cursor != null) {
Unlock AND-401 to see the answer
You've previewed enough free AND-401 questions. Unlock AND-401 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.