Skip to content

Getting error in Eclipse: syntax error on token start identifier expected

I am getting a strange error while creating a simple thread program in JAVA using Eclipse. The code is:

package threadshow;

public class Thread_Show extends Thread{

public void run(){
    System.out.println("Inside the thread");

 class Thread_Definition{
Thread_Show ts=new Thread_Show();
ts.start();  //Getting the error here

I am getting error “syntax error on token start identifier expected” in the line ts.start();. Why am I getting this?

EDIT I have used the code from



Found a very bad mistake done my me. Forgot to add public static void main(String args[]) in the Thread_Definition class.

1 People found this is helpful