Write a Java Program that can print all the possible Combinations of a Digital LocK Key code which consists of 3 Numbers with the following constraints: The Sum of the Numbers cannot Exceed 1000 No two numbers can be multiples of each other. Like 10 and 20 cannot be part of the Key Code. Atleast One number has to a Prime Number in the Key Code. Each Number should be greater than or equal to 1 and less than or equal to 500

Don't post homework questions. Those questions are for you to work out, so that you will learn from the experience. It is OK to ask for hints, but not for entire solutions.

-- How To Ask Questions The Smart Way by Eric Steven Raymond

start off by figuring out how to print all the possible combinations. Note that you may NOT want to start with 1-500, but maybe something simpler like 1-5 for each value.

once you do that, add the constraints one at a time, test each as you go, and compile/test OFTEN.

come back if you have more questions... the more specific the better.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors