import java.io.*; import java.lang.*; class StaticAdd { public static void main(String args[]) { int n1=10,n2=20; //Static Defining of two Integer Variables n1+=n2; // Performing Addition System.out.println("Addition: "+n1); } }
OUTPUT:
Compilaton : javac StaticAdd.java Execution : java StaticAdd Addition:30