Java - How to access an ArrayList of another class?

后端 未结 5 512
感动是毒
感动是毒 2020-12-23 18:11

Hello I\'m a beginner in Java and this is my question: I have this first class with the following variables:

import java.util.ArrayList;

public class number         


        
5条回答
  •  天涯浪人
    2020-12-23 18:53

    Two ways

    1)instantiate the first class and getter for arrayList

    or

    2)Make arraylist as static

    And finally

    Java Basics By Oracle

提交回复
热议问题