Judge’s power to put questions or order production under Section 165 of Indian Evidence Act
(i) To any party, or witness,
(ii) In any form,
(iii) At any time,
(iv) About any fact (relevant or irrelevant); or
(b) Order the production of any document or thing.
Neither the parties nor their agent is entitled —
(i) To make any objection to any such question or order; or
(ii) Without the leave of the Court, to cross-examine any witness upon any answer given in reply to any such question.
However, the judgment must be based upon facts declared by this Act to be relevant and duly proved.
It is also to be noted that the Judge cannot —
(a) Ask any question which it would be improper for any other person to ask under section 148 or 149; or
(b) Compel a witness to answer any question, which he would be entitled to refuse to answer if asked by the adverse party under section 121 to 129; or
(c) Compel any witness to produce any document which he would be entitled to refuse to produce, if called for by the adverse party under section 130; or
(d) Dispense with primary evidence of any document, except in the cases excepted.
In India, in an enormous mass of cases, it is absolutely necessary that the Judge should not only hear what is put before him by others, but that he should ascertain, by his own inquiries, how the facts actually stand. In order to do this, it will frequently be necessary for him to go into matters which are not themselves relevant to the matter in issue, but may lead to something that is; and it is in order to arm Judges with express authority to do this, that this section has been framed.
Lastly, it may be noted that the jury or assessors may put any question to the witness (through or by leave of the Judges) which the Judge himself might put and which he considers proper. (S. 166)