Given:
public class CowArray extends Thread {
static List
public static void main(String[] args) {
myList.add(11);
myList.add(22);
myList.add(33);
myList.add(44);
new CowArray().start();
for(Integer i: myList) {
try { Thread.sleep(1000); }
catch (Exception e) { System.out.print("e1 "); }
System.out.print(" " +i);
}
}
public void run() {
try { Thread.sleep(500); }
catch (Exception e) { System.out.print("e2 "); }
myList.add(77);
System.out.print("size: " + myList.size() + ", elements:");
}
}
What is the most likely result?
A. size: 4, elements: 11 22 33 44Given 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 Util.
-
Class X uses public variables in Class Util.
Which three statements are true?
A. Class X has-a Class Z.Given the code fragment:
public static void main(String[] args) {
String source ="d:\\company\\info.txt";
String dest ="d:\\company\\emp\\info.txt";
// insert code fragment here. Line ***
} catch (IOException e) {
System.err.println("Caught IOException"+ e.getMessage());
}
}
Which two try statements, when inserted at line ***, enable the code to successfully move the file info.txt to the destination directory, even if a file by the same name already exists in
the destination directory?
A. try (FileChannel in = new FileInputStream (source). getChannel(); FileChannel out = new FileOutputStream(dest).getChannel()) { in.transferTo(0, in.size(), out);Given the code format:
SimpleDateFormat sdf;
Which code statements will display the full text month name?
A. sdf = new SimpleDateFormat ("mm", Locale.UK); System.out.println("Result: ", sdf.format(new date()));Which two properly implement a Singleton pattern?
A. class Singleton { private static Singleton instance; private Singleton () {} public static synchronized Singleton getInstance() { if (instance = = null) { instance = new Singleton (); } return instance; } }Given the code fragment:
public class Rank {
static CopyOnWriteArraySet
static void verify() {
String var ="";
Iterator
while (e.hasNext()) {
var = e.next();
if(var.equals("A"))
arr.remove(var);
}
}
public static void main (String[] args) {
ArrayList
list1.add("A"); list1.add("B");
ArrayList
list1.add("A"); list1.add("D");
arr.addAll(list1);
arr.addAll(list2);
verify();
for(String var : arr)
System.out.print(var + " ");
}
}
What is the result?
A. Null B DGiven the following incorrect program:

Which two changes make the program work correctly?
A. Results must be retrieved from the newly created MyTask instances and combined.Which two code blocks correctly initialize a Locale variable?
A. Locale loc1 = "UK";Given:
Which three are true?
A. BasicCar uses composition.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 value current access?
A. Public class generator Implements IdGenerator { Private AtomicInteger id = new AtomicInteger (0); return id.incrementAndget(); } }Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only Oracle exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your 1Z0-804 exam preparations and Oracle certification application, do not hesitate to visit our Vcedump.com to find your solutions here.