shouldn't not matter if their running independantly or not.

i don't need the threads to display ping or pong in any order

If they are independent they can print at the same time every 10 secs.

Then how do i make them tell eachother when to start

You need to have one Object that they both use as a monitor to lock with the wait and notify methods.
See the API doc for the wait() method for some ideas. To use wait() you must have a lock on the object which you can get by synchronizing on it.

I would but, I'm doing this for an assignment.

Write a PingPong class that implements the Runnable interface and will write ping or pong in a console window. Have it print the word (ping or pong) at least 10 times before it terminates.

Write a program that creates and runs two threads using the PingPong class. One that prints ping, one that prints pong.

Additional Notes:

• The PingPong class should print ping or pong only. It should not even be able to print anything else. You can use the constructor to set up which it prints (ping or pong).
• Use a loop in the PingPong class to print at least 10 times and have the thread sleep for at least 10 seconds each time through the loop.
• The main program should create and run two instances of the PingPong class, one that does ping and one that does pong.

Have you solved the problem now?

Nope. I was just posting what the assinment was

Where is your problem now?

It's still the same. What I posted earlier was just the assingment for the thread program I wrote.

Does it do what the assignment requires?

Technically yes but, I need the threads to sleep for 10 seconds before printing ping or pong

The call to sleep() should have them do that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.