[Solved]Given Non Empty Array Return New Array Consisting Old Array Elements Last Element Duplicat Q37105795
Please write a JAVA program.
Given a non-empty array, return a new array consisting of the old array elements, with the last element duplicated duplicateLast([3]) [3, 3] duplicateLast(17, 1, 5]) → [7, 1, 5, 5] duplicateLast(l1, o]) [1, 0, 0] Go Save, Compile, Run (ctrl-enter) int[] duplicateLast (int] nums){ Show transcribed image text Given a non-empty array, return a new array consisting of the old array elements, with the last element duplicated duplicateLast([3]) [3, 3] duplicateLast(17, 1, 5]) → [7, 1, 5, 5] duplicateLast(l1, o]) [1, 0, 0] Go Save, Compile, Run (ctrl-enter) int[] duplicateLast (int] nums){
Expert Answer
Answer to Given a non-empty array, return a new array consisting of the old array elements, with the last element duplicated dupli… . . .
OR

