Самые популярные вопросы и ответы для интервью и онлайн-тесты
Образовательная платформа для подготовки к интервью, онлайн-тестов, учебных материалов и живой практики

Развивайте навыки с целевыми маршрутами обучения, пробными тестами и контентом для подготовки к интервью.

WithoutBook объединяет вопросы для интервью по предметам, онлайн-практику, учебные материалы и сравнительные руководства в одном удобном учебном пространстве.

Подготовка к интервью

Java 8 вопросы и ответы для интервью

Test your skills through the online practice test: Java 8 Quiz Online Practice Test

Связанные сравнения

Java 7 vs Java 8Java 8 vs Java 9

Вопрос 11. What is the difference between Predicate and Function?

Both are functional interfaces.
  • Predicate<T> is single argument function and either it returns true or false. This can be used as the assignment target for a lambda expression or method reference.
  • Function<T,R> is also single argument function but it returns an Object. Here T denotes type of input to the function and R denotes type of Result. This can also be used as the assignment target for a lambda expression or method reference.

Это полезно? Добавить комментарий Посмотреть комментарии
 

Вопрос 12. What the issues with Old Date and time API before Java 8? Date and Time API differences between Java 8 and earlier Java version.

Issues with old Date and Time API:
  • Thread Safety: You might be already aware that java.util.Date is mutable and not thread safe. Even java.text.SimpleDateFormat is also not Thread-Safe. New Java 8 date and time APIs are thread safe.
  • Performance: Java 8 new APIs are better in performance than old Java APIs.
  • More Readable: Old APIs such Calendar and Date are poorly designed and hard to understand. Java 8 Date and Time APIs are easy to understand and comply with ISO standards.

Это полезно? Добавить комментарий Посмотреть комментарии
 

Вопрос 13. Provide some APIs of Java 8 Date and Time.

LocalDate, LocalTime, and LocalDateTime are the Core API classes for Java 8. As the name suggests, these classes are local to context of observer. It denotes current date and time in context of Observer.

Это полезно? Добавить комментарий Посмотреть комментарии
 

Вопрос 14. How will you get current date and time using Java 8 Date and TIme API?

You can simply use now() method of LocalDate to get today’s date.
LocalDate currentDate = LocalDate.now();
System.out.println(currentDate);

Output:
2017-09-09

You can use now() method of LocalTime to get current time.
LocalTime currentTime = LocalTime.now();
System.out.println(currentTime);
 
Output:
23:17:51.817

Это полезно? Добавить комментарий Посмотреть комментарии
 

Вопрос 15. Do we have PermGen in Java 8? What is MetaSpace in Java 8?

Until Java 7, JVM used an area called PermGen to store classes. It got removed in Java 8 and replaced by MetaSpace.
Major advantage of MetaSpace over permgen:
PermGen was fixed in term of maximum size and can not grow dynamically but Metaspace can grow dynamically and do not have any size constraint.

Это полезно? Добавить комментарий Посмотреть комментарии
 

Самое полезное по оценкам пользователей:

Авторские права © 2026, WithoutBook.