lundi 17 septembre 2018

How can i check for add or delete in an if statment

import java.util.Scanner;

public class apples {

public static void main(String []args) {

    Scanner input = new Scanner(System.in);
    System.out.println("Do you want to add or delete?");
    String answer=input.nextLine();
    if (answer = "add") {

    }

}

}enter code here

Aucun commentaire:

Enregistrer un commentaire