File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "class name of java arrays " Watch "class name of java arrays " New topic
Author

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: 2367
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
Marshal

Joined: Jan 10, 2002
Posts: 61658
    
  67

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] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: class name of java arrays