Solved HashMap external class

Discussion in 'Plugin Development' started by NoSpanMan, Apr 5, 2015.

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

    NoSpanMan

    How can i connect my first class where the hashmap is with the secondary that i can use the hashmap in the secondary class.
     
  2. Offline

    mine-care

    Is this thread really solved? if yes please provide your answer for anyone else that has a similar question (future reference)
     
  3. Offline

    nverdier

    @NoSpanMan Assuming this is not solved, here's how:
    You pass an instance of the first class to the second class. In the first class have a getter that returns the HashMap. Then in the second class, have a constructor that takes a first class and save that to a field (firstClass). You can then use firstClass.getHashMapMethodHere()

    https://docs.oracle.com/javase/tutorial/java/javaOO/constructors.html For more info.
     
    mine-care likes this.
  4. Offline

    NoSpanMan

    I have already connected the 2 classes with plugin. and i typed plugin.<namehashmap>
     
Thread Status:
Not open for further replies.

Share This Page