Consider the following program: <span>class Main {
int a = 10;
public static void main(String[] args) {
add();
}
private static void add() {
int b = a+20; System.out.println(b);
}<span> }
The output of the above program is 30. As you can see the variable a is declared outside the method, whereas variable b is declared inside the method.</span></span>
right click on the mouse then it will say copy, you right click on the mouse and click paste voila! it works! (If you're using word there are 3 options for pasting, Keep source formatting, Merge formatting and keep text only)