Posts

Showing posts from September, 2015

Arrays in Java

Hello Guys.... This is my second post and in this i am going to talk about Arrays in Java Programming Language. So let's get started:- 1-D Array There are two ways of declaring 1-D array in java :- 1st Method (without using the new keyword) :- Consider this code :-  When we  run this code in a file named array.java we get the output as follows :- Months -  1 2 3 4 5 6 7 8 9 10 11 12 2nd Method (using the new keyword) :- Consider this code :- When we run this code in a file named array.java we get the output as follows :- Rahul Malhotra is a coder   2-D Array    We can declare the 2-D array in java also by two methods :- 1st Method (using the new keyword) :- The declaration of the 2-D array is the same by the two methods that we just discussed in the 1-D array. The main feature that Java provides in the 2-D array is that, out of the two attributes, one attribute is fixed and other can vary.... Let's learn wi