This program is showing a error marked in the image as red underline. I cant understand that why it occurred. Can anyone suggest me anything?
Asked
Active
Viewed 32 times
-2
-
Check what the error is! Look in the problems tab or hover over the underlined part or the X in the left bar. – CherryDT May 15 '20 at 02:44
-
If you had posted the code here as text, then someone could tell you immediately. – Scary Wombat May 15 '20 at 02:44
-
`new Thread1().new MyThread("First")` – Aniket Sahrawat May 15 '20 at 02:45
2 Answers
0
You are getting a compilation error because you are referring to a non-static member from static context.
add static
before the class declaration
static class MyThread extends Thread

A G
- 297
- 1
- 7