Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CareFactory{
- private static ArrayList<Care> CareInventory = new ArrayList<Care>();
- public CareFactory(int quantity){
- for(i = 0; i <= quantity; i++){
- CareInventory.Add(new Care);
- }
- public getCare(){
- try{
- Care myCare = CareInventory.get(0);
- CareInventory.remove(0);
- } catch (IndexOutOfBoundsException e) {
- System.err.println("ran out of Care! " + e.getMessage());
- }
- }
- }
- public class Care{
- private static Boolean iCare;
- public Care(){
- iCare = true;
- }
- public getCareValue(){
- return iCare;
- }
- }
Add Comment
Please, Sign In to add comment