I have to create a program using java inheritance while also incorporating the gave gates (and, or, nand, nor). Then i have to take the java gates and test them through the program. So far the program i have encounters errors. Im just looking for help on what i am doing wrong or what else needs to be done.
Here is the error i encounter:
Thank you very much
public abstract class Gates {
public abstract boolean doOperation(boolean a, boolean B)/>/>;
}
public class AND extends Gates {
public boolean doOperation(boolean a, boolean B)/>/> {
return a && b;
}
}
public class OR extends Gates {
public boolean doOperation(boolean a, boolean B)/>/> {
return a || b;
}
}
public class NAND extends Gates {
public boolean doOperation(boolean a, boolean B)/>/> {
return !( a && B)/>/>;
}
}
public class NOR extends Gates {
public boolean doOperation(boolean a, boolean B)/>/> {
return !(a || b );
}
}
public class GatesTest {
public static void main(String args[]) {
Gates gates = new AND();
System.out.println("gates.doOperation(true,false)");
}
}
Here is the error i encounter:
Exception in thread "main" java.lang.Error: Unresolved compilation problem: at GatesTest.main(Gates.java:41)
Thank you very much