• Register
0 votes
27 views

Problem:

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

5 3 2
7,520 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution:

a.get(0);

6 4 3
14,580 points
First element of the arraylist is a.get(0)

Related questions

0 votes
2 answers 61 views
61 views
Problem: Given the array a, write an expression that refers to the first element of the array?
asked Apr 12, 2020 ArifulIslam 7.5k points
0 votes
1 answer 23 views
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!
asked Feb 28 Code Learner 9.9k points
0 votes
1 answer 69 views
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"?
asked Feb 18, 2020 maddi86 5.4k points
0 votes
1 answer 175 views
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.
asked Nov 16, 2019 peterlaw 6.9k points
0 votes
1 answer 6 views
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); }
asked Apr 25 sumaiya simi 43.9k points
0 votes
1 answer 7 views
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.
asked Apr 23 ummeshani 10.8k points
1 vote
1 answer 4 views
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.
asked Apr 10 MUHAMMAD MUNEEB 83k points
0 votes
1 answer 52 views
52 views
Problem: How can I write a program that reads an unspecified number of integers and then prints how many numbers the user has entered and their sum without using a list or array?
asked Feb 27 Code Learner 9.9k points
0 votes
1 answer 3 views
3 views
Problem: I need to be able to print out the Student objects(all variables) in my array list. Is this possible? When I try to print it outputs this sort of thing e.g student.Student@82701e. I think it's hexadecimal or something This is my code: package student; ... public String getStudentNo() { return studentNo; } public String getEmail() { return email; } public int getYear() { return year; } }
asked Apr 23 Jack20 5.1k points
0 votes
1 answer 7 views
7 views
Problem: How do I find out if first character of a string is a number?
asked Apr 17 sumaiya simi 43.9k points