While working on my project in android, I came across this weird problem (probably that's my lack of understanding generics in java) related to method overloading. I defined the following static methods in a utility class and it gave me error.
public static void getAllFromDatabase(Context context, ArrayList<Student> students) {
DatabaseHelper dh = new DatabaseHelper(context);
students = dh.getStudents();
dh.close();
}
public static void getAllFromDatabase(Context context, ArrayList<LogEntry> logs) {
DatabaseHelper dh = new DatabaseHelper(context);
logs = dh.getlog();
dh.close();
}
Any help? Thanks in advance.