Question: 3) create a class nared A. Your A class should have the tolowing he following: private instance variable type int named x public static variable

 3) create a class nared A. Your A class should have

3) create a class nared A. Your A class should have the tolowing he following: private instance variable type int named x public static variable type int named y initialized to 5 constructor with no parameters that initializes x to 99 constructor with one parameter that initializes x to the parameter public instance method f that returns an int and has one parameter f should return the sum of x and its parameter. public static method g that displays "hello" Create another class named B. Your B class should contain the main method. Your main method should Create an A object using constructor with one parameter, passing 10 Invoke the f method in this object passing it 100 Display the value in y in class A Invoke the g method in class A

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!