Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Copying Arrays Using Assignment Operator Java

class Main {
    public static void main(String[] args) {
       
        int [] numbers = {1, 2, 3, 4, 5, 6};
        int [] positiveNumbers = numbers;    // copying arrays

        for (int number: positiveNumbers) {
            System.out.print(number + ", ");
        }
    }
}
 
PREVIOUS NEXT
Tagged: #Copying #Arrays #Using #Assignment #Operator #Java
ADD COMMENT
Topic
Name
5+3 =