I understand that the topic with Cursor 's is "beaten", but I will still ask. Here is a classic query in the database.
DatabaseHelper sqlHelper = new DatabaseHelper(context); SQLiteDatabase db = sqlHelper.getReadableDatabase(); Cursor cursor = db.rawQuery("select * from " + DatabaseHelper.TABLE_MAIN + " where " + DatabaseHelper.MAIN_MAX + " = " + max, null); Cursor is an Interface , there is no implementation in it directly in the methods, its (implementation) needs to be implemented by implementing the interface in some Классе . Cursor itself is extends Closeable , and SQLiteDatabase is extends SQLiteClosable , which in turn is implements Closeable . In Closeable only the close method.
In the example, we assign the result of the db.rawQuery(...) query to the Cursor link.
Interested in the following. What cursor.moveToFirst() Класс “hidden” behind the cursor reference, what does the methods cursor.moveToFirst() , cursor.moveToLast() , etc. implement directly? How can an Interface 's link manipulate data?