Qtr No. 213, New Town Yehlanka Indore 454775
What will be the output of the following code?
public class BaseClass {
private int display1(int i)
{ return i++ + --i; }
public int display2(int i)
{ return display1(--i + 1); }
}
class ChildClass extends BaseClass
{
int display1(int i) // Line1
{ return display2(++i + ++i + --i); // Line2 }
}
class MainClass {
public static void main(String[] args) {
System.out.println("Value is " + new ChildClass().display1(27));
}}
Value is 168
Value is 169
Value is 170
Value is 171
To get all Infosys Certified Java Programmer Exam questions Join Group https://bit.ly/infy_premium_group
We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.
Qtr No. 213, New Town Yehlanka Indore 454775
admin@prepflix.in