Question: Question 2 Find the output for the below Java program: 1 public class Main 2-{ 3 4 int a=1; 5 int b=5; 6 7. public

 Question 2 Find the output for the below Java program: 1

Question 2 Find the output for the below Java program: 1 public class Main 2-{ 3 4 int a=1; 5 int b=5; 6 7. public void setData(int a ,int b) { 8 a = a; 9 b = b; 10 } 11. public void showData() { 12 System.out.println("Value of A ="+a); 13 System.out.println("Value of B ="+b); 14 } 15. public static void main(String args[]){ 16 Main obj = new Main(); 17 obj.setData(2,3); 18 obj.showData(); 19 } 20 } AWN For the toolbar, press ALT+F10 (PC) or ALT+FN+F10 (Mac). BI U S Par

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 Databases Questions!