Core java interview Questions You'll Most Likely Be Asked (Second Edition)


Download 1.52 Mb.
Pdf ko'rish
bet166/171
Sana07.01.2023
Hajmi1.52 Mb.
#1081886
1   ...   163   164   165   166   167   168   169   170   171
Bog'liq
Core JAVA Interview Questions Youll M...

Collec on Improvements
Explain with a code sample how the forEach method works.
What are some of the improvements made by Java 8 on the
List interface?
How does the Map.getOrDefault method work?
What is the output of the following code snippet?
Explain the differences between an Iterator and SplitIterator.
Miscellaneous
What are the advantages of CompletableFuture class over the
Future Interface?
What is StringJoiner? Explain with a code sample.
Explain the differences between the Comparator.reverse and
Comparator.reverseOrder methods.
dentify the error in the code below and explain what needs to
be done to fix it.


261.
262.
263.
264.
265.
266.
267.
268.
269.
270.
271.
Explain the differences between the
CompletableFuture.runAsync and the
CompletableFuture.supplyAsync methods.
Section 3– Java 9
Modules
What is a module? What benefits do they offer?
What is the module descriptor?
What is the difference between a package and a module?
Explain the changes made to JDK for Java 9.
Consider the following code snippet:
In order for this code to be deployed as part of a module, what
needs to be done?
Explain the requires static module directive. When should it be
used?
Stream/Collec on Improvements
What are some of the improvements made by Java 9 on the
Stream Interface?
Is the code below valid? If not, what can be done to fix it?
Identify the issue in the code snippet below and explain how it
can be fixed.
Which Java 9 method can you use to create a Set of String
values?


272.
273.
274.
275.
276.
277.
278.
279.
280.
281.
282.
What will be the output of the following code snippet?
Miscellaneous
What changes are made by Java 9 to interfaces and why?
What is JShell?
What is the output of the following code snippet?
What changes has Java 9 made to the try–with statement?
What is the use of the stream method added by Java 9 on the
Optional class?
Explain the ProcessHandle class and some of its important
methods.
In the code snippet below, explain what code should be used
at line 1 to print the output in the expected output section
below:
What are the advantages of the new HttpClient introduced by
Java 9?

Download 1.52 Mb.

Do'stlaringiz bilan baham:
1   ...   163   164   165   166   167   168   169   170   171




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling