As many hour(s) I've spent on this I simply do not understand why this is unable to reproduce 'Mouse' or any other name for that matter. Brain is racked and I'm stuck. Any help would be appreciated.
if (isWork(computer.getKeyboard()) &&
isWork(computer.getMonitor()) &&
isWork(computer.getMouse())) {
System.out.println("Work!");
Seems not to be able to connect with CompItem.java appropriately though I've spent a bit of time cross referencing, etc.package com.codegym.task.task14.task1413;
/*
Computer
*/
public class Solution {
public static void main(String[] args) {
Computer computer = new Computer(new Keyboard(), new Mouse(), new Monitor());
if (isWork(computer.getKeyboard()) &&
isWork(computer.getMonitor()) &&
isWork(computer.getMouse())) {
System.out.println("Work!");
}
}
public static boolean isWork(CompItem item) {
System.out.println(item.getName());
return item.getName() != null && item.getName().length() > 4;
}
}