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
Get step-by-step solutions from verified subject matter experts
