Search:

Type: Posts; User: javapenguin

Search: Search took 0.11 seconds.

  1. Replies
    10
    Views
    1,615

    Re: Not sure where/what my error is.

    If you do want alphabetical order, and as long as you don't have duplicates, you can

    TreeSet<String> tSet = new TreeSet<String>();

    // for each person
    String str = p.getName();
    tSet.add(str);...
  2. Replies
    10
    Views
    1,615

    Re: Not sure where/what my error is.

    The people's name or the Person themselves?

    There is a class called ArrayList<aClass> which works like an array in that it uses arrays internally but creates new arrays when it exceeds a certain...
  3. Replies
    10
    Views
    1,615

    Re: Not sure where/what my error is.

    Let's see what this does:



    public class Person {

    private String forename;
    private String surname;
    private int age;
    private String personID;
  4. Replies
    10
    Views
    1,615

    Re: Not sure where/what my error is.

    Person(johnSmith001, "John", "Smith", 43);//Error here, on "Person("

    Person p = new Person(Person x, "John", "Smith", 43);

    Ok, you don't have a variable called ID.
Results 1 to 4 of 4