1Z0-804 Exam Questions
160 real 1Z0-804 exam questions with expert-verified answers and explanations. Page 2 of 4.
- Question #51
Given the code fragment: What is the result, if the file salesreport.dat does not exist?
- Question #52
Given the code fragment: If the file userguide.txt does not exist, what is the result?
- Question #53
Given that myFile.txt contains: What is the result?
- Question #54
Given the code fragment: Which code fragment inserted at line ***, enables the code to compile?
- Question #55
Given that myfile.txt contains: What is the result?
- Question #56
Given: What is the result?
- Question #57
Given the code fragment: Which two try statements, when inserted at line ***, enable the code to successfully move the file info.txt to thedestination directory, even if a file by...
- Question #58
The default file system includes a logFiles directory that contains the following files: Log-Jan 2009 log_0l_20l0 log_Feb20l0 log_Feb2011 log_10.2012 log-sum-2012 How many files do...
- Question #59
Given the following files in doc directory: - Index.htm - Service.html - Logo.gif - Title.jpg And the code fragment: What is the result, if doc is present in the current directory?
- Question #60
Which code fragment correctly appends "Java 7" to the end of the file /tmp/msg.txt?
- Question #61
Given the following code fragment: 10. p1 = paths.get("report.txt"); 11. p2 = paths.get("company"); 12. / / insert code here Which code fragment, when inserted independently at lin...
- Question #62
Given the code fragment: What is the result when the result.txt file already exists in c:\student?
- Question #63
An application is waiting for notification of changes to a tmp directory using the following code statements: Path dir = Paths.get("tmp") WatchKey key = dir.register (watcher, ENTR...
- Question #64
Given: What is the result?
- Question #65
Given the code fragment: What is the result?
- Question #66
ITEM Table * ID, INTEGER: PK * DESCRIP, VARCHAR(100) * PRICE, REAL * QUALITY, INTEGER And given the code fragment (assuming that the SQL query is valid): What is the result of comp...
- Question #67
Which code fragment demonstrates the proper way to handle JDBC resources?
- Question #68
Given the code fragment: What is the result of the employees table has no records before the code executed?
- Question #69
Given the code fragment: Assume that the SQL queries return records. What is the result of compiling and executing this code fragment?
- Question #70
Which two actions can be used in registering a JDBC 3.0 driver?
- Question #71
Given the code fragment: What change should you make to apply good coding practices to this fragment?
- Question #72
Which two statements are true about RowSet subinterfaces?
- Question #73
Which code fragment is required to load a JDBC 3.0 driver?
- Question #74
Which three are true?
- Question #75
Given the code fragment: Assume that the SQL query matches one record. What is the result of compiling and executing this code?
- Question #76
Given: Which two are true?
- Question #77
Which two demonstrate the valid usage of the keyword synchronized?
- Question #78
Given: What is the result?
- Question #79
Given the fragment: If thread a and thread b are running, but not completing, which two could be occurring?
- Question #80
Which three statements are correct about thread's sleep method?
- Question #81
Given: Which two are true?
- Question #82
Which class(es) safely protects the doIt () method from concurrent thread access?
- Question #83
Given the interface: Public interface Idgenerator { int getNextId(); } Which class implements IdGenerator in a thread-safe manner, so that no threads can get a duplicate id valuecu...
- Question #84
Given the code fragment: What is the result?
- Question #85
Given: From what threading problem does the program suffer?
- Question #86
Given: ConcurrentMap <String, String> PartList = new ConcurrentMap<>(); Which fragment puts a key/value pair in partList without the responsibility of overwriting an existing key?
- Question #87
Give: What is the likely result?
- Question #88
Given: import java.util.concurrent.atomic.AtomicInteger; public class AtomicCounter { private AtomicInteger c = new AtomicInteger(0); public void increment() { // insert code here...
- Question #89
Given the following incorrect program: Which two changes make the program work correctly?
- Question #90
How many Threads are created when passing task to an Executor instance?
- Question #91
Given: What is the most likely result?
- Question #92
Given this error message when running your application: Exception in thread "main" java.util.MissingResourceException: Can't find bundle for base name MessageBundle, locale And giv...
- Question #93
Which two code blocks correctly initialize a Locale variable?
- Question #94
Given the code fragment: SimpleDataFormat sdf; Which code fragment displays the three-character month abbreviation?
- Question #95
Given three resources bundles with these values set for menu1: (the default resource bundle in US English.) English US Resource Bundle Menu1 = small French Resource Bundle Menu1 =...
- Question #96
Which is a factory method from the java.text.NumberFormat class?
- Question #97
Given the code format: SimpleDateFormat sdf; Which code statements will display the full text month name?
- Question #98
Select four examples that initialize a NumberFormat reference using a factory.
- Question #99
Given the Greetings.properties file, containing: What is the result?
- Question #100
You have been asked to create a ResourceBundle file to localize an application. Which code example specifies valid keys menu1 and menu2 with values of File Menu and View Menu?