Question: ACTIVITY 7 . 1 9 . 2 : Static fields and methods. 5 2 8 0 4 0 . 3 4 8 9 5 2
ACTIVITY
: Static fields and methods.
Jump to level
Create a public static method named resetNextCustomerldIfFull that assigns the private static integer field nextCustomerld with and outputs "Room is full. Customer ID is reset to for the next room." followed by a newline if nextCustomerld is greater than resetNextCustomerldIfFull returns no value.
Ex: If the input is Mei Kai Pat, then the output is:
Mel is assigned ID
Kai is assigned ID
Room is full. Customer ID is reset to for the next room.
Pat is assigned ID
NewCustomers.java
public class Customer
private static int nextCustomerId ;
private string name;
private int id;
public CustomerString newName
name newName;
id nextCustomerId;
nextCustomerId;
System.out.printlnname is assigned ID id ;
Y Your code goes here
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
