Ask Question
29 April, 15:29

What is the output of the following program?

public class testmeth

{

static int i = 1;

public static void main (String args[])

{

System. out. println (i+", ");

m (i);

System. out. println (i);

}

public void m (int i)

{

i + = 2;

}

}

a) 1, 3

b) 3, 1

c) 1, 1

d) 1, 0

e) none of the above.

+1
Answers (1)
  1. 29 April, 15:48
    0
    Answe:

    none of the above

    Explanation: non-static method m (i) cannot be cannot be referenced from a static context
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “What is the output of the following program? public class testmeth { static int i = 1; public static void main (String args[]) { System. ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers