top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What will be the output of the static blocks in this program of Java?

0 votes
417 views
posted Nov 23, 2016 by Anamika

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

first static block will be executed so the output will be S then M then constructer will be executed C.

answer Dec 28, 2016 by Dhaval Vaghela
Similar Questions
0 votes
#include<stdio.h>
int main()
{
   int n;
   for(n = 7; n!=0; n--)
     printf("n = %d", n--);
   getchar();
   return 0;
}
+3 votes

1.

main()
{
printf("%x",-1<<4);
}

2.

main()
{
int i=10;
i=!i>14;
Printf ("i=%d",i);
}
+2 votes
void main(){
   int i=320;
   char *ptr=(char *)&i;
   printf("%d",*ptr); 
}

Please provide your explanation also?

...