aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Object c = new long[4]; Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Object c = new long[4];" Watch "Object c = new long[4];" New topic
Author

Object c = new long[4];

Glen Iris
Ranch Hand

Joined: Jul 13, 2011
Posts: 164

What is this line of code doing:



Why are the square brackets used "[]" ?


OCPJP 6, OCMJD
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3647
    
  17

You are creating a new array of long, with length 4, and assigning it to an Object variable. Recall that arrays are objects too.

You know about arrays, right?
Glen Iris
Ranch Hand

Joined: Jul 13, 2011
Posts: 164

Thanks Stephan.

I had studied too much yesterday. That line of code made no sense to me. All is clear after a good nights sleep. Thanks again. :-)
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3647
    
  17

We all have moments like that. Happy to help
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Object c = new long[4];