Notes
Types of errors: Syntax Error, Logical Error , Runtime Error
Syntax Errors (Compilation Error or Grammatical Error): Writing mistakes such as missing semicolon, missing
brackets, extra brackets, using unnecessary symbols are examples of Syntax Error.
Only this error is detected at compile time by compiler
Logical Error: Writing wrong logic like, using + where – is needed, incorrect mathematical expression.
Runtime error (also known as Exception): These errors get detected at runtime. Dividing a number by 0, finding
square root of a negative number – these are examples of run time error
Source Code: The High level code written by user is known as source code
Object Code: The Machine language Code (binary) we get after compiling the high level code is known as Object
Code
Some languages use compilers , others use interpreter, Java uses both:
In java, the user written source code (High Level Code) is compiled by java compiler and byte code is created , this
byte code is again given to java interpreter which converts the byte code into object code (Machine Level Code)
Source Code → Compiler → Byte Cde → Interpreter → Object Code
** Extension defines type of a file, for example music files are .mp3 , video files are .mp4 , MS WORD is .docx ,
powerpoint has .ppt , Just like that extension for java source code is .java
and extension for byte code is .class
Example: if a program has a class name “SUM” then the source code’s file name will be SUM.java and file name for
byte code will be SUM.class
JVM: Java interpreter is known as JVM (JAVA Virtual Machine)
ASCII Table:
Character ASCII CODE
A-Z 65-90
a-z 97-122
0-9 48-57
space ( ‘ ’ ) 32