All Questions
220
questions with no upvoted or accepted answers
2
votes
3
answers
204
views
Group an array of objects based on multi keys in Javascript?
I would like to share with you an existence problem
I have array as follows
const data = [
{
"countries": ["France", "USA", "Canada"],
"city": &...
2
votes
1
answer
66
views
Troubles with opening a large data set and instantiating the data in Java
I am attempting to read from a text file of GIS data in Java, instantiate each row of data, and then sort, search and insert data into it. I keep getting issues saying "at java.util.Scanner.next(...
2
votes
1
answer
56
views
Object ArrayList within Object ArrayList extended by class java
I have created a class with a group of objects which contain strings and booleans named "Accessories"
then created ArrayList class which is then added to the list named "AccessoriesList", from there ...
2
votes
1
answer
53
views
Error during the transfering of an ArrayList<Object> from server to client
I implemented a code that permit the communication between server and client. I sent from the server an ArrayList<Object> and the client recieves it.
The problem is when I try to print my list ...
2
votes
7
answers
3k
views
Java - How to use a for each loop to check the different occurrences of a value in a list of objects
Sorry if the title isn't clear, I wasn't sure how to word it. I have an arraylist of objects and within each of these objects I store an integer value referring to a category and one referring to an ...
2
votes
1
answer
241
views
How to update a binary file
I'm creating a GUI, and I use a method "getStudentInfo()" of the Student object return data type to retrieve information from the JTextFields and storing them into the "student" object.
public ...
1
vote
0
answers
17
views
Can't add elements of another class (same package, public) to Array list. I was doing it before(im sure about it, can send code) but now i cant
I can create new Task object, ArrayList of the Task, but when I'm trying to add (early created or to create it when adding) Task object to List, it says that "Cannot access todo.Task."
I was ...
1
vote
0
answers
107
views
Store multiple datatypes of the same parent in arraylist
I have a class A which is a parent class. Then I have an unknown set of classes (let us call them B, C, D etc.) which are all child classes of A. As a common variable all Objects of A have the int ...
1
vote
0
answers
62
views
how to add object collection List to another class object list
The Stream in line three returns Collection(List) of . However, I am unable to store them directly in veggiesList. Can you help me with the best option
List<VeggieDetails> veggiesList = new ...
1
vote
0
answers
189
views
Convert multiple json object into array of object in Java
My data is currently stored in this format:
{
"label":["X","Y"],
"data":{
"site1":{
"week":[
{
"idWeek":"9",
"max":2,
"...
1
vote
2
answers
446
views
Get attributes value from sql database as user defined object in hashmap
public class Dashboard {
int REQUEST_ID, PRICE, PROCESSED;
String LOGIN_USER;
public int getREQUEST_ID() {
return REQUEST_ID;
}
public void setREQUEST_ID(int rEQUEST_ID) {
...
1
vote
2
answers
1k
views
Java - Concatenate String with method name
As you can see in this post title I have a silly question... However I wonder if there is more efficient way to deal with this kind of programming scenario that I am facing. I am programming with Java ...
1
vote
2
answers
183
views
How to search through arraylist of arraylists / polymorphic array
I am working on a graded assignment, the software contains multiple product types, electronic, book etc, each with their own arraylist, each arraylist is stored in a master array list. I am trying to ...
1
vote
0
answers
108
views
java calculating arraylist average and getting 0 all the time
I am writing a program of a library.
I have a class that represents a review of a book or a paper.
The review class looks like that:
private String review; //a review of the book or paper
...
1
vote
0
answers
92
views
How to create many different objects from one class in Java
I want to create a program in Java that is essentially a book library. I am planning on having a constructor for the class which will take in some parameters. The problem I have is with how I am going ...