All Questions
52
questions
-1
votes
2
answers
76
views
Java - from Array to linked ArrayList why it doesn't affect all int values?
I am studing Java, i have simple Array linked to ArrayList, it is fixed size i can change values inside array or list without change length.
So i tried to change all elements of the Array to see ...
-3
votes
1
answer
366
views
How can I save only some elements of a List in an ArrayList? [closed]
I tried to do this, but the add in the line arrayList.add give me an error
List <Recipes.Results> list;
ArrayList <Recipes.Results> arrayList;
arrayList = new ArrayList&...
-1
votes
4
answers
3k
views
How to find duplicates in a list of list of objects in java
Let's say I have a data in an Array List of objects compositeKeyValues = [["READ", "3GPP_ACCESS"], ["CREATE", "NON_3GPP"], ["READ", "3GPP_ACCESS&...
-3
votes
1
answer
146
views
class function to remove value from array list object
I am trying to write a class function that removes the first occurence of e (int number) from my array list and for it to return True but if no occurence then return false without adjustment to my ...
0
votes
1
answer
1k
views
Appending a list to a class object (python)
Unable to execute following code with the below class:
Expected result = [1, 2, 3, 4, 90, 25] Given result = <main.ArrayList object at 0x7f9f1439acd0>
How can I stop this from happening? Without ...
0
votes
1
answer
2k
views
C# accessing element of object from List<> using for loop instead of foreach
trying to brush up my foundation on C#. How do I print the value of objects from a List? I have a List and wants to print out the Name and Age to console.
I can use foreach loop to print them out ...
0
votes
1
answer
957
views
return null when List<Object> is empty error: [return.type.incompatible]
I am trying to return null when List is empty:
public List<Object> extractOutput(List<Object> accumulator) {
if (accumulator.isEmpty()){
return null;
}
return accumulator;
}
But ...
0
votes
1
answer
2k
views
[Ljava.lang.Object; cannot be cast to java.util.Collection
I am trying to implement Array_AGG as CombineFn,
Below is my code:
public static class ArrayAggArray extends Combine.CombineFn<Object, List<Object>, Object[]> {
@Override
...
0
votes
1
answer
133
views
How to sort ArrayList of objects by alphabetical order of property
I have an ArrayList of People, with every person having their names or ages.
So, I'll be adding new people to this ArrayList and I want to sort it alphabetically.
For example:
ArrayList<Person> ...
0
votes
2
answers
369
views
How to set a value of List object into another List object?
I have one POJO. Let's call it TrackingDetailDto. Here the member variables of this POJO.
OrderDto orderDto;
private String awbNumber;
LogisticProviderServicesDto logisticProviderServicesDto;
List<...
-1
votes
1
answer
87
views
Java print the Value List [duplicate]
Hello i m searching for solution to how see the valus exists at my list ,
code :
public Iterable<RfpActiveObject> getactive(){
List<Rfxobject> rx = rfx.findAll();
List<...
1
vote
2
answers
83
views
how to add two objects?
I have two classes:-
public class Employee {
private String name;
private String DOB;
private String techicalSkill;
Employee(){
}
Employee(String name, String DOB, String ...
1
vote
2
answers
543
views
group inside a list of objects and modify
I got a list from a class like this:
List<clsLinkObject> FinalValsLinks = new List<clslinkObject>();
and the class contains:
public class clsLinkObject
{
public string ...
0
votes
1
answer
371
views
How to send an JSON array to another method
I am fetching an JSON response from an API.
I should return those JSON response to another method with selected fields
Here I am fetching all the JSON response and putting it to an JSONArray which ...
0
votes
1
answer
48
views
Values assigned to a Java List inside a for loop are replaced by same object(object at index 0) after the for loop ends [duplicate]
I am creating an Object inside a for loop and adding it to a list as illustrated in the code below. The values are distinct and different when logged inside the for loop how ever once the loop ends, ...