Programming is a way to instruct the computer to perform various task.
Computers only understands Binary i.e., 0's and 1's.
Instructing computer in Binary is very difficult for humans so, to solve this issue we have programming languages.
Programming language:- It is a computer language used by programmers to communicate with computer.
Proceduaral
Functional
Object oriented
Static
Dynamic
Perform type checking at compile time
Perform type checking at runtime
Errors will show at compile time
Errors might not show till programs run
Declare datatypes before use
No need to declare datatype of variables
More control
Saves time in writing code but might give error at runtime.
There are 2 types of memory Stack and Heap.
When we declare a variable then the reference variable stored in stack memroy points to the object of that variable stored in heap memory.
For ex:- a = 10
Here "a" is called reference variable, and "10" is the object of that reference variable
Points to remember
Now supporse,
a=10
b=a
→ More than one reference variable can point towards one object.
→If any of the reference variable changes the object then it is changed for all reference variable that points towards same object.
→If there is an object without reference variable then object will be destroyed by "Garbage Collection".