# Given an arraylist a, write an expression that refers to the first element of the arraylist?

27 views

## Problem:

Given an ArrayList a, write an expression that refers to the first element of the ArrayList?

## Solution:

a.get(0);

First element of the arraylist is a.get(0)

## Related questions

61 views
Problem: Given the array a, write an expression that refers to the first element of the array?
23 views
Problem: I am trying to write a java program to create an ArrayList, add all the months of a year, and print the months. I have successfully written a program by initializing a string array with names of the months and then adding the months in ArrayList by using a for a loop. But I want to know, is there any efficient way of doing this? A demo program would be much helpful. Thanks!
69 views
Problem: I am new to programming, I need help, can anyone help me? Write an expression that evaluates to True if and only if s refers to the str "end"?
175 views
Problem : Facing following issue related to list in Python given that a refers to a list, write the necessary code to reverse the elements of the list.
6 views
Problem: I was trying to solve a problem in Codility provided below, Write a function: class Solution { public int solution(int[] A); } that, given an array A of N integers, returns the smallest positive integer (greater than 0) that does not occur in A. For example, given A = [1, 3, 6, 4, 1, 2], the function ... for (int i = 0; i < N; i++) { if (C[i] != 0) { return (i + 1); } } return (N + 1); }
7 views
Problem: Is anyone available to assist me and resolve this issue > Java write an expression to detect that the first character of userinput matches firstletter.
1 vote
4 views
Problem: Can anyone tell me the solution of this problem? write an expression to detect that the first character of userinput matches firstletter.