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
5
Answer:
a = 60 b= 30 c= 0 (doubt) n= 20 m= 0 (doubt)
Answered by
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
Math,
3 months ago
Math,
3 months ago
Computer Science,
3 months ago
English,
6 months ago
English,
6 months ago
Psychology,
10 months ago
Math,
10 months ago
English,
10 months ago