Loading...
Consider the given program and answer the questions given below: class temp { int a; temp() { a=10; } temp(int z) { a=z; } void print() { System.out.println(a); } void main() { temp t = new temp(); temp x = new temp(30); t.print(); x.print(); } }
Consider and give the output of the following program: class report { int a,b; report() { a=10; b=15; } report(int x, int y) { a=x; b=y; } void print() { System.out.println(a*b); } static void main() { report r = new report(); r.print(); report p = new report(4, 5); p.print(); } }
© 2026 PadhAiPro. This question is provided for educational purposes.