aspose file tools*
The moose likes Beginning Java and the fly likes array objects? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "array objects?" Watch "array objects?" New topic
Author

array objects?

Brad Dwan
Ranch Hand

Joined: Apr 22, 2010
Posts: 62
Just wondering if is at all possible to 'store' an object within an array?


At work (hence can't test it) and was just thinking about it, thought this would be a good question to ask people with a bit more experience.

-Nev
"It's about choosing your battles, not fighting somebody else's war"
Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 629

Yes you can store objects in an array


Life is easy because we write the source code.....
Brad Dwan
Ranch Hand

Joined: Apr 22, 2010
Posts: 62
Pramod P Deore wrote:Yes you can store objects in an array


Appreciate it
Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 629

In class Test array t is created which store 3 objects.
Brad Dwan
Ranch Hand

Joined: Apr 22, 2010
Posts: 62
Pramod P Deore wrote:In class Test array t is created which store 3 objects.


Very nice, thank you for your help.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

welcome to javaranch
Brad Dwan
Ranch Hand

Joined: Apr 22, 2010
Posts: 62
Seetharaman Venkatasamy wrote:welcome to javaranch


cheers mate Studying Bachelors of Computing and the first two years are based on Java, then a year of C++. Kind of strange really, would've thought that C++ would be more dominant. I've done a lot of PHP in my time so OOP and procedural programming, although I'm not used to such a 'strict' language, so it's a nice change
Himanshu Gupta
Ranch Hand

Joined: Aug 18, 2008
Posts: 598

Arrays unlike Collections can store anything which means: Objects and primitives .
The only problem which I see with arrays is the compulsion of knowing the size before when creating its Object but on the other hand Collections gives us a lot flexibility .

My Blog SCJP 5 SCWCD 5
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Brad Dwan wrote:would've thought that C++ would be more dominant.

Why? It hasn't been, for some time now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: array objects?