I know that capacitors can be charged to work like a battery . But I wanted to know whether we can charge a capacitor while it is in use ( given that the current supplied to it is more than what it has to give in a circuit ).
But I wanted to know whether we can charge a capacitor while it is in use
If, by "while it is in use", you mean while the capacitor is discharging, i.e., energy is flowing out of the capacitor to some load, then the answer is no since, by definition, if a capacitor is charging, energy is flowing into the capacitor.
Put another way, a capacitor cannot be both charging and discharging at the same time. Either, the energy stored in a capacitor is increasing, unchanging, or decreasing.
given that the current supplied to it is more than what it has to give in a circuit
If the capacitor is charging, it is not 'giving' current to a circuit; whatever is supplying current to the capacitor is also supplying current to the circuit.
From a comment:
I'm talking about a power supply charging the capacitor and the same capacitor supplying power to a load simultaneously. Is it possible?
To recapitulate what I wrote above, no, it is not possible.
If the power supply is charging the capacitor, the capacitor is not supplying power to the load simultaneously.
Instead, the power supply is supplying power to both the load and the capacitor simultaneously.
A capacitor is storing an electrical charge. Simply speaking: If the voltage across the capacitor rises, then the charge will increase and if the voltage decreases charge will be flowing out. In any normal circuit, this happens all the time in both directions.
Obviously, it can't happen simultaneously since the voltage either decreases or increase but not both at the same time. However, the transitions between these two states can be arbitrarily fast, they are not different mode of operations, they are simply different states for the circuit.