Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions

Question

Do you think you have a true calling?

Answered: 1 week ago

Question

2. Initialize (the values in ).

Answered: 1 week ago

Question

3. Maximize (the agreement function).

Answered: 1 week ago