Today we will know about the local, instance, static or class prequel.
First look at the code below
We see at the number 3 above the line it’s static int b = 10; This is static or class variable.
It is in the class and out of the method. But static is written as class is the variable and the method is
Static or Class variable:
We are looking at the number 2 above the int c = 10; This is the instance variable. It is outside of class and outside the method. Here square is the variable and the method is Main. Everyone understands.
We are looking at the number 5 above the int a = 10; This is a local variable. It is in the method. Here is the method main. Everyone understands. Thank you. If you have trouble understanding then do.
You can see the video as helpful