Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use

 
James Tharakan
Ranch Hand
Posts: 580
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just came across this statement

Object c = new long[4];

How do i use use this .
please explain
 
Satish Chilukuri
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An array is a subclass of Object. To use the variable as an array just do cast and use it.
long[] array = (long[])c;
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic