小编Kev*_*vin的帖子

这段代码<>在java中是什么意思

随机码:

// Getting All Contacts
public List<Contact> getAllContacts() {
    List<Contact> contactList = new ArrayList<Contact>();
    // Select All Query
    String selectQuery = "SELECT  * FROM " + TABLE_CONTACTS;

    SQLiteDatabase db = this.getWritableDatabase();
    Cursor cursor = db.rawQuery(selectQuery, null);

    // looping through all rows and adding to list
    if (cursor.moveToFirst()) {
        do {
            Contact contact = new Contact();
            contact.setID(Integer.parseInt(cursor.getString(0)));
            contact.setName(cursor.getString(1));
            contact.setPhoneNumber(cursor.getString(2));
            // Adding contact to list
            contactList.add(contact);
        } while (cursor.moveToNext());
    }

    // return contact list
    return contactList;
}
Run Code Online (Sandbox Code Playgroud)

看看它在哪里

public List<Contact> getAllContacts() { …
Run Code Online (Sandbox Code Playgroud)

java tags generics

0
推荐指数
1
解决办法
242
查看次数

标签 统计

generics ×1

java ×1

tags ×1