Changing one actor seems to change all of them

It compiled and it is still wrong

Changing one actor seems to change all of them

This page is part of Intro to Java with Greenfoot. It assumes you have reached lesson 1.3. Opening it is not counted against you and is not tracked as progress.

What it actually means

Usually it does not, and what you are seeing is every object running the same behavior at the same time.

The usual causes

Ranked by how often each one turns out to be the answer. Work down the list.

  1. Every object of a class runs the same act() body, so they all move identically.
  2. You used a value shared by the class rather than per-object state.
  3. They all started in the same place, so they look like one actor.

How to fix it

Check whether they are really identical or just doing the same thing. Every object of a class runs the same act() body, so identical behavior is expected. If you need them to differ, give each one its own instance variable, which is lesson 3.8.

Get in Touch

Whether you're a student, parent, or teacher — I'd love to hear from you.

Just want free AP CS resources?

Enter your email below and check the subscribe box — no message needed. Students get daily practice questions and study tips. Teachers get curriculum resources and teaching strategies.

Typically responds within 24 hours

Message Sent!

Thanks for reaching out. I'll get back to you within 24 hours.

🏫 Welcome, fellow educator!

I offer curriculum resources, practice materials, and study guides designed for AP CS teachers. Let me know what you're looking for — whether it's classroom materials, a guest speaker, or Teachers Pay Teachers resources.

Email

[email protected]

📚

Courses

AP CSA, CSP, & Cybersecurity

Response Time

Within 24 hours

Prefer email? Reach me directly at [email protected]