Consider the following code snippet to query SQLite database: 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?
A) if (allRows.moveToFirst() ) { do {
System.out.println(allRows.getString(1) ) ;
}
While (allRows.moveToNext() ) ; }
B) do { System.out.println(allRows.getString(0) ) ; while (allRows.moveToNext() ) ;
C) /system/app/<package name>/files
D) if (allRows!= null) { while (!allRows.isNull() ) ; }
Correct Answer:
Verified
Q79: Which method should you use to start
Q80: In which Activity life-cycle method you should
Q81: Which of the following statements about DDMS
Q82: What does the following line of code
Q83: Consider the following code: Intent i =
Q85: Which of these is the incorrect method
Q86: When publishing an update to your application
Q87: Which of the following is NOT true
Q88: Which of the following is NOT true
Q89: Method onDraw() of class android.view.View has the
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents