File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes array  doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "array  doubt" Watch "array  doubt" New topic
Author

array doubt

Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1055

class Demo
{

public static void main(String args[])
int a[]=new int[2];
}


not how many object is being created for an array int a is it 2 objects?? or 1 object??


http://www.lifesbizzare.blogspot.com || OCJP:81%
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874

Vishal,
array is just a container and here it the case of array of integers. And no objects whatsoever involved in this.
Please check few tutorials.
Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1055

thankssssssssssss so muchhhhhhh
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37945
    
  22
Balu Sadhasivam wrote:Vishal,
array is just a container and here it the case of array of integers. And no objects whatsoever involved in this.
Please check few tutorials.
I think you are mistaken there.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19651
    
  18

I agree. Arrays are objects themselves as well.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Technically, they're objects. From the rest of Java-style OOP, though... meh. java.util.Arrays and java.lang.System's arraycopy (yay, consistency) shouldn't be necessary, and I've never really understood it--why did they do it like that?
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874


yep right .. thanks for the correction..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: array doubt
 
Similar Threads
array object assignment ??
Issue on arrays
Why cant we declare the size of Array in java?
doubt in arrays...
Widening Reference Conversation