Professional Documents
Culture Documents
M1088184 Assignment 2
M1088184 Assignment 2
Using static variables, static methods, static blocks, create a java program and
display the results. Using “this” word get data and display the results.
package static1;
static
{
System.out.println("Static block ");
n=88;
str= "Block";
}
Output:
Static block
n is = 88
str is = Block