kel dobson

Greenhorn
+ Follow
since Dec 20, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by kel dobson

Hi Guys
Problem is a java program in BlueJ, which needs to store names and ages in an arraylist for members of a "computer games club" for my college project. A second arraylist holds a list of computer games
I want to stop members "enrolling" using the same name - eg 'Fred and Fred = no' 'Fred and Freda = ok'
Classes: Member and Club. Member holds instances of members and Club is an arraylist for members
With help from others at JavaRanch I have got this side of the project running. Part of my problem (apart from being stupid!) is getting communication between two different object / classes, and to some extent
this seems compounded by BlueJ which doesn't always do what I think it should ??
I was trying to use similar syntax to a system.out.println call to return the 'anme' field from objects in the arraylist to compare with each new object in the constructor of Member.
I have been trying a method call to Club which I have called 'public void nameFromArrayList()' but the code is getting messy and I have commented out some lines I have tried just to keep it compiling and running. Anyway apologies for my code - it seems over long compared with the examples I read on these forum pages.
tia kel

[ December 23, 2003: Message edited by: kel dobson ]
20 years ago
hi
Is it OK to continue on this theme please?
sorry, but I don't understand what you mean by " . . . member does expose"??
20 years ago
I have trouble in BlueJ with anything other then a very simple test to an 'if' statement.
Can I compare a new input string with equalsIgnoreCase with a name recovered from an ArrayList object by using toString() and passing the 'name' variable back to the constructor of the first class to prevent two similar names being input?
20 years ago
Hi
Thanks for your speedy and helpful response. Thought I understood this object reference stuff but I am still confused.
Hope you don't mind but I will include my code - hope I can get the hang of the code section here!?
A further class instantiates instances of "Members" but I have populated the ArrayList with 4 examples for testing.
Similar code runs in a different project without trouble and I thought I had carefully transposed the variables and object references to the new class - but it returns the 'Class and Hash code' as you mention.
I am even more confused as the 'get method' - "numberOfMembers" correctly returns the int '4' so I think I am pointing the code to the correect class etc?
Here's hoping you can point me in the right direction?

[ December 20, 2003: Message edited by: kel dobson ]
20 years ago
Hi
trying to get output to screen terminal from an arraylist of objects using system.out.print(ln)
the terminal window prints out the membory reference used, either by java (or BlueJ), but not the fields of the object I want to retrieve
apologies for my ignorance but any advice greatly appreciated
as you will all quickly guess - I am very new to Java!!
20 years ago