Click here to Skip to main content
15,916,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm very confused how parameters are used when overriding a method ?
should these parameters be used inside the method or they are useful when calling them,...??
Thanks

E.g:

@Override
public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {

}

What I have tried:

..I'm very confused how parameters are used when overriding a method ?
should these parameters be used inside the method or they are useful when calling them,...??
Thanks

E.g:

@Override
public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {

}
Posted
Updated 5-Nov-17 22:48pm

1 solution

The parameters are used by the onUpgrade method in the current class. Since the above method contains no code the parameters do nothing. For basic information look at the same method in the parent class.
 
Share this answer
 
v2
Comments
Member 13384372 6-Nov-17 14:30pm    
yes thanksbut does this mean all these parameters should be used inside this method ?or just what we need?? so confusing..
Richard MacCutchan 7-Nov-17 3:16am    
The parameters are defined by the method, based on what information it needs to process. In the above case it takes a database reference and two integers. But since there is no code in the method I cannot say what those parameters are for. As I said above, look at the documentation for the method that is being overridden to see what these values are for.

If you really do not understand something as basic as this then I suggest going to Trail: Learning the Java Language (The Java™ Tutorials)[^] and studying the Java language more closely.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900