Question: . Introauction to Java Technologies home > 7 . 3 : Defining a class zyBooks cata Jump to level 1 In the Business class, declare
Introauction to Java Technologies home : Defining a class
zyBooks cata
Jump to level
In the Business class, declare the following private fields:
integer yearsOpen
integer numStock
integer numEmployees
and define the following public methods:
getYearsOpen has no parameters and returns the yearsOpen field.
getNumStock has no parameters and returns the numStock field.
getNumEmployees has no parameters and returns the numEmployees field.
Ex: If the input is then the output is:
Years open:
Items in stock:
Number of employees:
Note: If a field is not properly declared as private, an error message will be output.
BusinessInfo.java
public class Business
Y Your code goes here
public void setYearsopenint customYearsopen
yearsOpen customYearsOpen;
public void setNumStockint customNumStock
numstock customNumStock;
public void setNumEmployees int customNumEmployees
numEmployees customNumEmployees;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
