You should name your file Subject.java, not Subject.
I'll let you fix the other issues. Ask if you need more help!
Good luck! :)
you should take your class name as like as your file name like if ur file name is Main than only you can save the info in Main class if your file name is subject.java than you will not able to save in main class so change the file into main and than save the data in main class .