• Post Reply Bookmark Topic Watch Topic
  • New Topic

Array problem  RSS feed

 
Jay Kamdar
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to make one spot in an array, immutable and the rest normal but i can't create another array.

I am trying to make a fish in the marine biology case study that will always stay in the environment's array and can never be deleted.
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think there's a way you can do that with an array.

I would try putting that array inside a class definition and then controlling access to that array.
 
Al Hollis
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if(tryingToEdit == cantEdit)
{
System.out.println("CANT EDIT THIS FISH MAN");
}
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!