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:

 My Attempt to learn AI  GPT Generative Pretrained Transformer Created by Google in 2017 with the publication of the paper "Attention ...

Popular in last 30 days