Java Bug?
Hello
I have a problem when i make applets.
When i make an applet called lets say: Game
And i make some change in the source code in Game.java and compile again to update the change nothing happens.
But if i make a new file called Something else lets say Game2.java and copy the source code from Game.java but change the class name to Game2 it works. I dont know why.
Should it be like this that everytime i want to change something in my code i need to change the class name and make a new file?
Please Reply
This is not a Java bug. This well known behaviour is caused by browser cacheing.
You can get around this in two ways.
1) Restart your browser
2) Use appletviewer
Please next time, when you think you have found a bug in Java stop for moment, realize that you have found no such thing and use Google to search for people who have had the same issues as you.
> It's amazing how many people with 2 days worth of experience
> can find a bug in a language that was developed
> by people who have 20 or 30+ years of experience.
People with 20 or 30+ years of experience make actually more bugs than people with 2 days worth of experience ;-)
They make more things anyway incuding some bugs sometimes.
> This is not a Java bug. This well known behaviour is
> caused by browser cacheing.
>
Indeed, here's a real Java bug: http://www.heathwood.org/SIMPSON/quicklinks/ls/animalsoftherainforest/javaleaf.htm
> True but the point I was trying to make was those
> bugs will have been found and fixed. I highly doubt a
> person with 2 days experience will be able to find a
> bug that a person with 30 years experience couldn't.
they could accidentally stumble onto them of course, especially in areas of code that are rarely executed by experienced people because they're so obscure that noone uses them except in homework assignments.
> Indeed, here's a real Java bug:
> http://www.heathwood.org/SIMPSON/quicklinks/ls/animals
> oftherainforest/javaleaf.htm
"There is a bug in the ant farm."
"Which ant farm? I do not see any!"
"Well, that is the bug."
> You can get around this in two ways.
>
> 1) Restart your browser
>
> 2) Use appletviewer
In three ways, as the OP already found:
3) everytime you want to change something in your code change the class name and make a new file
Because in this case there's no cache to load. ;-)