This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes How to use Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to use" Watch "How to use" New topic
Author

How to use

James Tharakan
Ranch Hand

Joined: Aug 29, 2008
Posts: 580

I just came across this statement

Object c = new long[4];

How do i use use this .
please explain


SCJP 6
Why to worry about things in which we dont have control, Why to worry about things in which we have control ! !
Satish Chilukuri
Ranch Hand

Joined: Jun 23, 2005
Posts: 266
An array is a subclass of Object. To use the variable as an array just do cast and use it.
long[] array = (long[])c;
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to use
 
Similar Threads
Basic authentication without a secure connection
Class Object References
using xerces parser instead of crimson
Class Object References
Object References in Array