push Summary Adds an element to the end of the array. Signatures Click on a signature to select it and view its documentation. public int push(T element) public int push(...T element) Usage public int push(T element) public int push(...T element) Returns The size of the array after the new element was added. The size of the array after the new element was added. Parameters element The element to add to the end of the array. Parameters element The elements to add to the end of the array. Description Adds an element to the end of the array and returns the size of the modified array. This method mutates the array. Adds elements to the end of the array and returns the size of the modified array. This method mutates the array. Examples Basic Usage 123456import System; int[] arr = [ 1, 2, 3, 4 ];Console.log(arr.last()); // 4arr.push(5);Console.log(arr.last()); // 5 Basic Usage 123456import System; int[] arr = [ 1, 2, 3, 4 ];Console.log(arr.last()); // 4arr.push(5, 6, 7);Console.log(arr.last()); // 7 Share HTML | BBCode | Direct Link