Skip to main content

All Questions

Tagged with
0 votes
1 answer
18 views

Trying to Compute the differences in two different ArrayLists of Objects with Instance Fields of Type Integer[JAVA]

package pckg; import java.util.ArrayList; import java.util.HashMap; public class Tester { public static void main(String[] args) { ArrayList<TesterObj> my_first_objects = new ...
Dean Loyals's user avatar
-1 votes
2 answers
156 views

How to remove object from an arraylist

its gonna seem complicated but I want to make a function that removes an object from the ArrayList of an object that is in another ArrayList let me simplify it, there is a class with objects (students)...
Ahmedzaghloul27's user avatar
0 votes
1 answer
1k views

I want to get my toString method to print all the information of the objects in my array list but I am getting the output with [] brackets [duplicate]

For my code, I have tried using a toString method which I am not sure if is the best way to display information for objects in an array list. I wanted to try a normal method and then just call it but ...
JulianTheProgrammer's user avatar
-2 votes
1 answer
80 views

Sorting an ArrayList of objects using attributes of these objects (using streams) [duplicate]

I'm trying to sort an Array of song objects using a stream, the problem is I am trying to sort the list of objects using an attribute of the objects -title- which is then changing the data type of the ...
samcawly's user avatar
-2 votes
2 answers
50 views

Comparing two ArrayList's [duplicate]

I'm working on a school assignement where i have to check if certain objects from the ArrayList teKoop are not in the ArrayList mijnGames, the problem is i keep geeting this error code: Index 1 out of ...
aitsimhand's user avatar
0 votes
0 answers
220 views

How to create and print objects(with several attributes) from arraylist in java?

public class Hurricane { private String name, month; private int year; private int cat; private int pressure; private double windspeed; //constructor - all private ...
RideTheLightning343's user avatar
0 votes
1 answer
123 views

the contents of arraylist are printed using println. I want a similar functionality for my created objects without using toString() function in java

In the image above, the contents of the arraylist is printed using println. I want a similar functionality for my created objects without using toString() function in java please tell me how can i do ...
Rishu Toshniwal's user avatar
0 votes
1 answer
96 views

How do I return an object Array of Arraylists

This is the instance method from the UML diagram: public BankAccount[] getAllAccounts() The purpose of this method is to return all of the summary details of the customer's Bank Account. BankAccount ...
ckel's user avatar
  • 1
0 votes
1 answer
219 views

Why I am losing the content of my ArrayList when I switch from class to class?

I am currently having a problem and at the same time struggling about ArrayList. I am stuck when I use the ArrayList. I am working on a 3-layer program, which includes the Client, Directory and the ...
Comrade Stalin's user avatar
-1 votes
2 answers
2k views

Java Method add ArrayList is undefined for the type <OBJECT>

I am building a java program for my homework where I must add product to particular store. I have trouble when trying to add to ArrayList from Store class. I have class product as follows: class ...
Mohammad Iqbal's user avatar
0 votes
1 answer
222 views

I cant access the arraylist attribute of my object in java

So I have three classes, Employee, Event, and Main. The purpose of my program is to create a event management system where the user enters the name of the event along with the names and ID's of ...
Gjison Giocf's user avatar
-1 votes
1 answer
340 views

How do I create a Dynamic Object with a ArrayList, which can use Methods?

I got a Task for my education, and I need to program a delivery site. I have classes called "Pizza", PizzaReader2 (because 1 was just a test) and the main class PizzaApplication. So the PizzaReader ...
BlitzDodo's user avatar
0 votes
1 answer
34 views

How to get the value of a Propertie of a stored object in a ArrayList [duplicate]

I have a ArrayList with objects. When I try to get the properties of the objects in the ArrayList, the returned variable isnt exactly the value, which i before set to the variable. For example, when I ...
Konstantin.H's user avatar
-2 votes
1 answer
91 views

Does expanding arraylist of objects make a new object?

Assume we have an array list of type Employe , does expanding it's length by 1 make a new object in the list ? is the code in else statement correct? and is it recommended? public void ...
Khalil Beldi's user avatar
1 vote
1 answer
1k views

Adding a new object to an ArrayList that is an attribute of another class

I am getting an error when trying to add a new object to an ArrayList that is an attribute of another class. Let me explain. UML I do have 2 classes in my model: Equipo Jugador To simplify things ...
Adrian Danlos's user avatar

15 30 50 per page