At the example below, stack exceeds its limit because each time create() method is called and it creates "my" reference in stack. But the question here is in phylosophy. After the first create(), at the second time of create() calling, WHY JVM just dont overrides the "my" reference ? As I understand, It creates so many "my" references in stack memory , this is why it exceeds its limit. If my version would be true approach, I would get an OutOfMemory error rather than stackoverflow.
Why class variables dont be requirred to be initilized? I want to see compile error here, but compiler sets 0 for x. If it would be inside method (so local variable) , compiler would give compile time error. My question here is, why compiler differentiates in these case?
As we know that, firstly we compile "javac filename.java", then JDK generates filename.class file and to run bytecode we use "java filename.class". But I cannot understand, when I run "java filename.class" I got ClassNotFoundException, but When I run "java filename.java" I got the result. Why, it runs not bytecode, but raw *.java file?