Principais perguntas e respostas de entrevista e testes online
Plataforma educacional para preparacao de entrevistas, testes online, tutoriais e pratica ao vivo

Desenvolva habilidades com trilhas de aprendizado focadas, simulados e conteudo pronto para entrevistas.

WithoutBook reune perguntas de entrevista por assunto, testes praticos online, tutoriais e guias comparativos em um unico espaco de aprendizado responsivo.

Preparar entrevista

Java 8 perguntas e respostas de entrevista

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

Diferencas relacionadas

Java 7 vs Java 8Java 8 vs Java 9

Pergunta 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.

Isto e util? Adicionar comentario Ver comentarios
 

Pergunta 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.

Isto e util? Adicionar comentario Ver comentarios
 

Pergunta 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.

Isto e util? Adicionar comentario Ver comentarios
 

Pergunta 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

Isto e util? Adicionar comentario Ver comentarios
 

Pergunta 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.

Isto e util? Adicionar comentario Ver comentarios
 

Mais uteis segundo os usuarios:

Copyright © 2026, WithoutBook.