How do charges accumulate even though current flows through a capacitor? I don't understand why do charge accumulate on each plate of capacitor.I learned about displacement current which flows through the gap of the capacitor and this makes the circuit continuous.But why do the charges accumulate? We don't get accumulated charges on the ends of a resistor because current continuous flows through it.
 A: I think it is easy to understand. Here I am giving a heuristic picture, current in any wire is generated by charge flow.
$I=\frac{dQ}{dt}$
now if you apply alternating current on the sides of capacitor you will find that charge on one plate is constantly increasing and decreasing, which induces the opposite charge on the other plate changing with same rate. Resulting in the flow of current. 
However if you apply a DC voltage on the capacitor you will find that the charge increases from zero to max and which gives rise to exponentially decaying current.
I hope you will get some clarity 
regards
A: Actually charges do accumulate even around a resistor. Consider the following model: two conductors with resistances $R_A$ and $R_B$ and lengths $L_A$ and $L_B$ are connected to each other, and a potential difference of $\Delta U$ is applied to their free ends. By Ohm's law we have:
$$\Delta U_A=IR_A,$$
$$\Delta U_B=IR_B.$$
This means that, for equal-sized conductors, the potential will go like follows (here $x=0$ is the left end of conductor $A$):
$$\varphi(x)=\varphi_A(x)\theta(L_A-x)+\varphi_B(x)\theta(x-L_A),$$
where $\theta(\cdot)$ is Heaviside theta function and
$$\varphi_A(x)=\frac x{L_A}\Delta U_A,$$
$$\varphi_B(x)=\varphi_A(L_A)+\frac{x-L_A}{L_B}\Delta U_B.$$
Using Poisson's equation (assuming $\varepsilon=\operatorname{const}$), we have:
$$\rho=-\varepsilon\nabla^2\varphi.$$
After some derivation we can see that for our system
$$\rho(x)=2\varepsilon I\left(\frac{R_A}{L_A}-\frac{R_B}{L_B}\right)\delta(x-L_A)=2\varepsilon I\left(r_A-r_B\right)\delta(x-L_A),$$
where $\delta(\cdot)$ is Dirac delta, and $r_A$ and $r_B$ are specific resistances of the conductors.
Physically this means that we always have a peak of charge between the two conductors, unless their specific resistances are equal.
All this implies that the only relevant thing which is different between a resistor and a capacitor is the scale of charge accumulation — due to much different resistances.
