Question: Question 5 What is the printout for the first statement in the main method? public class Foo { static int y = 0 ; public

Question 5
What is the printout for the first statement in the main method?
public class Foo {
static int y=0;
public static void main(String[] args){
new Foo();
}
public Foo(){
int y=5;
y++;
System.out.println("y ="+ y );
}
}
y=0
y=1
y=5
y=6
 Question 5 What is the printout for the first statement in

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!