1Z0-804 Exam Questions
160 real 1Z0-804 exam questions with expert-verified answers and explanations. Page 1 of 4.
- Question #1RAC Architecture
Given: Which three values will appear in the output?
Java code tracingoutput predictioncontrol flowvariable scope - Question #2
Which four are syntactically correct?
- Question #3RAC Architecture
Given: What is the result?
Java boolean expressionsoperator evaluationoutput prediction - Question #4RAC Architecture
Given: What is the result?
Java method overridinginheritancecompilation failurepolymorphism - Question #5RAC Architecture
Given these facts about Java types in an application: - Type x is a template for other types in the application. - Type x implements dostuff (). - Type x declares, but does NOT imp...
abstract classesinterfacesJava type systemabstraction rules - Question #6RAC Architecture
Given: What two changes, made independently, will enable the code to compile?
abstract classesinterfacesJava implementationcompilation fixes - Question #7
Given: Which fragment, inserted in the Books interface, enables the code to compile?
- Question #8RAC Architecture
Given: What is the result?
Java inheritancepolymorphismcompilationmethod resolution - Question #9RAC Architecture
Which two forms of abstraction can a programmer use in Java?
Java abstractioninterfacesabstract classesOOP - Question #10RAC Architecture
Given: What is the result?
Java inheritancemethod overridingcompilation failurestatic vs instance - Question #11Java Class Design
Given the classes: What is the result?
field initializationconstructor chainingdefault valuesinheritance - Question #12Advanced Class Design
Given: Which two statements are true about the writer class?
abstract classinterface methodsmethod signaturescompilation - Question #13
Given the two Java classes: Which two code snippets, added independently at line ***, can make the Buzzword class compile?
- Question #14Java Class Design
Given: Which statement will iterate through Direction?
enum iterationvalues() methodfor-each loopenum - Question #15Java Class Design
Given: What is the result?
compilation errorclass designinheritancemethod overriding - Question #16Java Class Design
Which four are true about enums?
enum typesafetyenum constructorComparableenum interface - Question #17
Given: Which statement, inserted at line 8, enables the code to compile?
- Question #18Building Database Applications with JDBC
Given the code fragment: String query = "SELECT ID FROM Employee"; \\ Line 1 try (Statement stmt = conn.CreateStatement()) { \\ Line 2 ResultSet rs = stmt.executeQuery(query); \\ L...
Statement reuseResultSet closureJDBC executiontry-with-resources - Question #19Object-Oriented Design Principles
Given: Which group of method is moved to a new class when implementing the DAO pattern?
DAO patterndata access objectmethod separationpersistence layer - Question #20Object-Oriented Design Principles
Given: Which three are true?
compositioninheritanceis-a relationshippolymorphism - Question #21Object-Oriented Design Principles
Given: Which three statements concerning the OO concepts "is-a" and "has-a" are true?
is-a relationshiphas-a relationshipinterfacesinheritance hierarchy - Question #22
Which two compile?
- Question #23Object-Oriented Design Principles
Given: What two changes should you make to apply the DAO pattern to this class?
DAO patterninterface designdata access methodsrefactoring - Question #24Object-Oriented Design Principles
Which is a key aspect of composition?
compositionmethod delegationdesign patternsobject relationships - Question #25
Which two are true about Singletons?
- Question #26Concurrency
What are two differences between Callable and Runnable?
CallableRunnablereturn valuechecked exceptions - Question #27Object-Oriented Design Principles
Which two properly implement a Singleton pattern?
Singleton patternprivate constructorenum singletonstatic instance - Question #28Object-Oriented Design Principles
Given: Which two statements concerning the OO concepts "IS-A" and "HAS-A" are true?
IS-A relationshipHAS-A relationshipinheritancecomposition - Question #29Generics and Collections
Given the integer implements comparable: What is the result?
ComparableInteger comparisoncompareTonatural ordering - Question #30Generics and Collections
Which statement declares a generic class?
generic classtype parameter syntaxgenerics declarationbounded types - Question #31Java Class Design
Given: What is the result?
enumswitch statementcontrol flowclass design - Question #32Java Class Design
Given the following code fragment: What is the result?
enumswitch statementfall-throughcontrol flow - Question #33Generics and Collections
Which concept allows generic collections to interoperate with java code that defines collections that use rawtypes?
type erasureraw typesgenerics compatibilitybackward compatibility - Question #34Generics and Collections
Given: What is the result?
runtime exceptionClassCastExceptiongenerics type safetyunchecked cast - Question #35Java Class Design
Given: What is the result?
inheritancefield accessconstructorobject state - Question #36Generics and Collections
Given: What is the result?
MapLinkedHashMapgetinsertion order - Question #37String Processing
Given: What is the result?
StringBuilderappendnull handlingstring concatenation - Question #38Advanced Class Design
Given the class? What is the result?
polymorphisminheritanceconstructor chainingmethod overriding - Question #39Generics and Collections
Given the cache class:
genericsbounded type parameterswildcardcompilation error - Question #40String Processing
Given: What is the result?
String.splitlimit parameterdelimiterregex - Question #41String Processing
Given: What is the result?
String.replacereplaceAllregexpattern matching - Question #42String Processing
Give: What is the result?
String.formatformat specifiersprintfinteger arithmetic - Question #43Generics and Collections
Given the code fragment: What is the result?
TreeSetNavigableSetheadSetsubset operations - Question #44Java Class Design
Given: What is the result?
enumenum valuesordinalname method - Question #45Exceptions and Assertions
Given: And the commands: javac Test.java java ea Test What is the result?
assert statementAssertionError-ea flagassertion enabling - Question #46Exceptions and Assertions
Given: And the command-line invocation: Java Tracker 12 11 What is the result?
custom exceptionexception hierarchythrowcatch - Question #47Exceptions and Assertions
Given the code fragment: What is the result when infected() is invoked?
try-catch-finallycontrol flowexception propagationreturn in finally - Question #48Java I/O Fundamentals
Given the existing destination file, a source file only 1000 bytes long, and the code fragment: What is the result?
FileOutputStreamwrite modeappendfile overwrite - Question #49NIO.2
Given the code fragment: What is the result, if the file myfile.txt does not exist?
PathFiles APIStandardOpenOptionchecked exception - Question #50
Given the code fragment: Why is there no output when otherMethod is called?