From 0acd72f316774481bde4bd350b34a6e9af9dbdce Mon Sep 17 00:00:00 2001 From: Abhishek Guleri <43719098+abhishekguleri@users.noreply.github.com> Date: Sat, 23 Mar 2019 21:44:43 +0530 Subject: [PATCH] add some line to define the output add some lines to define the output --- 14 - Arrays/src/App.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/14 - Arrays/src/App.java b/14 - Arrays/src/App.java index efcef51..67d0c7c 100644 --- a/14 - Arrays/src/App.java +++ b/14 - Arrays/src/App.java @@ -1,30 +1,28 @@ public class App { public static void main(String[] args) { - - int value = 7; - int[] values; values = new int[3]; - - System.out.println(values[0]); - + // array values contains 10,20,30 + values[0] = 10; values[1] = 20; values[2] = 30; - + // print the values of the array values + System.out.println("values present in array values are as follow:"); System.out.println(values[0]); System.out.println(values[1]); System.out.println(values[2]); + System.out.println("values present in array values using for loop are as follow:"); for(int i=0; i < values.length; i++) { System.out.println(values[i]); } - + int[] numbers = {5, 6, 7}; - + System.out.println("values present in array numbers are as follow:"); for(int i=0; i < numbers.length; i++) { System.out.println(numbers[i]); } } -} \ No newline at end of file +}