Actually I know that voltage source is of two types AC and DC, can capacitor behave as AC voltage source for a circuit, which contains a resistance R only. If yes! Then how do we do it? .
An ideal capacitor cannot, but a real capacitor can act like a microphone and pick up vibrations, either from piezoelectric voltage (think old-style non-electronic BBQ igniter) or from changing dimensions that cause a changing voltage when the capacitor is biased with a DC voltage.
General speaking, the answer is no. But i think a bit of elaboration will make this more clear. A source is defined as a component whose mean consumed power is negative, i.e: it delivers power. A capacitor is a reactive component meaning that it cannot deliver nor consume real power. So in that sense, a capacitor isn’t anything like a source! But let’s think about this in a different sense. There are situations that capacitors may behave like a temporary source. Oscillators are a good example. In LC oscillators, energy is transferred back and forth between the capacitor and the inductor. In a complete cycle, this is done once. In one of the two half cycles, energy is transferred from the capacitor to the inductor, making it look like a temporary source.