Ask Question

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. 12 January, 17:18
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers