Sandro_1: If you don't mind me asking, what is it you are trying to accomplish? I'd guess you were calculating the median of the data set, but you didn't specify that the ArrayList was sorted; if it isn't, then it is hard to see what you would be getting from it. What is the purpose of this?

Sorry, about it. Yes, it is sorted list. I need to find the middle of the arrayList. It is for the school. I am a student.
Thanks for willing to help me.

Now, are you looking for the middle of the ArrayList (that is, the midpoint of the data structure), or the middle of the data set (that is, the median value of the data range)? These are two rather different things.

To get the midpoint of the ArrayList, you need to divide the length of the ArrayList by two:

but there's a catch: if the ArrayList has an odd number of elements, there will be a midpoint, to either side of which will be an equal number of elements, but if it is even, then there won't be an exact midpoint and the two halves will be equal with no added midpoint element. For example:

{1, 4, 7, 11, 13}
^ midpoint element
{2, 3, 5, 17, 42, 69}
^ midpoint is between two elements

So, if you are writing (for example) a binary search routine, you may need need to determine if the ArrayList's length is even or odd before starting to work out if you have two halves, or two halves plus a midpoint.

Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...

Iam Getting An Error With try to excecute the stored procedure .

I have Have Sql database , the stored procedure like so :

USE [MPRS]
GO
/****** Object: StoredProcedure [dbo].[Search_Licenses_By_Number] Script Date: 26-Nov-16 8:06:52 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE ...

Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"