1

I was trying to implement singleton pattern in Robocode. But unfortunately, when new round starts, every time a new object (which is singleton) is created.

Do you know if it is possible to use singleton pattern in Robocode? If not, could you explain me why?

Kris
  • 1,538
  • 2
  • 16
  • 27

1 Answers1

2

I believe that Robocode is designed such that each robot is created via it's own ClassLoader, so unfortunately singletons wouldn't be possible except within a robot.

James Curtis
  • 146
  • 6