All Questions
9
questions
0
votes
1
answer
2k
views
Find the largest area of various Shape objects from an ArrayList
Ideally I do not want it to be static or void. It is the only way I could get it to work at the moment.
I have a Shape superclass. It has a method of area() which I @Override in the Rectangle class ...
-1
votes
1
answer
20
views
If I make an object using a list and the same constructor, does that mean after I make it I can no longer reference it?
I've created the following code to make Region objects that have information in them. (Coordinates, election data, etc). I'm wondering if I can no longer reference these after they are put into the ...
-4
votes
1
answer
5k
views
Adding objects to ArrayList [duplicate]
This if my first question on stackoverflow. I can usually find answers myself but I'm having trouble with this one. I've got 2 objects, "Book", and "Periodical". These are subclasses to a class "...
0
votes
2
answers
2k
views
Use for each loop to print objects
so I need to use a method to print out the contents of my rectangle and circle objects. I want them formatted something like this
GeometricObject [color=red, filled=false, dateOfCreation=Wed Feb 11 ...
0
votes
2
answers
162
views
Need to load objects into an ArrayList read from a text file and output to JTextField?
I'm working on a project and I am suppose to read in the data from a text file called "stars.txt", create objects for all the sales reps in the file, load the objects onto an ArrayList and display ...
-3
votes
2
answers
108
views
Explanation of a few lines of code
I'm having a little difficulty understand these lines of code.
ArrayList<Member> results = null;
try {
results = MemberSQL.member();
} catch (SQLException e) {
// TODO Auto-generated ...
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 ...
0
votes
2
answers
106
views
Java referencing to single ArrayList instance
I have encountered a problem with the ArrayList I'm using. This is a list of objects containing sprites with a color and location that differ from each other. The list is returned successfully and I ...
2
votes
3
answers
3k
views
Displaying objects using foreach loop
I am having a problem while retrieving data from an ArrayList and displaying them into textboxs. I am getting an error: Unable to cast object of type 'Lab_9.Book' to type 'Lab_9.Magazine'. I tried use ...