QUESTION 50 Which three statements concerning the use of the java.io.Serializable interface are true? (Choose three.) A. Objects from classes that use aggregation cannot be serialized. B. An object serialized on one JVM can be successfully deserialized on a different JVM. C. The values in fields with the volatile modifier will NOT survive serialization and deserialization. D. The values in field..
QUESTION 49 Given: NumberFormat nf = NumberFormat.getInstance();nf.setMaximumFractionDigits(4);nf.setMinimumFractionDigits(2); String a = nf.format(3.1415926); String b = nf.format(2); Which two statements are true about the result if the default locale is Locale.US? (Choose two.) A. The value of b is 2. B. The value of a is 3.14. C. The value of b is 2.00. D. The value of a is 3.141. E. The val..
QUESTION 48 Given that the current directory is empty, and that the user has read and write privileges to the current directory, and the following: 1. import java.io.*; 2. public class Maker { 3. public static void main(String[] args) { 4. File dir = new File("dir"); 5. File f = new File(dir, "f"); 6. } 7. } Which statement is true? A. Compilation fails. B. Nothing is added to the file system. C..
QUESTION 47 Given: 1. public class TestSeven extends Thread { 2. private static int x; 3. public synchronized void doThings() { 4. int current = x; 5. current++; 6. x = current; 7. } 8. public void run() { 9. doThings(); 10. } 11. } Which statement is true? A. Compilation fails. B. An exception is thrown at runtime. C. Synchronizing the run() method would make the class thread-safe. D. The data ..
QUESTION 46 Given class Foo { static void alpha() { /* more code here */ } void beta() { /* more code here */ } } Which two statements are true? (Choose two.) A. Foo.beta() is a valid invocation of beta(). B. Foo.alpha() is a valid invocation of alpha(). C. Method beta() can directly call method alpha(). D. Method alpha() can directly call method beta(). Solution : BC
QUESTION 45 Given: 1. package com.company.application; 2. 3. public class MainClass { 4. public static void main(String[] args) { 5. } 6. } And MainClass exists in the /apps/com/company/application directory. Assume the CLASSPATH environment variable is set to "." (current directory). Which two java commands entered at the command line will run MainClass? (Choose two.) A. java MainClass if run f..