I GOT IT! :D
Thank you very much for your help and suggestions norm, it is very appreciated!
Type: Posts; User: 93tomh
I GOT IT! :D
Thank you very much for your help and suggestions norm, it is very appreciated!
so now i have
public int findContactIndex(String firstName, String secondName)
{
int index = 0;
boolean found = false;
while(index<contactList.size() && !found)...
Yes, it will be in a method of its own, and im hoping to return the name address and all the details of that entity. Am i going to be trying to say "if firstName == fName && secondName == sName" but...
Im trying to work on the finding contact first. Also I dont know how to return an array list, ive been trying to understand it forages now but cant get my head around it. What annoys me about this is...
I was always taught in uni to use things like 'addPersonalContact' for a method, and its what i am used to. I have reposted the account code, which i missed off the last bit by accident first time....
and sorry, missed the end bit ... silly me
private int findAccount(String accountNumber)
{
int index = 0;
boolean found = false;
while(index < accounts.size()...
Would it not compile because i didnt give you the other 3 classes that are used? Because it compiles at my end perfectly.
public abstract class Contact
{
protected String fName;
...
sorry i havent replied, i tried for a couple of hours yesterday to get my head around this and got nowhere. But digging up some of my old assignments I found this piece of code, would what i am...
I know that
public String toString() {
final StringBuilder output = new StringBuilder("All Contacts:\n");
for (Contact contact : contactList) {
...
I want to search by first and last name, im guessing for finding a contact;
1. returning the full array list and then sorting the results by name
or
2. Searching through the array list only for...
Ok, so im struggling to find a 'contact' and also deleting a 'contact' in my array list. Can anyone tell me how i can do this? Thanks
import java.util.ArrayList;
public class ContactList
{...
Can you show me the syntax for a comparator class? Ive looked online for it and im not sure how to write this. Im not asking for you to write any code, but can you put it in sort of laymans terms...
All of the data are strings that are set in a different class.
I just dont know how to sort arrays by a certain string in them.
So there are 2 different contact types (called contactType and is a String) These are automatically assigned when you call either...
I have 2 different contact types- Personal and Business. I need to return both business and personal contacts seperately. I dont know why i said pull back, i meant return, my mind must have gone...
Thank you very much! And can i ask you for the syntax to pull back data in the array that has either the "personal" or "business" contact type?
Thanks again
1356
and im not certain about the variable, i didnt really know how to return an array at all, but i have another project that compiles fine with it and i tried to convert it to use it in this...
]CODE]public String toString()
{
String output = "All Contacts:\n";
for (ContactList contact : contactList)
{
output = output + account + "\n\n" ;
...
Below is a my code, and i have got as far as creating the arrays, but im not too sure how to return them. I have made an effort but got the compiling error: incomplatible types. I have hilighted this...
Fantastic! Thank you very much, seems obvious to me now haha. And dont worry, its my fault for thinking that little snippets would be enough for someone to see what was wrong with my code
Thanks a...
Sorry, i thought those parts of the code were sufficient. Here are the full classes.
public class Contact
{
protected String fName;
protected String sName;
protected String...
I dont have a static void main() in any of my classes, is this the reason it is not working, or am i completely off the ball. Sorry I'm not too great with java but im trying to understand it
Hi, i need to call a toString method in another one of my toString methods, however i am getting a compiling erroe each time, can anyone look at the code below and let me know what i have done wrong?...
Ok, so to ensure everything is working ok, i want to be able to return my data from my array list. The code is below and if anyone can tell me how i could return the data (preferabley by printing it....
Instead of using the constructor, I was thinking of using
public void createPersonal(orBusiness)Class()
But i do not know how to call this in the array list