Click here to watch in Youtube :
https://www.youtube.com/watch?v=mNywXeGsWO4&list=UUhwKlOVR041tngjerWxVccw
ArrayDemo.java
Output
https://www.youtube.com/watch?v=mNywXeGsWO4&list=UUhwKlOVR041tngjerWxVccw
ArrayDemo.java
class ArrayDemo { public static void main(String[] args) { // declares an intArray and allocates memory for 2 int values int[] intArray = new int[2]; int i=0; for (int element : intArray) { System.out.println("Element at Index "+ i + " : "+element); ++i; } } }
Element at Index 0 : 0 Element at Index 1 : 0
https://sites.google.com/site/javaee4321/java/ArrayDemoIntArrayDefaultApp.zip?attredirects=0&d=1
See also:
No comments:
Post a Comment