Course Solutions Uncategorized (Solved) : Created Worker Workers New Worker 5 Another Class Separate Worker Worker Class Used Public Q29869021 . . . .

(Solved) : Created Worker Workers New Worker 5 Another Class Separate Worker Worker Class Used Public Q29869021 . . . .

 

Created Worker[] workers = new Worker[5]; in another classseparate from Worker.

In Worker class I used public void setSalary(double sal) {salary = sal; } and public double getSalary() { return salary; }and my worker constructor is:

Worker(double sal){

salary = sal;

}

How do I access the variable “salary”:storing values from eacharray slot, from my worker class on my other class with the Work[]workers array? i.e. sharing variables from a class to another?

Expert Answer


An answer will be send to you shortly. . . . .

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Company Tata Motors Topic Business Initiatives Strategy Copied Example Given Hul Company W Q34209323Company Tata Motors Topic Business Initiatives Strategy Copied Example Given Hul Company W Q34209323

<p><strong>Company: Tata Motors</strong></p><p><strong>Topic: Business Initiatives and strategy (should not becopied)</strong></p><p><strong>Below Example is given of HUL Company, I want the samefor Tata Motors (From Start to Year 2018).</strong></p><p><strong><img alt="Table 5.1 The