As a beginner of classical electrodynamics I am quite confused in understanding Kirchhoff's junction law or it may be the reason that I misunderstood the law of conservation of charge.Please correct me if I am wrong:-
I understood the law of conservation of charge as follows:-
The net charge of an isolated system will always remain constant.
By isolated system I think that it is a system in which we can't take out any charge from it as well as we can't add any charge to it.
Now considering Kirchhoff's junction law, Imagine a junction of wires at $J$ which is a part of an electric circuit. When the switch is open then no current passes through $J$. I consider $J$ as my system. My teacher told me that the junction law is just the other form of law of conservation of charge taking junction as the system. When the switch is closed then current flows through it and when we apply the law of conservation of charge at $J$ then we arrive at the junction law.
Now my question is how can we apply law of conservation of charge at $J$ because $J$ is not an isolated system?
I don't think that it is an isolated system as when switch is turned on then we can't write the equation using law of conservation of charge. So I think that Kirchhoff's junction law violates the law of conservation of charge! Am I correct or totally wrong?