Can i pass DBHelper class object to anther class which is a library class

92 views Asked by At

I have a DBHelper class which is extended from SQLiteOpenHelper,i created object for DBHelper in my one of the class file.and i want to send the object of that DBHelper class to a Library class with a Specific method.

Is there any possibility.

Can i write this code in my library file:

mylibrary{
public DataFromUser(SQLiteOpenHelper openHelper,String tablename,**********************,*********)
{
//------------------------------
}
}

If i write in my actual class.

public toDB()
{
DBHelper helper;

MYLibrary lib;

lib.DataFromUser(helper,table,********)
}

my aim is to create .jar file for common sqlite methods we are using generally i.e sending data server using json like that.how can i acheive this.

1

There are 1 answers

1
Mureinik On

Short answer - yes. As long as you pass parameters that match the method's signature, it doesn't matter which jar/whatever contains this method or what the concrete type of the argument is.