Pertanyaan dan Jawaban Wawancara Paling Populer & Tes Online
Platform edukasi untuk persiapan wawancara, tes online, tutorial, dan latihan langsung

Bangun keterampilan dengan jalur belajar terfokus, tes simulasi, dan konten siap wawancara.

WithoutBook menghadirkan pertanyaan wawancara per subjek, tes latihan online, tutorial, dan panduan perbandingan dalam satu ruang belajar yang responsif.

Prepare Interview

Ujian Simulasi

Jadikan Beranda

Bookmark halaman ini

Langganan Alamat Email
WithoutBook LIVE Mock Interviews Java 8 Related interview subjects: 39

Interview Questions and Answers

Know the top Java 8 interview questions and answers for freshers and experienced candidates to prepare for job interviews.

Total 30 questions Interview Questions and Answers

The Best LIVE Mock Interview - You should go through before interview

Know the top Java 8 interview questions and answers for freshers and experienced candidates to prepare for job interviews.

Interview Questions and Answers

Search a question to view the answer.

Intermediate / 1 to 5 years experienced level questions & answers

Ques 1

What is lambda expression?

Lambda expression is anonymous function which have set of parameters and a lambda (->) and a function body. You can call it function without name.

Structure of Lambda Expressions:
(Argument List) ->{expression;} or
(Argument List) ->{statements;}

For instance, the Runnable interface is a functional interface, so instead of:
Thread thread = new Thread(new Runnable() {
    public void run() {
        System.out.println("Hello World!");
    }
});
 
Using Lambda you can simply do the following:
Thread thread = new Thread(() -> System.out.println("Hello World!"));

Functional interfaces are usually annotated with the @FunctionalInterface annotation - which is informative and does not affect the semantics.
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 2

Given a list of employees, sort all the employee on the basis of age by using java 8 APIs only.

You can simply use sort method of list to sort the list of employees.
List<Employee> employeeList = createEmployeeList();
        employeeList.sort((e1,e2)->e1.getAge()-e2.getAge());
        employeeList.forEach(System.out::println);
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 3

Given the list of employees, find the employee with name 'John' using Java 8 API.

Check the following code:
List<Employee> employeeList = createEmployeeList();
        Optional<Employee> e1 = employeeList.stream()
                  .filter(e->e.getName().equalsIgnoreCase("Mary")).findAny();
        if(e1.isPresent())
            System.out.println(e1.get());
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments
Ques 4

Given a list of employee, find maximum age of employee using Java 8 API.

Check the following code:
List<Employee> employeeList = createEmployeeList();
        OptionalInt max = employeeList.stream().
                          mapToInt(Employee::getAge).max();
        if(max.isPresent())
            System.out.println("Maximum age of Employee: "+max.getAsInt());
Simpan untuk Revisi

Simpan untuk Revisi

Bookmark item ini, tandai sebagai sulit, atau masukkan ke dalam set revisi.

Buka Perpustakaan Belajar Saya
Apakah ini membantu?
Add Comment View Comments

Most helpful rated by users:

Hak Cipta © 2026, WithoutBook.