Questions tagged as 'array'

2
answers

ArrayList x List

What's the difference between declaring ArrayList and List for lists in Java ? What are the advantages of using one or the other?     
asked by 09.07.2015 / 13:08
5
answers

What is actually the array?

Initially, it seems like a silly question. But my goal here is to come up with a more concrete concept about array . In languages such as JavaScript, array is an object that allows you to add and remove members to a sort of list. This list...
asked by 21.04.2017 / 16:49
3
answers

Working with lists without using Array () in PHP

I know that in PHP for almost every type of list, we work with Array() , but is this the only way to work with lists in PHP? Is there any other way to work with lists of objects in PHP, similar to the Collections classes ( List ,...
asked by 26.01.2016 / 14:33
3
answers

Why in Java is the size of an array an attribute of a String and a method?

In Java, the size of an array of any object can be obtained with length , which would be an attribute. But in the case of String is length() , a method. However, if you have a array of String , it uses length ,...
asked by 31.05.2017 / 02:18
1
answer

How to sort array of strings disregarding accents?

If I have an array like this: exemplo = ["Árvore", "Casa", "Computador", "É", "Poste", "Pássaro", "Índia", "Ar", "Ásia"] The exemplo.sort() considers the accentuation of the words to sort, putting the accented ones last: exemplo.so...
asked by 20.05.2014 / 23:45
1
answer

What is the purpose of Array and String Dereferencing implemented in PHP 5.5?

In the PHP manual, we can see the New Features functionality of Array and String literal Dereferencing . Example: echo 'string'[2]; // r echo ['stack', 'overflow'][1]; //overflow Thinking about whether to get a index from a strin...
asked by 03.07.2014 / 18:09
6
answers

Code refactoring to convert GPS coordinates in DMS format into an array

You can enter the GPS coordinates in two ways, Decimal Degrees or Degrees, Minutes, Seconds : ┌─────────────────────────────────┬─────────────────────┐ │ DMS (Degrees, Minutes, Seconds) │ DD (Decimal Degree) │ ┌────────...
asked by 10.01.2014 / 17:09
3
answers

Why Arrays start at 0 instead of 1 [duplicate]

Why arrays start at 0 instead of 1? There are not 0 people, 0 animals, 0 nothing ... (do not cling to this part) What is the purpose of doing this? I think it's not just me who does not understand the logic of it, if at all.     
asked by 12.02.2018 / 00:41
3
answers

How to choose the largest value of an array?

I'm trying to use the max function, but I can not get it right. // variáveis da diferença salarial $saldev[0] = $_POST ["Tdate5"]; $saldev[1] = $_POST ["Tdate9"]; $saldev[2] = $_POST ["Tdate13"]; $saldev[3] = $_POST ["Tdate17"]; $salde...
asked by 21.04.2015 / 06:44
3
answers

What is the difference between function and assignment for array?

I have recently made codes in my projects where I need to add items to an array, so I do not know if I should use native language functions like this: array_push($meu_array, 50); or simply assign the value, for example: $meu_array[] = 50;...
asked by 05.01.2018 / 17:30