1Z0-803 Practice Questions
269 real 1Z0-803 exam questions with expert-verified answers and explanations. Page 1 of 6.
- Question #1
Given: Which two actions, used independently, will permit this class to compile?
- Question #2
Given: What is the result?
- Question #3
Given: Which statement, when inserted into line "// TODO code application logic here ", is valid change?
- Question #4
Given the code fragment: System.out.println("Result: " + 2 + 3 + 5); System.out.println("Result: " + 2 + 3 * 5); What is the result?
- Question #5
Which code fragment is illegal?
- Question #6
Given: What is the result?
- Question #7
Given the code fragment: int a = 0; a++; System.out.println(a++); System.out.println(a); What is the result?
- Question #8
Given a java source file: What changes will make this code compile?
- Question #9
Given: What is the result?
- Question #10
Given: What three modifications, made independently, made to class greet, enable the code to compile and run?
- Question #11
Given: Which three lines will compile and output "right on!"?
- Question #12
Given the code fragment: String h1 = "Bob"; String h2 = new String ("Bob"); What is the best way to test that the values of h1 and h2 are the same?
- Question #13
Which two are valid declarations of a two-dimensional array?
- Question #14
Given: Which two are possible outputs?
- Question #15
Given the code fragment: System.out.println ("Result:" +3+5); System.out.println ("result:" + (3+5)); What is the result?
- Question #16
A method doSomething () that has no exception handling code is modified to trail a method that throws a checked exception. Which two modifications, made independently, will allow t...
- Question #17
Which two may precede the word "class" in a class declaration?
- Question #18
Given the code fragment: What is the result?
- Question #19
Given: What code should be inserted?
- Question #20
Which three are bad practices?
- Question #21
Given: Which two declarations will compile?
- Question #22
Given: class X {} class Y {Y () {}} class Z {z(int i ) {} } Which class has a default constructor?
- Question #23
Given the code fragment: What values of x, y, z will produce the following result? 1 2 3 4 1 2 3 4 1 2 3 4 ------ 1 2 3 4 ------
- Question #24
Which statement initializes a stringBuilder to a capacity of 128?
- Question #25
Given: What is the result?
- Question #26
A method is declared to take three arguments. A program calls this method and passes only two arguments. What is the result?
- Question #27
Given the fragment: What is the result?
- Question #28
Given the following code fragment: What is the result if the integer value is 33?
- Question #29
Which three are advantages of the Java exception mechanism?
- Question #30
Given the code fragment: Boolean b1 = true; Boolean b2 = false; int 1 = 0; while (foo) {} Which one is valid as a replacement for foo?
- Question #31
Given: What should statement1, statement2, and statement3, be respectively, in order to produce the result? Shape: constructor Square: foo Shape: foo
- Question #32
Give: Public Class Test { } Which two packages are automatically imported into the java source file by the java compiler?
- Question #33
Given: What is the reference type of myZ and what is the type of the object it references?
- Question #34
Given: What is the result?
- Question #35
Given the code fragment: How many times is 2 printed?
- Question #36
Given: What is the result?
- Question #37
Given: What is true about the class Wow?
- Question #38
Which two will compile, and can be run successfully using the command: Java fred1 hello walls
- Question #39
Given: What is the result?
- Question #40
Given: What is the result?
- Question #41
Which two statements are true?
- Question #42
The catch clause argument is always of type___________.
- Question #43
Given: public class x{ public static void main (string [] args){ String theString = "Hello World"; System.out.println(theString.charAt(11)); } } What is the result?
- Question #44
Given the code fragment: What is the result?
- Question #45
View the exhibit: What is the result when this program is executed?
- Question #46
Given the code fragment: What is the result?
- Question #47
Given: What is the result?
- Question #48
Which two are valid instantiations and initializations of a multi dimensional array?
- Question #49
An unchecked exception occurs in a method dosomething() Should other code be added in the dosomething() method for it to compile and execute?
- Question #50
Given the code fragment: interface SampleClosable { public void close () throws java.io.IOException; } Which three implementations are valid?