Question: int code = 1 ; String result = ( code = = 2 ) ? myObj.Two ( ) : myObj.One ( ) ; Suppose that

int code =1;
String result =(code ==2)? myObj.Two() : myObj.One();
Suppose that myObj is an instance of the class that contains the methods One () and Two (). What would be the return type of the methods
One () and Two () from the code above?
boolean
int
String
double
None of the above
int code = 1 ; String result = ( code = = 2 ) ?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!