wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes array of object 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 "array of object" Watch "array of object" New topic
Author

array of object

abalfazl hossein
Ranch Hand

Joined: Sep 06, 2007
Posts: 635

There is error in creating array. why?



Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19654
    
  18

Did you put this code in a method or constructor? Can you post the compiler error?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
James Elsey
Ranch Hand

Joined: Dec 21, 2007
Posts: 228

The bottom half is outside of the class, do you mean to put it inside its own method or in a constructor?

Please tell us what you want to do, and we can answer better


Kind Regards, James. OCPJP 1.6 || My SCJP / OCJCP Study Notes
Interested in : SCJP, Google App Engine, Stripes, Android;|| My Bite-Size SCJP Study Blog
Shanky Sohar
Ranch Hand

Joined: Mar 17, 2010
Posts: 1051


see this should work fine



SCJP6.0,My blog Ranchers from Delhi
Shanky Sohar
Ranch Hand

Joined: Mar 17, 2010
Posts: 1051

in Java,Everything should be there inside a class.
Class acts like a template that describes the kinds of state and behavior that objects
of its type support
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: array of object
 
Similar Threads
Using String
how to compare if object exists in arraylist and add if doesn't
Search Method . Passing values Problem
String is in String array or not ?
sort the String values in String array?