1Z0-804 Exam Questions
160 real 1Z0-804 exam questions with expert-verified answers and explanations. Page 3 of 4.
- Question #101Localization
Given the code fragment: DateFormat df; Which statement defines a new Dateformat object that displays the default date format for the UK Locale?
DateFormatgetDateInstanceLocale.UKdate formatting - Question #102Concurrency
Given: Which of the four are valid modifications to synchronize access to the valid list between threads t1 and t2?
thread synchronizationsynchronized listvolatileconcurrent access - Question #103Concurrency
Sam has designed an application. It segregates tasks that are critical and executed frequently from tasks thatare non critical and executed less frequently. He has prioritized thes...
starvationthread prioritytask schedulingconcurrency problems - Question #104Object-Oriented Design Principles
Give: Which is correct?
cohesioncompositionhas-a relationshipOO design - Question #105
Given: Which two classes correctly override the getDepth method?
- Question #106Java Class Design
To provide meaningful output for: System.out.print( new Item ()): A method with which signature should be added to the Item class?
toStringObject methodsprint outputmethod override - Question #107Concurrency
Given the incomplete pseudo-code for a fork/join framework application: And given the missing methods: Process, submit, and splitInHalf Which three insertions properly complete the...
fork/join frameworkForkJoinPooltask splittingRecursiveAction - Question #108Java I/O Fundamentals
Given the code fragment: Assume the method printNums is passed a valid array containing data. Why is this method not producingoutput on the console?
System.errstandard errorI/O redirectionconsole output - Question #109Concurrency
Which method would you supply to a class implementing the Callable interface?
Callablecall methodinterface implementationconcurrency - Question #110Localization
Which two codes correctly represent a standard language locale code?
Localelanguage codescountry codesLocalization - Question #111Object-Oriented Design Principles
Given the fragment: Which two valid alternatives to line 3 would decouple this application from a specific implementation of CustomerDAO?
DAO patternfactory methoddecouplingdesign patterns - Question #112Localization
Given a language code of fr and a country code of FR, which file name represents a resource bundle file namethat is not the default?
resource bundlelocalefile namingproperties files - Question #113Java I/O Fundamentals
Assuming the port statements are correct, which two (three?) code fragments create a one- byte file?
FileOutputStreamOutputStreamfile creationI/O streams - Question #114
Given: What is the result?
- Question #115NIO.2
Given the code fragment: And a DOS-based file system: Which option, containing statement(s), inserted at line 3, creates the file and sets its attributes to hidden and read-only?
NIO.2FilesDOS attributesfile creation - Question #116NIO.2
When using the default file system provider with a JVM running on a DOS-based file system, which statementis true?
DOS file attributesNIO.2file system providerattribute views - Question #117Concurrency
Given the code fragment: Which three are true?
thread jointhread lifecyclechecked exceptionsconcurrency - Question #118Object-Oriented Design Principles
The two methods of code reuse that aggregate the features located in multiple classes are ____________ ?
compositioninheritancecode reuseOOP - Question #119Exceptions and Assertions
Given: What is the result?
exception handlingcustom exceptionscompilationexception hierarchy - Question #120Generics and Collections
View the exhibit: Given the code fragment: What is the result?
genericscollectionscompilationtype inference - Question #121Building Database Applications with JDBC
For which three objects must a vendor provide implementations in its JDBC driver?
JDBC driverConnectionStatementResultSet - Question #122
Given these facts about Java classes in an application: - Class X is-a Class SuperX. - Class SuperX has-a public reference to a Class Z. - Class Y invokes public methods in Class U...
- Question #123
Given: What is the result?
- Question #124Advanced Class Design
A valid reason to declare a class as abstract is to:
abstract classmethod signaturesinheritanceclass design - Question #125Java Class Design
Given: What is the result?
Stringcompilationimmutabilitytype mismatch - Question #126
Given this code fragment: Assume that the SQL query returns records. What is the result?
- Question #127Exceptions and Assertions
Given: What is the result?
exception handlingnull pointercompilationexception types - Question #128Concurrency
Which statement creates a low overhead, low-contention random number generator that is isolated to thread togenerate a random number between 1 and 100?
ThreadLocalRandomconcurrencyrandom numberthread-local - Question #129Concurrency
Given: What is the result?
concurrencyshared statethread safetyvariable visibility - Question #130Generics and Collections
Given: What is the result?
genericsbounded typescompilationtype bounds - Question #131Java Class Design
Given: What is the result?
interfaceabstract classcompilationclass design - Question #132Advanced Class Design
Given: Which statement is true?
interfaceabstract classinheritanceimplements - Question #133Java Class Design
Given: What is the result?
polymorphismmethod overridingcompilationvirtual method - Question #134Exceptions and Assertions
Given: What is the result?
runtime exceptionexception handlingstack execution - Question #135Java Class Design
Given two classes in separate files: Which two import statements can make the a.b.parent class compliable?
import statementspackage structureclass visibilitysubclass import - Question #136String Processing
Given: String s = new String("3"); System.out.print(1 + 2 + s + 4 + 5); What is the result?
string concatenationoperator precedencetype conversionnumeric literals - Question #137
Given the code fragment: What is the result?
- Question #138Exceptions and Assertions
Given: And the commands: javac Counter.java java ea Counter What is the result?
assertionsAssertionError-ea flagassertion enabling - Question #139Building Database Applications with JDBC
Given the database table: And given this class: Assume that the SQL integer queries are valid. What is the result of compiling and executing this codefragment?
ResultSetJDBC querySQL executiondata retrieval - Question #140
Given: Which two statements, inserted independently at line ***, enable the program to produce the following output: We have 002 Blue pants that cost $24.99.
- Question #141String Processing
Given: StringBuffer b = new StringBuffer("3"); System.out.print(5+4+b+2+1); What is the result?
StringBufferstring concatenationcompilation erroroperator overloading - Question #142
Given: Which two are true about the lines labeled A through D?
- Question #143
Given the directory structure that contains three directories: company, Salesdat, and Finance: Company - Salesdat * Target.dat - Finance * Salary.dat * Annual.dat And the code frag...
- Question #144Concurrency
Which type of ExecutorService supports the execution of tasks after a fixed delay?
ScheduledExecutorServiceExecutorServicetask schedulingdelayed execution - Question #145Advanced Class Design
Given: What is the result of invoking Car's scop method?
interface default methodsmultiple interface inheritancemethod resolutionpolymorphism - Question #146Advanced Class Design
Given: What is the result?
interface implementationabstract methodscompilation errorpolymorphism - Question #147
Given: What is the most likely result?
- Question #148
Which two are valid initialization statements?
- Question #149NIO.2
Given the code fragment: Which two try statements, when inserted at line ***, enable you to print files with the extensions.java, .htm, and.jar.
DirectoryStreamglob patternsfile filteringpath matching - Question #150
What will the following class print when run?