Hi, I would like to make a class called "Game." basically I have some game table in the database with game attributes like score, team1, team2, datetime, etc.
I would like to turn this into the class but I have some difficulties writing the code.
1) how can I write the constructor?
2) Can there be 2 constructor? (one with attributes and other without attributes)
3)If I want to get the data from the game databse what my constructor should be?
4) and if I want to add some new game in to the table.. how should I use class to do this?
can anyone tell me about this?
I would like to turn this into the class but I have some difficulties writing the code.
1) how can I write the constructor?
2) Can there be 2 constructor? (one with attributes and other without attributes)
3)If I want to get the data from the game databse what my constructor should be?
4) and if I want to add some new game in to the table.. how should I use class to do this?
can anyone tell me about this?