In vs code I hit Ctr+N and then Ctr+Shift+S,which is the sortcut for the \'save as\' option . When I try to save a file as .java , it saved automatically as class file.Of course
Do you act like this?
New a file -> Save -> In the 'Save as type' drop-down list select 'Java'.
If you look at it, you will find this: Java(*.class; *.java; *.jav; .java; .jav). And the '.class' was before the '.java', this means the file will be saved with the '.class' filename extension.
It's caused by the VSCode, but for now, you need manually to change the filename extension when you save the file.