Question
Chegg expert I need your help .It's Java exercises and I need the correct answers of those questions please they are very important for me
Chegg expert I need your help .It's Java exercises and I need the correct answers of those questions please they are very important for me and I don't have enough time please please give me the correct answers please thank you in advance
1. Please fill in the execution result of the program in the blank
class TestClass { public static int staticMember = 2; public int instanceMember = 2; public void increase() { staticMember += 3; instanceMember += 3; } public void print(){ System.out.println(staticMember+"\t"+this.instanceMember); } } public class Test { public static void main(String[] args) { TestClass m1 = new MyObj(); m1.print(); output is 1... m1.increase(); m1.print(); output is 2 .. MyObj m2 = new MyObj(); m2.increase(); m2.print(); output is 3... } }
=================================
2. Please fill in the execution result of the program in the blank
public class Test{ public static void main(String [] args){ int j=10; System.out.println(j); output is 4. calculate(j); output is 5 ... System.out.println(j); output is 6 int []a=new int[1]; calculate(a); output is 7 System.out.println(a[0]); output is 8 } static void calculate (int j){ for (int i = 0;i<10;i++) j++; System.out.println(j); } static void calculate (int []a){ a[0]++; a=new int[1]; a[0]=4; System.out.println(a[0]); } }
=================================
3. Please fill the following blanks. class TestClass3{ public static vod main(String[] args){ int i,j,k,count1=0, count2 = 0; for(i=1;i<3;i++) for( j=1; j<2; j++ ) for(k=1;k<3;k++){ if( i ==j ){ count1 ++ count1 final result is 9 } if (i == k) { count2++; count2 final result is 10 } } } } } }
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