Computer Science, asked by meghamulge67, 6 months ago

public class My First {
public static void main(String[] args) {
MyFirst obj = new MyFirst(n);
}
static int a
10;
static int n;
int b = 5;
int c;
public My First(int m) {
System.out.println(a + ", " + b + "," + C +","+n + ", " + m);
}
// Instance Block
{
b = 30;
n = 20;
}
// Static Block
static
{
a = 60;
}​

Answers

Answered by ambrishbharady947
5

Answer:

a = 60 b= 30 c= 0 (doubt) n= 20 m= 0 (doubt)

Answered by anusha195sl
0

Answer:

The correct answer is java programming.

Explanation:

Public class My First {

public static void main(String[] args) {

MyFirst obj = new MyFirst(n);

}

static int a =10;

static int n;

int b = 5;

int c;

public My First(int m) {

System.out.println(a + ", " + b + "," + C +","+n + ", " + m);

}

// Instance Block

{

b = 30;

n = 20;

}

// Static Block

static

{

a = 60;

}

Output:

a =60 , b = 30, n =20 and m =0.

From the above syntax we found the value of  a, b, n and m by using the static block concept.

#SPJ3

Similar questions