Hi, I need a hand with this task, I got it to compile but I'm missing two last conditions. I tried moving the getters inside the constructor but that causes an error.
What am I doing wrong?
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;
}
}