Question: For the following Java program, I know that method h() should be declared outside of method g() but what's the logic behind it? Also, If

For the following Java program, I know that method h() should be declared outside of method g() but what's the logic behind it? Also, If I call g() from main, would it execute only g or g and h together?

void g()

{ System.out.println( "Inside method g" );

void h() {

 System.out.println( "Inside method h" ); } 

}

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!