theoretically connecting an IDEAL VOLTAGE SOURCE to an IDEAL CAPACITOR in parallel leads to infinite current , that means it will get charged in time=0
practically every voltage source has a series resistance and same with the capacitor , so it will still be a high current but will take some time to charge the capacitor
Adding a resistance varies the charging time Tc as per requirement as well as discharge time Td
in your circuit the capacitor will never get discharged !!!
hope everything is clear now