Java Contd.....

1. To find a value if it exits in an arraylist

Ans : - Just use ArrayList.contains(desiredElement)

if (lista.contains(conta1)) {
    System.out.println("Account found");
} else {
    System.out.println("Account not found");
}

No comments:

 Python Basics How to check the version of Python interpreter mac terminal

Popular in last 30 days