I am writing a simple program to explain thread.
Why does it show me the below errors.
Can anyone help me please.
public class Myth extends Thread {
public void run() {
int val=65;
try {
for(int i=0;i<26;i++) {
System.out.println((char)val);
val++;
sleep(500);
}
}
catch(InterruptedException e) {
System.out.println(e);
}
// error pops up on this bracket saying class interface or enum expected.
// error in this line says-- illegal start of expression
public static void main(String args[]) {
Myth obj=new Myth();
obj.start();
}
}
}
You have to balance the pair of opening and closing
curlybraces.