Here, it is not scripting language right? it will not execute the code line by line rather it will execute by a file i.e it will convert the java file into a bytecode (.class ) which is platform independent. Then why are you saying it will read the instruction line by line…?
Java Concept doubt
I agree that Java is not a scripting language and but a compiled as well as interpreted language.
Java implementations typically use a two-step compilation process.
- Java source code is compiled down to bytecode by the Java compiler.
- The bytecode is executed by a Java Virtual Machine (JVM).
If there are no errors in your source file, then only the Java compiler will produce one or more .class files (bytecode).
The code won’t execute line by line but the flow of instruction flow is always line by line ie. the first line to be read by the interpreter will be the first line of main function and then the next line of main function and so on.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.