Skip to content

Value for Int[]

Featured Replies

I would like to know how I get the value of a list, for example I configured a list like this 100;100;100;30;30, I just want to retrieve the values 100 and get the value of 3 as would be done by an int[ ] ?

int[] a = new int[]{10,20,30,40,50};

int b = i[0]; // b = 10

int c = i[2]; // c = 30

 

Edited by BruT

Your question is a bit unclear, if you're looking for a value at a specific index in the list, you may use List.get(index) method. It's similar to what you would use in an array, for example if you want the 2nd element of an array you would use: array[1], if you want the same element from a list you would use: List.get(1). Remember that for lists, like arrays, index starts from 0 and not from 1.

 

 

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.