File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes class name of java arrays Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "class name of java arrays " Watch "class name of java arrays " New topic

class name of java arrays

Chris Wox
Ranch Hand

Joined: May 25, 2006
Posts: 34
int[] a = new int[4];

the above line is declaring and instantiating an array object .

Could someon please tell me what is the class name of the above object ?
since as i understand every object in java is an instance of the class .
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2398
The name is [I

You can find the name of an object like this.

[ June 15, 2006: Message edited by: Keith Lynn ]
Chris Wox
Ranch Hand

Joined: May 25, 2006
Posts: 34
thanks for the reply

but now i have another question

in the code getClass().getName()

getClass() is a method in the object class which Returns the runtime class of an object

but i couldnt find anything about getName(), is it also a method in Object class ?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63873

Think about it for a moment. If getClass() returns an instance of Class, then which object is the getName() operating upon? The original Object instance, or the returned Class instance?

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: class name of java arrays
jQuery in Action, 3rd edition