Are there different types of superposition? In electrostatics or in gravitational, when we are talking about interaction between multiple charges or multiple masses, we say that the interaction between any two charge or mass is independent of presence of other charges or masses.
But while studying Waves, we use superposition in a different context. We say that under superposition principle, we can obtain the displacement of a particle under the influence of two waves by adding the displacements of the particle due to each wave.
I don't see how there is a connection between superposition in the two cases, if there is one. Does this mean that superposition is of different types?
 A: Superposition is a result of linearity.  If the system is linear then $f(x+y) = f(x)+ f(y)$ which is superposition and which applies to both of your examples.
See https://en.wikipedia.org/wiki/Superposition_principle
"The superposition principle, also known as superposition property, states that, for all linear systems, the net response caused by two or more stimuli is the sum of the responses that would have been caused by each stimulus individually. So that if input A produces response X and input B produces response Y then input (A + B) produces response (X + Y).  A function $F(x)$ that satisfies the superposition principle is called a linear function."
Re. '...we say that the interaction between any two charge or mass is independent of presence of other charges or masses' follows from (its a result of) the superposition principle since we can write $f(x+y+z)=f(x)+f(y)+f(z)=f(x+y)+f(z)$ which shows that $f(x+y)$ is not a function of $z$ (the 'other charge or masses'). If $f(z)$ changes it does not effect $f(x+y)$.
So to answer your question: there is only one type of superposition.
