"Example where" or "example in which"

I think both are correct but is that true and what is the difference between them (if there is any)?

This is an example where you can see that...

This is an example in which you can see that...

or in a question

Can you give an example where A is the opposite to B?

Can you give an example in which A is the opposite to B?


If your audience expects formal grammar, use a “which” construction. If your audience is more relaxed, you can use “where.” However both are grammatically correct: in the two sentences you have mentioned, the words “which” and “where” both function as relative pronouns. Relative pronouns (which and where) introduce the dependent clauses you have cited (you can see that... and A is the opposite to B).