Blog Introductions

In this  blog contains tutorials about  HTML Tutorials, Python Tutorials, CSS Tutorials, How to, PHP Tutorials, Java Tutorials, C++ Tutorials, Tutorials,  Examples, Source code,Learning,
Tips and Software development  services. Java Arrays and their function | Java tutorials Bestitworriors



Java Arrays and their function 

Java tutorials
Java tutorials



Arrays use to hold same type of multiple data in it.When your requirements of having multiple variables and storing large amount of data you need to use array .It will be difficult to store ten values into declearing ten variables and then assign one by one value to ten variables.It will be time consuming and use multiple line of code.Now for overcome this situation you need to implement the java arrays to hold same type of different data in it.


Some Key Points of Java Arrays

  1. Java arrays hold same type of multiple data
  2. Arrays same time and reduce lines of codes
  3. You can access array data using loops
  4. Array can also access by index of current value
  5. You can modefy array from the index
  6. You can perform multiple task in an array
  7. You can get the length of array using arrayname.length

Code

public class arrayss {

public static void main(String[] args) {
int[][] myNumbers = { {1, 2, 3, 4}, {5, 6, 7} };
for (int i = 0; i < myNumbers.length; ++i) {
for(int j = 0; j < myNumbers[i].length; ++j) {
System.out.println(myNumbers[i][j]);
}
}
String[] Month = {"January", "Feburary", "March", "April"};
for (int i = 0; i < Month.length; i++) {
System.out.println(Month[i]);
}
System.out.println(Month.length);

}
}





Out Put


1
2
3
4
5
6
7
January
Feburary
March
April
4


I hope You really enjoyed this blog . I try my best to make every thing is easy and helpfull to provide to public .You will get more blog about the Programing project and code . Thanks for visiting my blog if you have any querry related to this you can comment here i will try my best to response you back about Java Arrays and their function | Java tutorials Bestitworriors.