Beginner Java programming
I need help with my code. can someone please help me by telling me how to fix it and explain the logic behind my errors. I don’t know if my “if” statement is correct. my program doesn’t run and I really need to learn this.
/import statement
import java.util.Scanner;
import java.lang.*;
//class variables
public class JavaCoffee {
private boolean On = (true);
private boolean Off = (false);
public JavaCoffee(boolean on,boolean off,boolean On,boolean Off){
this.On=On;
this.Off=Off;
this.On=on;
this.Off=off;
}
public JavaCoffee (boolean On){
if (On) {
System.out.println(“Brewing” );
System.out.println(” ( (“);
System.out.println(” ) )”);
System.out.println(” ………..”);
System.out.println(” | |]”);
System.out.println(” ‘. /”);
System.out.println(” `—–‘”);
}
public JavaCoffee (boolean Off){
else (Off) {
System.out.println(“***Off***”);
System.exit(0);
}
}
}
———————————————-
import java.util.Scanner;
class TestJavaCoffee{
public static void main(String[] args) {
JavaCoffee coffee = new JavaCoffee(boolean On, boolean Off);
System.out.println(“Enter On to brew coffe, or Off to power off”);
Scanner scanner = new Scanner (System.in);
String On = scanner.nextLine();
}
}
NEED HELPcomputer science