Results 1 to 3 of 3

Thread: Cystom class in an array?

  1. #1

    Thread Starter
    Member
    Join Date
    May 2008
    Posts
    36

    Cystom class in an array?

    I was wondering if it was possible to put a custom class in an array. So that way you could do like:
    Code:
    //something.java
    class something {
    boolean visible;
    int x,y;
    }
    
    //blah.java
    //...
    something[4].x = 40;
    something[4].y = 30;
    something[4].visible = true;
    //...
    Last edited by MountainDew7; Apr 14th, 2009 at 04:23 PM.

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: Cystom class in an array?

    yes it's possible
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  3. #3
    Hyperactive Member pgag45's Avatar
    Join Date
    Mar 2007
    Location
    Colorado
    Posts
    262

    Re: Cystom class in an array?

    Would be better practice however to work more OO. Create methods and private variables to abstract actually changing private data explicitly when working outside the class.

Posting Permissions

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



Click Here to Expand Forum to Full Width