Free Oracle 1z1-830 Exam Dumps Questions & Answers
| Exam Code/Number: | 1z1-830Join the discussion |
| Exam Name: | Java SE 21 Developer Professional |
| Certification: | Oracle |
| Free Question Number: | 85 |
| Publish Date: | Aug 19, 2026 |
| # of views: | 1442 |
|
|
|
Given:
java
import java.io.*;
class A implements Serializable {
int number = 1;
}
class B implements Serializable {
int number = 2;
}
public class Test {
public static void main(String[] args) throws Exception {
File file = new File("o.ser");
A a = new A();
var oos = new ObjectOutputStream(new FileOutputStream(file));
oos.writeObject(a);
oos.close();
var ois = new ObjectInputStream(new FileInputStream(file));
B b = (B) ois.readObject();
ois.close();
System.out.println(b.number);
}
}
What is the given program's output?
How would you create a ConcurrentHashMap configured to allow a maximum of 10 concurrent writer threads and an initial capacity of 42?
Which of the following options meets this requirement?
Given:
java
List<String> frenchAuthors = new ArrayList<>();
frenchAuthors.add("Victor Hugo");
frenchAuthors.add("Gustave Flaubert");
Which compiles?
Which StringBuilder variable fails to compile?
java
public class StringBuilderInstantiations {
public static void main(String[] args) {
var stringBuilder1 = new StringBuilder();
var stringBuilder2 = new StringBuilder(10);
var stringBuilder3 = new StringBuilder("Java");
var stringBuilder4 = new StringBuilder(new char[]{'J', 'a', 'v', 'a'});
}
}