r/learnjava • u/ILLOGICAAAL • Feb 23 '26
Behavioral difference between Intellije terminal and Command prompt.
I was testing a java code on Topic- Inner classes and i found something...
- My code
- Compilation
-> javac com/Orynth/Outer.java
- Running
-> java com.Orynth.Outer
When running this in Intellije terminal and in Command prompt both give same output.
But, when running Inner.class
-> java com.Orynth.Outer$Inner
It is giving diffrent ans
Intellije terminal giving same output statement which is in outer class But,
Command prompt giving me - Error: main not found in Inner class
The thing is that CMD giving right answer, then why intellije terminal giving diffrent.
2
Upvotes
View all comments
Show parent comment
1
u/Spirited-Fox-135 Feb 24 '26
ya i mean i didn't knew this behav of zsh yet thanks for calling that out