Java

A visually appealing illustration representing Java 8 features, such as streams, lambda expressions, and multithreading, with a tech-themed background.

Java 8 Mastery Quiz

Test your knowledge on the exciting features of Java 8 with this engaging quiz! It covers a range of topics, from new APIs to innovative language enhancements.

Challenge yourself and see how well you understand:

  • Lambda Expressions
  • Stream API
  • Nashorn JavaScript Engine
  • Work-Stealing Thread Pool
10 Questions2 MinutesCreated by CodingNinja275
Which of the following is not introduced with Java 8?
A) Stream API
B) Serialization
C) Spliterator
D) Lambda Expression
Which is the new method introduced in java 8 to iterate over a collection?
A) for (String I : StringList)
B) foreach (String I : StringList)
C) StringList.forEach()
D) List.for()
Which feature of java 8 enables us to create a work stealing thread pool using all available processsors at its target?
A) workPool
B) newWorkStealingPool
C) threadPool
D) workThreadPool
What is the substitute of Rhino javascript engine in java 8?
A) Nashorn
B) V8
C) Inscript
D) Narcissus
In CGI, process starts with each request and will initiate OS level process.
A) True
B) False
Which class provides system independent server side implementation?
A) Socket
B) ServerSocket
C) Server
D) ServerReader
What is the output of below snippet?
 
try (InputStream is = ...)
{
// do stuff with is...
}
catch (IOException e)
{
// handle exception
}
A) Runtime Error
B) IOException
C) Compilation Error
D) Runs successfully
What is the output of this program?
 
  1. class Alligator 
  2.  {
  3.   public static void main(String[] args) 
  4.    {
  5.    int []x[] = {{1,2}, {3,4,5}, {6,7,8,9}};
  6.    int [][]y = x;
  7.    System.out.println(y[2][1]);
  8.    }
  9.  }
A) 2
B) 3
C) 7
D) Compilation Error

What is the output of this program?

  1.    final class A 
  2.     {
  3.          int i;
  4.     }    
  5.     class B extends A 
  6.     {
  7.         int j;
  8.         System.out.println(j + " " + i);  
  9.     }    
  10.     class inheritance 
  11.     {
  12.         public static void main(String args[])
  13.         {
  14.             B obj = new B();
  15.             obj.display();     
  16.         }
  17.    }
A) 2 2
B) 3 3
C) Runtime Error
D) Compilation Error

What is the output of this program?

  1.   class Abc
  2.   {
  3.       public static void main(String[]args)
  4.       {
  5.           String[] elements = { "for", "tea", "too" };
  6.           String first = (elements.length > 0) ? elements[0]: null;
  7.       }
  8.   }
A) Compilation error
B) An exception is thrown at run time
C) The variable first is set to null
D) The variable first is set to elements[0].
{"name":"Java", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Test your knowledge on the exciting features of Java 8 with this engaging quiz! It covers a range of topics, from new APIs to innovative language enhancements.Challenge yourself and see how well you understand:Lambda ExpressionsStream APINashorn JavaScript EngineWork-Stealing Thread Pool","img":"https:/images/course8.png"}
Powered by: Quiz Maker