Strings and Integers in ONE array

Discussion in 'Plugin Development' started by Roelyboely12, Aug 22, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Roelyboely12

    I have a 2d array and the first 3 values must be integers but th fourth must be a string how do i achieve this?
    Code:java
    1. int i = 0;
    2. int[][] jar_array = new int[i][4];
    3.  
    4. jar_array[i][0]= loc.getBlockX();
    5. jar_array[i][1]= loc.getBlockY();
    6. jar_array[i][2]= loc.getBlockZ();
    7. jar_array[i][3]= //String[/i][/i][/i][/i][/i]
     
  2. Offline

    teej107

    Array of objects, not integers.
     
  3. Offline

    Roelyboely12

    teej107 Storing objects cause memory leaks right?
     
  4. Offline

    teej107

    Storing objects take up memory but it depends on if the object is no longer being used but the GC can't collect them. Strings should be good though.
     
  5. Offline

    fireblast709

  6. Offline

    Roelyboely12

    What do you guys recommend i need to store the material of the block for example sand

    nvm i already have a better solution for my problem :) thnx btw

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
Thread Status:
Not open for further replies.

Share This Page