Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Garbage Collector program does not run

 
tushar panda
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i run the code below given in K&B book , to find memory deallocated it runs perfectly and gives output




but when i write a similar code , given below



i get a error



why so ? only changing class name gives this error ? is CheckGC a predefined class ?
 
Henry Wong
author
Marshal
Pie
Posts: 20892
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why so ? only changing class name gives this error ? is CheckGC a predefined class ?


Question. When you changed the name of the class, did you also change the name of the source file, and recompile?

Henry
 
Henry Wong
author
Marshal
Pie
Posts: 20892
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Exception in thread "main" java.lang.NoClassDefFoundError: garbage/java



Oh.... did you happen to run it as....

> java garbage.java

instead of ...

> java garbage

Henry
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic