If we run derived class,it will print derived and parent..is there any way to prevent inheritance of static block ?
//Class 1
public class parent { s
its not possible. Static block is executing during class loading and you can't prevent this without refactoring the parent class to not used the static block