Results 1 to 2 of 2
  1. #1
    rgvbabe is offline Member
    Join Date
    Jan 2008
    Posts
    1
    Rep Power
    0

    Default arrays strings and doubles

    Hi all !!

    am struggling a bit.

    i am trying to do a multi dimensional array for the object Person with strings for name and category and doubles for heights.
    can anyone tell me if :
    public Person(String firstName, String surname, String Category, double heightInitial, double height3yr, double height5yr )

    Will work????


    HELPPP

  2. #2
    CaptainMorgan's Avatar
    CaptainMorgan is offline Moderator
    Join Date
    Dec 2007
    Location
    NewEngland, US
    Posts
    835
    Rep Power
    9

    Default

    As that is exactly - no. First, where does your multi-dimensional array come into play? Lastly, I assume the code you're writing is a definition and therefore is a constructor's definition - not a call to a constructor, yes? So, write its definition... something to the effect of:
    Java Code:
     public Person(String firstName, String surname, String Category, double heightInitial, double height3yr, double height5yr) {
      this.fName = firstName;
      this.surname = surname;
      this.category = Category;
      this.heightInit = heightInitial;
      ...
      ...
      ...
    }
    And btw, Welcome to the Java Forums. See you around.
    Vote for the new slogan to our beloved Java Forums! (closes on September 4, 2008)
    Want to voice your opinion on your IDE/Editor of choice? Vote now!
    Got a little Capt'n in you? (drink responsibly)

Similar Threads

  1. Subtracting Strings
    By ravian in forum New To Java
    Replies: 7
    Last Post: 10-08-2009, 07:26 PM
  2. Help with Vectors and Strings...
    By kaban in forum New To Java
    Replies: 2
    Last Post: 12-09-2007, 10:04 AM
  3. Comparing Strings
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-03-2007, 10:44 AM
  4. reversing Strings
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-11-2007, 09:24 PM
  5. how to compare two strings
    By elizabeth in forum New To Java
    Replies: 7
    Last Post: 08-06-2007, 04:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •