Hypothetical Scenario:

Lets say that, I need to find a way to delete an image from a list of images in a Java program. I go online to learn how to delete an image programmatically, and as I am searching the web on how to do this, I notice that multiple websites (non affiliated with each other) are teaching a very similar way to do this exact thing.

What should I assume is the copyrightability of such code being presented on these websites?

  • Do you mean 'method' as in several steps, that probably employ creativity (required for copyrightability, by the way), or do you mean 'method' as in a method on a class. For example System.out.println("hi") is a method call.
    – Brandin
    Apr 23, 2020 at 8:36
  • The fact that you've claimed that this is 'hypothetical' makes it much, much less useful, and much, much less answerable. If you have an actual thing that you are asking about, you will get a much better answer. Most likely if you find an actual instance of what you are talking about, it will become clearer and clearer whether or not that code is copyrightable. But if you just leave this as 'hypothetical' all we can say is 'maybe' or 'maybe not'. Who knows?
    – Brandin
    Apr 23, 2020 at 8:38

1 Answer 1


It has been held that

if there is only one way to express the idea in software, that one implementation is not protected ... If an implementation must be done in a particular way, there is no room for creativity, which means the implementation is not protected by copyright.

But that source goes on to note that

[t]his is rare; even with trivial programs like "Hello, world" a programmer can usually choose equivalent instructions to print the text, or to start and stop the program.

Moreover, that doctrine is not well-established everywhere. So even if you were to conclude that you see that code snippet everywhere because it's the only way to delete an image from a list in Java, you're treading on shaky ground reusing it under such terms. It's not indefensible, but I'd hesitate to rely on it myself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.