Download presentation
Presentation is loading. Please wait.
1
Quiz 11 February 13, 2019
2
public class Test{ int x; static String y; double z; }
Code to the left will print public class Test{ int x; static String y; double z; } Hi Hello Hello Hello Hi Hi Hello Hi Correct answer Assuming constructor Test( int x, String y, double z){… } int a=2; String b1=“Hi”, b2=“Hello”; double c= 3.99; Test t1 =new Test(a,b1,c); Test t2 =new Test(a,b2,c); System.out.println(t1.y+ “ “+ t2.y);
3
public void test(int a, int b){ int temp=a; a=b+1; b=temp; }
Code to the left will print public void test(int a, int b){ int temp=a; a=b+1; b=temp; } 18, 11 11, 17 11, 18 17, 17 int x=11; int y=17; test(x,y); System.out.println(x+ “ ,“+ y);
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.