I think this is my last blog on the Reflection about Programming class. Since we already finish all the topic in this courses. So, please continue read my last activity in the class, what i have learn about 2 dimension array and combine it with method and a loop.
This week we already at the end of the chapter of this class and according to Dr Erzam after this we will focus on revised back the previous topic. For this week Dr Erzam continue on the topic 2 dimensional array. In my understanding 2 dimensional (2D) array was same like normal array but the only different was in 2D array we express the array like matrix form and the way we define the array also different from the normal array.
1. How to Declare and Create 2D Array:
int [] [] number =
{
{1,2,3};
{4,5,6};
{7,8,9};
}
or
int [] []numbers;
numbers = new int [3] [3];
numbers [0] [0] = 1;
numbers [0] [1] = 2;numbers [0] [2] = 3;
numbers [1] [0] = 4;
numbers [1] [1] = 5;
numbers [1] [2] = 6;
numbers [2] [0] = 7;
numbers [2] [1] = 8;
numbers [2] [2] = 9;
After teach us on how to declare and create 2D array Dr Erzam continue to teach us on how to write 2D array using method and loop by give us an example question and the question was like this:
Write a method that find the largest element in an int arrays.
answer:
public static int x[0], x[1], x[2],.....x[n]
{
int biggest = x[0];
for (int j=0; j<x.length; j++)
{
if (biggest < x[j])
{
biggest=x[j];
}
}
}
Next, Dr Erzam continue with teach on how to return an array from the method to the main method and for this it just a same like in the method topic. On Thursday lab session we are receiving about last lab exercise for this class which was lab 10. In the lab exercise there were 4 question that we need to done and most of the question was related to the 2D arrays. To finish this lab question it take me a time to do it since tomorrow i gonna have Mid-term test on my other subject (WISH ME LUCK GUYS!!!).
Throughout this classes i learn a lot of new things about new knowledge about Programming. Before this i just learn about economy theory but this time i was grateful to learn something new. To be honest at first, i was thought programming just like other language and sometime i was called it alien language since it hard for me to understand it but until this week i proudly said that i already master a basic on the Java programming.π
I guess that it for my last blog on this courses.
See you guys next time,
Thank you Dr Erzam and Husna (Lab Assistance) for the knowledge and everything π
Wish you guys All the Best with Life
Please check it out my other friend blog spot for her interesting story about her programming classes. Please click the link below : http://pritah05.blogspot.com/
SAIFUL IKHWAN BIN AZIZ
183802