اكثر اسئلة واجوبة المقابلات طلبا والاختبارات عبر الإنترنت
منصة تعليمية للتحضير للمقابلات والاختبارات عبر الإنترنت والدروس والتدريب المباشر

طوّر مهاراتك من خلال مسارات تعلم مركزة واختبارات تجريبية ومحتوى جاهز للمقابلات.

يجمع 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

سؤال 21. Provide some examples of Terminal operations.

Example of Terminal operations are:
  • forEach
  • toArray
  • reduce
  • collect
  • min
  • max
  • count
  • anyMatch
  • allMatch
  • noneMatch
  • findFirst
  • findAny

هل هذا مفيد؟ اضف تعليقا عرض التعليقات
 

سؤال 22. Given the list of numbers, remove the duplicate elements from the list.

See the following code:

Integer[] arr=new Integer[]{1,2,3,4,3,2,4,2};
List<Integer> listWithDuplicates = Arrays.asList(arr);
Set<Integer> setWithoutDups = listWithDuplicates.stream().collect(Collectors.toSet());
setWithoutDups.forEach((i)->System.out.print(" "+i));

هل هذا مفيد؟ اضف تعليقا عرض التعليقات
 

سؤال 23. Difference between Stream findFirst() and findAny().

  • findFirst will always return the first element from the stream whereas findAny is allowed to choose any element from the stream.
  • findFirst has deterministic behavior whereas findAny is nondeterministic behavior.

هل هذا مفيد؟ اضف تعليقا عرض التعليقات
 

سؤال 24. What is consumer function interface?

It is a functional interface defined in java.util.function package. It contains an abstract accept() and a default andThen() method. It can be used as the assignment target for a lambda expression or method reference.
Consumer is single argument functional interface which does not return any value.

public static void main(String[] args) {  
   Consumer<String> consumerString = s->System.out.println(s);
   consumerString.accept("John");
}
 
We have created consumer object which takes String object as input and print it. It is simple use of Consumer interface to print String.
Output:
John

هل هذا مفيد؟ اضف تعليقا عرض التعليقات
 

سؤال 25. What is predicate function interface?

Predicate is single argument function which returns true or false. It has test method which returns boolean. Usually, it used to apply in a filter for a collection of objects.

public static void main(String[] args) {
Predicate<Integer> predicate = i -> i > 100;
boolean greaterCheck = predicate.test(200);
System.out.println("is 200 greater than 100: "+greaterCheck);
}

Output:
is 200 greater than 100: true

هل هذا مفيد؟ اضف تعليقا عرض التعليقات
 

الاكثر فائدة حسب تقييم المستخدمين:

حقوق النشر © 2026، WithoutBook.