English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories
0

Has anyone heard of RuneScape? If not, it's basically a Java 3D MMORPG. And in it, if you drop an object on the ground, after a while it gets deleted. How would I delete an object? I read you do it by making the object have no references to it, but how would I do that? Thanks.

2007-03-16 17:37:17 · 2 answers · asked by Need answers! 1 in Computers & Internet Programming & Design

2 answers

if you have

Object obj = new Object();

after doing some task with it

obj = null;

is enough to make no references to the object previously referenced by obj.

The RuneScape effect you mentioned is a finalizer method; Java and C# (the parallel is called destructor directly after what C++ calls and syntax) the books on those two languages make a fuss about it not predictable in when gets called from something call garbage collector, so you can only say "after a while" not able to time it exactly.

You put the stuff you want to do as the object is gone; in RuneScape's case codes to make it disappear from screen.

2007-03-16 18:02:55 · answer #1 · answered by Andy T 7 · 0 0

Where to get your cat

Gertrude, who lives just west of Varrock, is a bit of a cat fanatic. Her own cat, Fluffs, also provides her with regular litters of kittens. In order to own a kitten, or any other type of cat, you must have completed the Gertrude’s Cat quest. When you complete this, Gertrude will give you your first kitten.

If you lose your kitten, or you want a new kitten later on, come back to Gertrude and she will sell you one for 100 coins.

http://www.goldrunescape.com

2007-03-19 03:48:18 · answer #2 · answered by ijuhy 2 · 0 1

fedest.com, questions and answers