Results 1 to 7 of 7
Like Tree1Likes
  • 1 Post By gimbal2

Thread: Array manipulation?

  1. #1
    Matrice is offline Member
    Join Date
    Jul 2014
    Location
    Mililani
    Posts
    37
    Rep Power
    0

    Question Array manipulation?

    Hi everyone,

    I know that I haven't posted or replied or even showed any activity for the last couple of weeks, and this is because I've been doing a lot of Java studying. I am back and am confused with arrays. I want to know, would they be useful for super classes and can they be inherited by subclasses and have their elements within them changed? Besides storing numbers in indices, what are arrays used for and how often do you guys utilize the arrays. Don't get me wrong, everything has a purpose, but I am just hoping to learn about what arrays mean to real people who use them daily as well.

  2. #2
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    843
    Rep Power
    6

  3. #3
    Matrice is offline Member
    Join Date
    Jul 2014
    Location
    Mililani
    Posts
    37
    Rep Power
    0

    Default Re: Array manipulation?

    Woah what's this.

    Okay, before I do though, can I get some personal insight about this topic as well?

  4. #4
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,365
    Rep Power
    6

    Default Re: Array manipulation?

    That's the wrong way around. FIRST you go through through the material, THEN you ask for personal insights on the things you don't get at that point.

    But you do effort first.
    RamyaSivakanth likes this.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  5. #5
    unsensible is offline Member
    Join Date
    Apr 2014
    Posts
    14
    Rep Power
    0

    Default Re: Array manipulation?

    Arrays are used when you want to store multiple datatypes or objects when you know what the length is going to be.

    For example, say you had 20 test scores you wanted to manipulate, you could put all of them in an array like so:
    int testScores[]={90,76,84...ect}; then you could loop through the array with a for loop to display the values, add them, subtract them, multiply, or whatever you want.

    But note that an array is a basic data structure and is not dynamic. You cannot add or delete values in an array at runtime (although values can be changed). But it does have very quick access capabilities compared to more complex data structures.
    Last edited by unsensible; 08-22-2014 at 11:23 PM.

  6. #6
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    4,034
    Rep Power
    6

    Default Re: Array manipulation?

    Quote Originally Posted by unsensible View Post
    But note that an array is a basic data structure and is not dynamic. You cannot add or delete values in an array
    at compile time (although values can be changed).
    Actually, in terms of array dynamics, you can't re-define their length (i.e. alter their size) during runtime. Compile
    time is simply when the code is compiled into byte code.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  7. #7
    unsensible is offline Member
    Join Date
    Apr 2014
    Posts
    14
    Rep Power
    0

    Default Re: Array manipulation?

    you are correct. Dunno why I put compile time

Similar Threads

  1. WAV manipulation
    By jsobel in forum Advanced Java
    Replies: 2
    Last Post: 07-07-2012, 03:39 AM
  2. String manipulation
    By lakshmibvaraprasad in forum New To Java
    Replies: 4
    Last Post: 07-16-2011, 02:41 PM
  3. Array of Objects Manipulation
    By DreamNaut in forum New To Java
    Replies: 6
    Last Post: 11-16-2010, 07:20 PM
  4. manipulation in double dimensional array
    By akulkarni1234 in forum New To Java
    Replies: 1
    Last Post: 07-19-2009, 08:37 PM
  5. Array manipulation
    By Ms.Ranjan in forum New To Java
    Replies: 9
    Last Post: 07-18-2008, 10:10 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
  •