Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

how to read returned arraylist from another class method

import java.util.ArrayList;
public class numbers {
   private int number1 = 50;
   private int number2 = 100;
   private List<Integer> list;

   public numbers() {
       list = new ArrayList<Integer>();
       list.add(number1);
       list.add(number2);
   }

   public List<Integer> getList() {
       return list;
   }
}
Comment

how to read returned arraylist from another class method

import java.util.ArrayList;
public class test {
   private numbers number;

   //example
   public test() {
     number = new numbers();
     List<Integer> list = number.getList();
     //hurray !
   }
}
Comment

PREVIOUS NEXT
Code Example
Java :: open application programelly android studio 
Java :: firemonkey android ini file 
Java :: how to create a udp protocol for transfer a big quantity of files java 
Java :: java scanner use all symbols as delimiter 
Java :: stream get double value from map 
Java :: exception(string message throwable cause) 
Java :: public class Hello { public static void main( String[] args ){ System.out.println("Hello World"); } } 
Java :: How to code the Fibonacci Sequence using simple iterative loops java 
Java :: password = sdf345 password.isalpha() java 
Java :: how to get address of object in java 
Java :: android java how to clear or close cursor 
Java :: add words from string to collection java 
Java :: como detener un void java 
Java :: intellij evaluate expression 
Java :: jsp form upload image 
Java :: make form items vertica 
Java :: set bean properties 
Java :: reset android studio settings windows 
Java :: is java good then c++ is good 
Java :: call method of another class without creating instance in java android 
Java :: staging and production environment logging spring boot 
Java :: least count of words required to construct a target string 
Java :: java anomymous code block 
Java :: convertir un float en int en java 
Java :: 4 byte timestamp java 
Java :: how to initlize a new collection 
Java :: nsxt resource relationships in java 
Java :: okhttpconfig 
Java :: java windowbuilder launch on second monitor 
Java :: could not find or load main class org.apache.catalina.startup.bootstrap caused by: java.lang.classnotfoundexception: org.apache.catalina.startup.bootstrap 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =