Ask Question
1 December, 22:40

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

employees. first ()

employees. get (1)

employees. get (0)

employees. get ()

+4
Answers (1)
  1. 2 December, 01:20
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers