1Z0-803 Practice Questions
269 real 1Z0-803 exam questions with expert-verified answers and explanations. Page 6 of 6.
- Question #253
Given the code fragment? public class Test { public static void main(String[] args) { Test t = new Test(); int[] arr = new int[10]; arr = t.subArray(arr,0,2); } // insert code here...
- Question #254
Given: public class TestField { int x; int y; public void doStuff(int x, int y) { this.x = x; y =this.y; } public void display() { System.out.print(x + " " + y + " : "); } public s...
- Question #255
Given: package p1; public class Test { static double dvalue; static Test ref; public static void main(String[] args) { System.out.println(ref); System.out.println(dvalue); } } What...
- Question #256
Given: public class Natural { private int i; void disp() { while (i <= 5) { for (int i=1; i <=5;) { System.out.print(i + " "); i++; } i++; } } public static void main(String[] args...
- Question #257
Given: public class Test { static boolean bVar; public static void main(String[] args) { boolean bVar1 = true; int count =8; do { System.out.println("Hello Java! " +count); if (cou...
- Question #258
Given the code fragment: System.out.println(2 + 4 * 9 - 3); //Line 21 System.out.println((2 + 4) * 9 - 3); // Line 22 System.out.println(2 + (4 * 9) - 3); // Line 23 System.out.pri...
- Question #259
Given: class Base { public static void main(String[] args) { System.out.println("Base " + args[2]); } } public class Sub extends Base{ public static void main(String[] args) { Syst...
- Question #260
Given: interface Pet { } class Dog implements Pet { } public class Beagle extends Dog{ } Which three are valid?
- Question #261
Given the code fragment: // insert code here arr[0] = new int[3]; arr[0][0] = 1; arr[0][1] = 2; arr[0][2] = 3; arr[1] = new int[4]; arr[1][0] = 10; arr[1][1] = 20; arr[1][2] = 30;...
- Question #262
Given: public class Test { public static void main(String[] args) { int ax = 10, az = 30; int aw = 1, ay = 1; try { aw = ax % 2; ay = az / aw; } catch (ArithmeticException e1) { Sy...
- Question #263
Given the code fragment: for (int ii = 0; ii < 3;ii++) { int count = 0; for (int jj = 3; jj > 0; jj--) { if (ii == jj) { ++count; break; } } System.out.print(count); continue; } Wh...
- Question #264
Given the code fragment: class Student { int rollnumber; String name; List cources = new ArrayList(); // insert code here public String toString() { return rollnumber + " : " + nam...
- Question #265
Given the code fragment: public class ForTest { public static void main(String[] args) { int[] array = {1, 2, 3}; for ( foo ) { } } Which three code fragments, when replaced indivi...
- Question #266
Given: abstract class A1 { public abstract void m1(); public void m2() { System.out.println("Green"); } } abstract class A2 extends A1 { public abstract void m3(); public void m1()...
- Question #267
Which two statements correctly describe checked exception?
- Question #268
Given: public class ColorTest { public static void main(String[] args) { String[] colors = {"red", "blue","green","yellow","maroon","cyan"}; int count = 0; for (String c : colors)...
- Question #269
Given: public class App { // Insert code here System.out.print("Welcome to the world of Java"); } } Which two code fragments, when inserted independently at line // Insert code her...
- Question #270
Given the code fragment: public class Test { public static void main(String[] args) { boolean isChecked = false; int arry[] = {1,3,5,7,8,9}; int index = arry.length; while ( <code1...
- Question #271
Given: public class TestLoop { public static void main(String[] args) { int array[] = {0, 1, 2, 3, 4}; int key = 3; for (int pos = 0; pos < array.length; ++pos) { if (array[pos] ==...