Results 1 to 5 of 5
  1. #1
    kavithas is offline Member
    Join Date
    Nov 2007
    Posts
    8
    Rep Power
    0

    Default question regarding class

    hi,

    Can any one Explain What is this line of code indicates..

    car[] car3[] = new car();

  2. #2
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    8

    Default

    This is confused.
    Java Code:
    car[] car3[] = new car();
    An array of type Car can be instantiated with
    Java Code:
    Car[] cars = new Car[3];
    cars[0] = new Car();
    cars[1] and cars[2] are both null, ie, these two elements of the cars array have not been initialized. The first element cars[0] has has been initialized.

  3. #3
    kavithas is offline Member
    Join Date
    Nov 2007
    Posts
    8
    Rep Power
    0

    Default hi

    Hi hardwired,

    is car[] indicates it contain array of cars object?



    THanks & regards
    Kavitha

  4. #4
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    8

    Default

    "car objects" - yes. For more see Arrays.

  5. #5
    kavithas is offline Member
    Join Date
    Nov 2007
    Posts
    8
    Rep Power
    0

Similar Threads

  1. Question mark colon operator question
    By orchid in forum Advanced Java
    Replies: 9
    Last Post: 12-19-2010, 08:49 AM
  2. Replies: 0
    Last Post: 04-02-2008, 07:04 AM
  3. Abstract Class question
    By maa11235 in forum New To Java
    Replies: 1
    Last Post: 01-05-2008, 10:30 PM
  4. class organization question
    By maa11235 in forum New To Java
    Replies: 0
    Last Post: 12-17-2007, 03:25 AM
  5. question about Class.forName()
    By oregon in forum JDBC
    Replies: 4
    Last Post: 08-01-2007, 04:52 PM

Posting Permissions

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