What Is The Difference Between Compile Time Error and Runtime Error?
What Is The Difference Between Compile Time Error and Runtime Error?
What Is The Difference Between Compile Time Error and Runtime Error?
error?
The compile time errors are errors which are The runtime errors are errors which are not
produced at the compile time and they are generated by the compiler and produce an
detected by the compiler unpredictable result at execution time
In this case the compiler prevents the code from In this case the compiler does not detects an
execution if it detects an errors in the program errors in the program so it can not prevent the
code from execution
It contains the syntax and semantic errors such It contains the errors such as divison by zero
as missing semicolon at the end of statement determing the square root of a negative number
In this, methods must have same name While in this, methods must have same
and different signature. name and same signature.
-The final keyword in java is used to restrict the user. The java final keyword can be
used in many context. Final can be:
1. variable
2. method
3. class
The final keyword can be applied with the variables, a final variable that have no
value it is called blank final variable or uninitialized final variable. It can be initialized
in the constructor only. The blank final variable can be static also which will be
initialized in the static block only. We will have detailed learning of these. Let's first
learn the basics of final keyword.
2.finalize keyword