• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

array of object

 
abalfazl hossein
Ranch Hand
Posts: 635
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

There is error in creating array. why?



 
Rob Spoor
Sheriff
Pie
Posts: 20610
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you put this code in a method or constructor? Can you post the compiler error?
 
James Elsey
Ranch Hand
Posts: 228
Android IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Shanky Sohar
Ranch Hand
Posts: 1051
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

see this should work fine


 
Shanky Sohar
Ranch Hand
Posts: 1051
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic