Tuesday 27 October 2015

Java Tutorial : Java Array (Name of the Array Object)


Click here to watch in Youtube :
https://www.youtube.com/watch?v=7nUQTFnrT10&list=UUhwKlOVR041tngjerWxVccw

ArrayDemo.java
/*
 * In java, array is an object. For array object, an proxy class is created 
 * whose name can be obtained by getClass().getName() method on the object.
 */

class ArrayDemo
{
    public static void main(String[] args)
    {
        int[] intArray = new int[5];// declaration and instantiation

        intArray[0] = 110;// initialization
        intArray[1] = 220;
        intArray[2] = 750;

        Class<? extends int[]> classObject = intArray.getClass();
        String name = classObject.getName();

        System.out.println("name : " + name);

    }

}
Output
name : [I
To Download ArrayDemoGetNameApp Project Click the below link
https://sites.google.com/site/javaee4321/java/ArrayDemoGetNameApp.zip?attredirects=0&d=1

See also:
  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • No comments:

    Post a Comment