Knowledge of law must for all: Judge