Ask Question
5 May, 20:37

Which method will return the first element in an ArrayList employees?

employees. first ()

employees. get (1)

employees. get (0)

employees. get ()

+2
Answers (1)
  1. 5 May, 22:46
    0
    employees. get (0)

    Explanation:

    In the programming, the index of ArrayList start from zero.

    So, the element start storing in the ArrayList from the zero index.

    get () is the function which is used to retrieve or getting the value in the

    ArrayList.

    The function employees. get (0), it retrieve the element of zero index.

    The function employees. get (1), it retrieve the element of first index.

    The function employees. first (1), it is wrong calling.

    The function employees. get (), it is wrong calling. you have to enter the index value inside the get ().
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Which method will return the first element in an ArrayList employees? employees. first () employees. get (1) employees. get (0) employees. ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers