Home » JAVA Programming » Methods » Question
  1. What is the output of this program?

    class calcluation
    {
    int p;
    int q;
    void calc(int K , int L)
    {
    K *= 5;
    L /= 5;
    }
    }
    public class result
    {
    public static void main(String args[])
    {
    calculation obj = new calculation();
    int p = 20;
    int q = 40;
    obj.calc(p , q);
    System.out.println(p + " " + q);
    }
    }
    1. 10 20
    2. 20 40
    3. 30 40
    4. 40 20
    5. 20 10
Correct Option: B

Output: 20 40



Your comments will be displayed only after manual approval.