Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Scope of Variables: What is the output of the following code? public class RQ{ private static int i = 0; private static int j =
Scope of Variables: What is the output of the following code? public class RQ{ private static int i = 0; private static int j = 0; public static int foo(){ int j = 10; System.out.println("i+j is " + i +j); return j; public static void main(String[] args) { int i = 2; int j = 3; System.out.println("j is " + i); j= foo(); System.out.println("j is " +j); O jis 3 i + j is 010 jis 10 O jis 0 i + j is 010 jis 10 O jis 3 i +j is 10 jis 0 O jis 0 i + j is 010 jis 3
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started