Ternary Operator Java SE 8 Programmer I question3



class TernaryOperator
{
public static void main(String args[])
 {
int mrp=10;
int b=10;

float discount=mrp>20?1:calDiscount(mrp);

 }

public static  void calDiscount(int mrp){


}

}

will it compile ?

Comments

  1. No
    return type of the function is void and the collecting variable is float...!!

    ReplyDelete
  2. It's true. This freelancing is a good opportunity for the experts in Android application development. I have been working at an in-house job for the last three years as an android developer, but I am looking for a second source of income. Therefore, I think I can work as a freelancer side-by-side. Can you help me find a good platform to work with for the long term?

    ReplyDelete

Post a Comment