Not understanding why the memory location is being printed when I run. When I satisfy the 'if' statement I have in my code, the message I get back is "Your total is [I@5f184fc6". I would appreciate if someone could help get this issue resolved as well as explaining to me to help me understand and not run into this issue again.
import java.util.Arrays;
import java.util.Scanner;
public class steakShop {
public static void main(String [] args){
Scanner scanner = new Scanner(System.in);
String items[] = {"burger", "pizza", "shrimp", "nachos","stir fry"};
enter code here`int selection[] = {5,10,8,7,9};
for (String it: items) {
System.out.println("Would you like to order a " + it + "?");
String itemSelected = scanner.nextLine();
if (itemSelected.equals("yes"))
System.out.println("Your total is " + selection + ".");
}
} }
Thanks for all comments and answers!